11.09.2010, 12:23
(
Последний раз редактировалось Mean; 11.09.2010 в 13:01.
)
When i don't have enough money to buy an item, i dont get a message, "Not enough money" or anything and when i have money then the message appears lawl, this is code I used:
pawn Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 1)
{
if(response)
{
if(listitem == 0)
{
if(GetPlayerMoney(playerid) <= 0) return 0;
SendClientMessage(playerid, COLOR_BRIGHTRED, "Not enough money to buy this weapon");
if(GetPlayerMoney(playerid) <= 2000) return 0;
GivePlayerWeapon(playerid,22, 500);
TogglePlayerControllable(playerid,1);
GivePlayerMoney(playerid,-2000);
}
if(listitem == 1)
{
if(GetPlayerMoney(playerid) <= 0) return 0;
SendClientMessage(playerid, COLOR_BRIGHTRED, "Not enough money to buy this weapon");
if(GetPlayerMoney(playerid) <= 2000) return 0;
GivePlayerWeapon(playerid,23, 500);
TogglePlayerControllable(playerid,1);
GivePlayerMoney(playerid,-2000);
}
if(listitem == 2)
{
if(GetPlayerMoney(playerid) <= 0) return 0;
SendClientMessage(playerid, COLOR_BRIGHTRED, "Not enough money to buy this weapon");
if(GetPlayerMoney(playerid) <= 2000) return 0;
GivePlayerWeapon(playerid,32, 500);
TogglePlayerControllable(playerid,1);
GivePlayerMoney(playerid,-2000);
}
if(listitem == 3)
{
if(GetPlayerMoney(playerid) <= 0) return 0;
SendClientMessage(playerid, COLOR_BRIGHTRED, "Not enough money to buy this weapon");
if(GetPlayerMoney(playerid) <= 2000) return 0;
GivePlayerWeapon(playerid,25, 500);
TogglePlayerControllable(playerid,1);
GivePlayerMoney(playerid,-2000);
}
if(listitem == 4)
{
if(GetPlayerMoney(playerid) <= 0) return 0;
SendClientMessage(playerid, COLOR_BRIGHTRED, "Not enough money to buy this weapon");
if(GetPlayerMoney(playerid) <= 2000) return 0;
GivePlayerWeapon(playerid,28, 500);
TogglePlayerControllable(playerid,1);
GivePlayerMoney(playerid,-2000);
}
if(listitem == 5)
{
if(GetPlayerMoney(playerid) <= 0) return 0;
SendClientMessage(playerid, COLOR_BRIGHTRED, "Not enough money to buy this weapon");
if(GetPlayerMoney(playerid) <= 2000) return 0;
GivePlayerWeapon(playerid,29, 500);
TogglePlayerControllable(playerid,1);
GivePlayerMoney(playerid,-2000);
}
if(listitem == 6)
{
if(GetPlayerMoney(playerid) <= 0) return 0;
SendClientMessage(playerid, COLOR_BRIGHTRED, "Not enough money to buy this weapon");
if(GetPlayerMoney(playerid) <= 2000) return 0;
GivePlayerWeapon(playerid,30, 500);
TogglePlayerControllable(playerid,1);
GivePlayerMoney(playerid,-2000);
}
if(listitem == 7)
{
if(GetPlayerMoney(playerid) <= 0) return 0;
SendClientMessage(playerid, COLOR_BRIGHTRED, "Not enough money to buy this weapon");
if(GetPlayerMoney(playerid) <= 2000) return 0;
GivePlayerWeapon(playerid,31, 500);
TogglePlayerControllable(playerid,1);
GivePlayerMoney(playerid,-2000);
}
if(listitem == 8)
{
if(GetPlayerMoney(playerid) <= 0) return 0;
SendClientMessage(playerid, COLOR_BRIGHTRED, "Not enough money to buy this weapon");
if(GetPlayerMoney(playerid) <= 2000) return 0;
GivePlayerWeapon(playerid,34, 500);
TogglePlayerControllable(playerid,1);
GivePlayerMoney(playerid,-2000);
}
}
}
}