20.09.2014, 02:20
Hey, I can't remember how I did this properly last time, but basically I've created a little gun store dialog so when a player types /gunshop it opens a dialog and they can select either legal or illegal weapons. When the player goes to buy a gun (clicks on the gun), I would like it to get the players money and if they don't have enough for the gun... send the player a message saying "You don't have enough money" etc. I wasn't sure where to put the if(GetPlayerMoney(playerid)) so if you do have enough money, it continues to give you the weapon an take your money. Sorry if I explained this shitty, haven't had much sleep haha.
Here's the dialog:
Here's the dialog:
Код:
if(dialogid == 126) { if(response) { if(listitem == 0) { GivePlayerWeapon(playerid, 24, 9999999); GivePlayerMoney(playerid, -15000); } if(listitem == 1) { GivePlayerWeapon(playerid, 29, 9999999); GivePlayerMoney(playerid, -3000); return 1; } if(listitem == 2) { GivePlayerWeapon(playerid, 25, 9999999); GivePlayerMoney(playerid, -1500); return 1; } if(listitem == 3) { GivePlayerWeapon(playerid, 22, 9999999); GivePlayerMoney(playerid, -750); return 1; } if(listitem == 4) { GivePlayerWeapon(playerid, 23, 9999999); GivePlayerMoney(playerid, -1000); return 1; } if(listitem == 5) { GivePlayerWeapon(playerid, 28, 9999999); GivePlayerMoney(playerid, -25000); return 1; } if(listitem == 6) { GivePlayerWeapon(playerid, 32, 9999999); GivePlayerMoney(playerid, -25000); return 1; } if(listitem == 7) { GivePlayerWeapon(playerid, 33, 9999999); GivePlayerMoney(playerid, -75000); return 1; } if(listitem == 8) { GivePlayerWeapon(playerid, 4, 9999999); GivePlayerMoney(playerid, -1000000); return 1; } } }