29.06.2014, 09:37
Replace the Dialogresponse with this:
You should also add it to your filterscripts line in your server.cfg, or if it's a gamemode, change the gamemode to that name in your server.cfg
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{ //Hehe.
if(dialogid == DIALOGWEAPONS)
{
if(response)
{
switch(listitem)
{
case 0:
{
if(GetPlayerMoney(playerid) <1500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item! chea!");
SendClientMessage(playerid, COLOR_GREEN , "You bought a deagle!");
GivePlayerMoney(playerid, -1500);
GivePlayerWeapon(playerid,24, 9999999);
}
case 1:
{
if(GetPlayerMoney(playerid) <2500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
SendClientMessage(playerid, COLOR_GREEN , "You bought a shotgun ");
GivePlayerMoney(playerid, -2500);
GivePlayerWeapon(playerid, 25, 9999999);
}
case 2:
{
if(GetPlayerMoney(playerid) <2000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
SendClientMessage(playerid, COLOR_GREEN , "You bought an MP5!");
GivePlayerMoney(playerid, -2000);
GivePlayerWeapon(playerid, 29 ,9999999);
}
case 3:
{
if(GetPlayerMoney(playerid) <5000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
SendClientMessage(playerid, COLOR_GREEN , "You bought a spas");
GivePlayerMoney(playerid, -5000);
GivePlayerWeapon(playerid, 27, 9999999);
}
case 4:
{
if(GetPlayerMoney(playerid) <3000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
SendClientMessage(playerid, COLOR_GREEN , "You bought an AK-47 for 50k!");
GivePlayerMoney(playerid, -3000);
GivePlayerWeapon(playerid,30 ,9999999);
}
case 5:
{
if(GetPlayerMoney(playerid) <3500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
SendClientMessage(playerid, COLOR_GREEN , "You bought an M4 for 60k!");
GivePlayerMoney(playerid, -3500);
GivePlayerWeapon(playerid, 31, 9999999);
}
case 6:
{
if(GetPlayerMoney(playerid) <10000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
SendClientMessage(playerid, COLOR_GREEN , "You bought a sniper for 150k!");
GivePlayerMoney(playerid, -10000);
GivePlayerWeapon(playerid, 34, 9999999);
}
case 7:
{
if(GetPlayerMoney(playerid) <5000) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
new Float:armour;
GetPlayerArmour(playerid, armour);
if(armour == 100) return SendClientMessage(playerid, COLOR_RED,"You already have a full vest!");
SendClientMessage(playerid, COLOR_GREEN , "You bought a half vest for 10k!");
GivePlayerMoney(playerid, -5000);
SetPlayerArmour(playerid, 50);
}
case 8:
{
if(GetPlayerMoney(playerid) <2500) return SendClientMessage(playerid, COLOR_RED, "You don't have enough money to buy this item!");
new Float:armour;
GetPlayerArmour(playerid, armour);
if(armour == 100) return SendClientMessage(playerid, COLOR_RED, "You already have a full vest!");
SendClientMessage(playerid, COLOR_GREEN , "You bought a full vest for 20k!");
GivePlayerMoney(playerid, -2500);
SetPlayerArmour(playerid, 100);
}
}
return 1;
}
}