Код:

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
PlayerPlaySound(playerid,1139,0.0,0.0,0.0);
if(response)
{
switch(dialogid)
{
case guns:
{
switch(listitem)
{
case 0:
{
if(GetPlayerScore(playerid) < 1) return NoSuccess(playerid,"You need rank 1.");
if(GetPlayerMoney(playerid) < 500) return NoSuccess(playerid,"You need $500 to buy this weapon.");
SendClientMessage(playerid,0xFA7070FF,"You have bought a 9mm!");
GivePlayerMoney(playerid,-500);
GivePlayerWeapon(playerid,22,50);
}
case 1:
{
if(GetPlayerScore(playerid) < 3) return NoSuccess(playerid,"You need rank 3.");
if(GetPlayerMoney(playerid) < 750) return NoSuccess(playerid,"You need $750 to buy this weapon.");
SendClientMessage(playerid,0xFA7070FF,"You have bought a SD Pistol!");
GivePlayerMoney(playerid,-750);
GivePlayerWeapon(playerid,23,100);
}
case 2:
{
if(GetPlayerScore(playerid) < 5) return NoSuccess(playerid,"You need rank 5.");
if(GetPlayerMoney(playerid) < 1500) return NoSuccess(playerid,"You need $1500 to buy this weapon.");
SendClientMessage(playerid,0xFA7070FF,"You have bought a Deagle!");
GivePlayerMoney(playerid,-1500);
GivePlayerWeapon(playerid,24,100);
}
case 3:
{
if(GetPlayerScore(playerid) < 5) return NoSuccess(playerid,"You need rank 5.");
if(GetPlayerMoney(playerid) < 1500) return NoSuccess(playerid,"You need $1500 to buy this weapon.");
SendClientMessage(playerid,0xFA7070FF,"You have bought a Shotgun!");
GivePlayerMoney(playerid,-1500);
GivePlayerWeapon(playerid,25,100);
}
case 4:
{
if(GetPlayerScore(playerid) < 10) return NoSuccess(playerid,"You need rank 10.");
if(GetPlayerMoney(playerid) < 5000) return NoSuccess(playerid,"You need $5000 to buy this weapon.");
SendClientMessage(playerid,0xFA7070FF,"You have bought a Spaz12!");
GivePlayerMoney(playerid,-5000);
GivePlayerWeapon(playerid,26,100);
}
case 5:
{
if(GetPlayerScore(playerid) < 10) return NoSuccess(playerid,"You need rank 10.");
if(GetPlayerMoney(playerid) < 5000) return NoSuccess(playerid,"You need $5000 to buy this weapon.");
SendClientMessage(playerid,0xFA7070FF,"You have bought a Sawn-Off!");
GivePlayerMoney(playerid,-5000);
GivePlayerWeapon(playerid,27,100);
}
case 6:
{
if(GetPlayerScore(playerid) < 8) return NoSuccess(playerid,"You need rank 8.");
if(GetPlayerMoney(playerid) < 3000) return NoSuccess(playerid,"You need $3000 to buy this weapon.");
SendClientMessage(playerid,0xFA7070FF,"You have bought a Tec9!");
GivePlayerMoney(playerid,-3000);
GivePlayerWeapon(playerid,32,100);
}
case 7:
{
if(GetPlayerScore(playerid) < 7) return NoSuccess(playerid,"You need rank 7.");
if(GetPlayerMoney(playerid) < 2500) return NoSuccess(playerid,"You need $2500 to buy this weapon.");
SendClientMessage(playerid,0xFA7070FF,"You have bought an UZI!");
GivePlayerMoney(playerid,-2500);
GivePlayerWeapon(playerid,28,100);
}
case 8:
{
if(GetPlayerScore(playerid) < 10) return NoSuccess(playerid,"You need rank 10.");
if(GetPlayerMoney(playerid) < 4000) return NoSuccess(playerid,"You need $4000 to buy this weapon.");
SendClientMessage(playerid,0xFA7070FF,"You have bought an UZI!");
GivePlayerMoney(playerid,-4000);
GivePlayerWeapon(playerid,33,100);
}
case 9:
{
if(GetPlayerScore(playerid) < 20) return NoSuccess(playerid,"You need rank 20.");
if(GetPlayerMoney(playerid) < 10000) return NoSuccess(playerid,"You need $10000 to buy this weapon.");
SendClientMessage(playerid,0xA80000FF,"You have bought a Sniper Rifle!");
GivePlayerMoney(playerid,-10000);
GivePlayerWeapon(playerid,34,1);
}
}
}