31.03.2012, 19:18
When I go into the gas station in Los Santos next to Well Stacked Pizza and LS Airport, I want to get a snack. But each time I want to buy, it says I don't have enough money when I have more than enough.
Here's my code:
Ignore the "HasSnacks" as that doesn't come up. It says it's $500 but I have $15000. How come it still says "You do not have enough money to buy a snack."?
Here's my code:
Код:
if(listitem == 1)
{
if(pcash < 500)
{
SendClientMessage(playerid, COLOR_ERROR, "You do not have enough money to buy a snack.");
return 1;
}
SetPVarInt(playerid, "HasSnacks", GetPVarInt(playerid, "HasSnacks") +1);
GivePlayerMoney(playerid, -500);
SendClientMessage(playerid, COLOR_BLUE, "[ITEM BOUGHT] Snack: $500.");
SendClientMessage(playerid, COLOR_BLUE, "This item will restore your health by 10 by using /snack");
return 1;
}

