21.11.2010, 00:22
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
switch(dialogid)
{
case 0://this could be any dialog you sure you want it id 0?
{
if(response)//player clicked ok or double clicked a selection
{
switch(listitem)//switch the listitems
{
case 0:// 0 is the first item in the list
{
if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, COLOR_RED, "You cannot afford an UZI yet, you need $5,000");
GivePlayerWeapon(playerid, 28, 50);
SendClientMessage(playerid, COLOR_PINK, "You have just baught a mini uzi with 50 ammunition for $5000!");
GivePlayerMoney(playerid, -5000);
}
case 1:
{
if(GetPlayerMoney(playerid) > 7000) return SendClientMessage(playerid, COLOR_RED, "You cannot afford an AK47 yet, You need $7,000");
GivePlayerWeapon(playerid, 30, 50);
SendClientMessage(playerid, COLOR_PINK, "You have just baught an AK47 with 50 ammunition!");
GivePlayerMoney(playerid, -7000);
}
case 2:
{
if(GetPlayerMoney(playerid) > 10000) return SendClientMessage(playerid, COLOR_RED, "You cannot afford an M4, it costs $10,000");
GivePlayerWeapon(playerid, 31, 50);
SendClientMessage(playerid, COLOR_PINK, "You have just baught an M4 carbine with 50 ammunition!");
GivePlayerMoney(playerid, -10000);
}
}
else SendClientMessage(playerid, 0x00ff0000FF, "Cancelled");
}
case NEXT_DIALOGID:
{
}
}
return 1;
}