09.01.2015, 16:29
This should work
and for the warning just organize the script
PHP код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 67)
{
if(!response) return 1;
if(response)
{
switch(listitem)
{
case 0:
{
if(GetPlayerMoney(playerid) < 100)
return SendClientMessage(playerid, 0x33FF00AA, "You don't have enough cash to buy this Weapon.");
GivePlayerMoney(playerid, -100);
GivePlayerWeapon(playerid, 4, 1);
SendClientMessage(playerid, 0x33FF00AA, "You have succesfully buyed your weapon.");
}
case 1:
{
if(GetPlayerMoney(playerid) < 100)
return SendClientMessage(playerid, 0x33FF00AA, "You don't have enough cash to buy this Weapon.");
GivePlayerMoney(playerid, -100);
GivePlayerWeapon(playerid, 9, 1);
SendClientMessage(playerid, 0x33FF00AA, "You have succesfully buyed your weapon.");
}
case 2:
{
if(GetPlayerMoney(playerid) < 1500)
return SendClientMessage(playerid, 0x33FF00AA, "You don't have enough cash to buy this Weapon.");
GivePlayerMoney(playerid, -1500);
GivePlayerWeapon(playerid, 16, 1);
SendClientMessage(playerid, 0x33FF00AA, "You have succesfully buyed your weapon.");
}
case 3:
{
if(GetPlayerMoney(playerid) < 2000)
return SendClientMessage(playerid, 0x33FF00AA, "You don't have enough cash to buy this Weapon.");
GivePlayerMoney(playerid, -2000);
GivePlayerWeapon(playerid, 18, 2);
SendClientMessage(playerid, 0x33FF00AA, "You have succesfully buyed your weapon.");
}
case 4:
{
if(GetPlayerMoney(playerid) < 1150)
return SendClientMessage(playerid, 0x33FF00AA, "You don't have enough cash to buy this Weapon.");
GivePlayerMoney(playerid, -1150);
GivePlayerWeapon(playerid, 24, 100);
SendClientMessage(playerid, 0x99FF00AA, "You have succesfully buyed your weapon.");
}
case 5:
{
if(GetPlayerMoney(playerid) < 1000)
return SendClientMessage(playerid, 0x33FF00AA, "You don't have enough cash to buy this Weapon.");
GivePlayerMoney(playerid, -1000);
GivePlayerWeapon(playerid, 26, 100);
SendClientMessage(playerid, 0x33FF00AA, "You have succesfully buyed your weapon.");
}
case 6:
{
if(GetPlayerMoney(playerid) < 1000)
return SendClientMessage(playerid, 0x33FF00AA, "You don't have enough cash to buy this Weapon.");
GivePlayerMoney(playerid, -1000);
GivePlayerWeapon(playerid, 28, 100);
SendClientMessage(playerid, 0x33FF00AA, "You have succesfully buyed your weapon.");
}
case 7:
{
if(GetPlayerMoney(playerid) < 500)
return SendClientMessage(playerid, 0x33FF00AA, "You don't have enough cash to buy this Weapon.");
GivePlayerMoney(playerid, -500);
GivePlayerWeapon(playerid, 29, 150);
SendClientMessage(playerid, 0x33FF00AA, "You have succesfully buyed your weapon.");
}
case 8:
{
if(GetPlayerMoney(playerid) < 1000)
return SendClientMessage(playerid, 0x33FF00AA, "You don't have enough cash to buy this Weapon.");
GivePlayerMoney(playerid, -1000);
GivePlayerWeapon(playerid, 34, 10);
SendClientMessage(playerid, 0x33FF00AA, "You have succesfully buyed your weapon.");
}
case 9:
{
if(GetPlayerMoney(playerid) < 2000)
return SendClientMessage(playerid, 0x33FF00AA, "You don't have enough cash to buy this Weapon.");
GivePlayerMoney(playerid, -2000);
GivePlayerWeapon(playerid, 37, 10);
SendClientMessage(playerid, 0x33FF00AA, "You have succesfully buyed your weapon.");
}
case 10:
{
if(GetPlayerMoney(playerid) < 5000)
return SendClientMessage(playerid, 0x33FF00AA, "You don't have enough cash to buy this Weapon.");
GivePlayerMoney(playerid, -5000);
GivePlayerWeapon(playerid, 39, 1);
SendClientMessage(playerid, 0x33FF00AA, "You have succesfully buyed your weapon.");
}
case 11:
{
if(GetPlayerMoney(playerid) < 5000)
return SendClientMessage(playerid, 0x33FF00AA, "You don't have enough cash to buy this Weapon.");
GivePlayerMoney(playerid, -5000);
GivePlayerWeapon(playerid, 42, 50);
SendClientMessage(playerid, 0x33FF00AA, "You have succesfully buyed your weapon.");
}
case 12:
{
if(GetPlayerMoney(playerid) < 50)
return SendClientMessage(playerid, 0x33FF00AA, "You don't have enough cash to buy this Weapon.");
GivePlayerMoney(playerid, -50);
GivePlayerWeapon(playerid, 11, 1);
SendClientMessage(playerid, 0x33FF00AA, "You have succesfully buyed your weapon.");
}
case 13:
{
if(GetPlayerMoney(playerid) < 200)
return SendClientMessage(playerid, 0x33FF00AA, "You don't have enough cash to buy this Weapon.");
GivePlayerMoney(playerid, -200);
GivePlayerWeapon(playerid, 12, 1);
SendClientMessage(playerid, 0x33FF00AA, "You have succesfully buyed your weapon.");
}
case 14:
{
if(GetPlayerMoney(playerid) < 100)
return SendClientMessage(playerid, 0x33FF00AA, "You don't have enough cash to buy this Weapon.");
GivePlayerMoney(playerid, -100);
GivePlayerWeapon(playerid, 46, 1);
SendClientMessage(playerid, 0x33FF00AA, "You have succesfully buyed your weapon.");
}
}
}
return 1;
}