Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 2 && response)
{
if(response)
{
GivePlayerWeapon(playerid,WEAPON_COLT45,100);
GivePlayerMoney(playerid,-1000);
if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash.");
return 1;
if(dialogid == 1 && response)
{
if(response)
{
GivePlayerWeapon(playerid,WEAPON_COLT45,100);
GivePlayerMoney(playerid,-1000);
if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash.");
}
if(listitem == 1)
{
GivePlayerWeapon(playerid,WEAPON_SILENCED,100);
GivePlayerMoney(playerid,-1200);
if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash.");
}
if(listitem == 2)
{
GivePlayerWeapon(playerid,WEAPON_DEAGLE,75);
GivePlayerMoney(playerid,-1500);
if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash.");
}
if(listitem == 3)
{
GivePlayerWeapon(playerid,25,50);
GivePlayerMoney(playerid,-2000);
if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash.");
}
if(listitem == 4)
{
GivePlayerWeapon(playerid,WEAPON_SAWEDOFF,50);
GivePlayerMoney(playerid,-2500);
if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash.");
}
if(listitem == 5)
{
GivePlayerWeapon(playerid,WEAPON_SHOTGSPA,25);
GivePlayerMoney(playerid,-2500);
if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash.");
}
if(listitem == 6)
{
GivePlayerWeapon(playerid,WEAPON_UZI,150);
GivePlayerMoney(playerid,-2000);
if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash.");
}
if(listitem == 7)
{
GivePlayerWeapon(playerid,WEAPON_MP5,200);
GivePlayerMoney(playerid,-4000);
if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash.");
}
if(listitem == 8)
{
GivePlayerWeapon(playerid,WEAPON_AK47,200);
GivePlayerMoney(playerid,-5000);
if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash.");
}
if(listitem == 9)
{
GivePlayerWeapon(playerid,WEAPON_M4,200);
GivePlayerMoney(playerid,-5000);
if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash.");
}
if(listitem == 10)
{
GivePlayerWeapon(playerid,WEAPON_TEC9,150);
GivePlayerMoney(playerid,-2500);
if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash.");
}
if(listitem == 11)
{
GivePlayerWeapon(playerid,WEAPON_RIFLE,25);
GivePlayerMoney(playerid,-3000);
if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash.");
}
if(listitem == 12)
{
GivePlayerWeapon(playerid,WEAPON_SNIPER,20);
GivePlayerMoney(playerid,-4000);
if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash.");
}
if(listitem == 13)
{
SetPlayerHealth(playerid, 100.0 );
GivePlayerMoney(playerid,-4000);
if(GetPlayerMoney(playerid) < 1) return SendClientMessage(playerid, COLOR_RED, "You don't have enough cash.");
}
}
return 1;
}
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
new message[32];
format(message, sizeof(message), "You clicked on player %d", clickedplayerid);
SendClientMessage(playerid, 0xFFFFFFFF, message);
return 1;
}