#define DIALOG_WAFFENKAUF (1)
ocmd:wmenu(playerid,params[])
{
if(IsPlayerInRangeOfPoint(playerid, W,X,Y,Z))// w= wie weit er entwernd sein darf vom punkt wo man das /wmenu eingibt
{
ShowPlayerDialog(playerid,DIALOG_WAFFENKAUF,DIALOG_STYLE_LIST,"Waffen kaufn","Deagle\nMP5\nAk47\nM4","Kaufen","Abbrechen");
return 1;
}
else
{
SendClientMessage(playerid,ROT,"Du bist nicht im Waffen laden.");
return 1;
}
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == DIALOG_WAFFENKAUF)
{
if(response)
{
if(listitem == 0)
{
if(GetPlayerMoney(playerid) < 3000)
{
SendClientMessage(playerid,ROT,"Du hast zuwenig geld!");
return 1;
}
else
{
GivePlayerMoney(playerid,-3000);
GivePlayerWeapon(playerid,24,100);
return 1;
}
}
if(listitem == 1)
{
if(GetPlayerMoney(playerid) < 3000)
{
SendClientMessage(playerid,ROT,"Du hast zuwenig geld!");
return 1;
}
else
{
GivePlayerMoney(playerid,-3000);
GivePlayerWeapon(playerid,29,150);
return 1;
}
}
if(listitem == 2)
{
if(GetPlayerMoney(playerid) < 3000)
{
SendClientMessage(playerid,ROT,"Du hast zuwenig geld!");
return 1;
}
else
{
GivePlayerMoney(playerid,-3000);
GivePlayerWeapon(playerid,30,100);
return 1;
}
}
if(listitem == 3)
{
if(GetPlayerMoney(playerid) < 3000)
{
SendClientMessage(playerid,ROT,"Du hast zuwenig geld!");
return 1;
}
else
{
GivePlayerMoney(playerid,-3000);
GivePlayerWeapon(playerid,31,100);
return 1;
}
}
}
}
return 1;
}
musst noch einrücken
Habe es net getestet müsste aber gehen