30.08.2012, 11:46
PHP код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)
{
if(response == 0) return SendClientMessage(playerid,COLOR_GREEN,"You bought SMG for $30000!") && GivePlayerMoney(playerid,-30000);
switch(listitem)
{
case 0:
{
if(GetPlayerMoney(playerid) > 30000)
{
SendClientMessage(playerid,COLOR_RED,"You don't have $30000!");
}
if(GetPlayerMoney(playerid) < 30000)
{
SendClientMessage(playerid,COLOR_GREEN,"You bought SMG for $30000!");
GivePlayerWeapon(playerid,29,500);
GivePlayerMoney(playerid,-30000);
}
}
case 1:
{
if(GetPlayerMoney(playerid) > 30000)
{
SendClientMessage(playerid,COLOR_RED,"You don't have $30000!");
}
if(GetPlayerMoney(playerid) < 30000)
{
SendClientMessage(playerid,COLOR_GREEN,"You bought UZI for $30000!");
GivePlayerWeapon(playerid,28,500);
GivePlayerMoney(playerid,-30000);
}
}
case 2:
{
if(GetPlayerMoney(playerid) > 100000) return SendClientMessage(playerid,COLOR_RED,"You don't have $100000!");
{
if(GetPlayerMoney(playerid) < 100000)
{
SendClientMessage(playerid,COLOR_GREEN,"You bought AK47 for $100000!");
GivePlayerWeapon(playerid,30,500);
GivePlayerMoney(playerid,-100000);
}
}
}
case 3:
{
if(GetPlayerMoney(playerid) > 150000)
{
SendClientMessage(playerid,COLOR_RED,"You don't have $150000!");
}
if(GetPlayerMoney(playerid) < 150000)
{
SendClientMessage(playerid,COLOR_GREEN,"You bought M4 for $150000!");
GivePlayerWeapon(playerid,31,500);
GivePlayerMoney(playerid,-150000);
}
}
}
}
if(dialogid == 2)
{
if(strlen(inputtext) == 0) return SendClientMessage(playerid,COLOR_RED,"No text wrote!");
new string[128];
format(string, sizeof(string), "NEW BUG REPORT: %s", inputtext);
print(string);
}
return 1;
}