[HELP] dialog
#8

------------- UPDATE

pawn Код:
GivePlayerMoney(myId, amount);
                 if(GetPlayerMoney(playerid) < amount) return SendClientMessage(playerid, RED, "You do not have enough money");
                 GivePlayerMoney(playerid, -amount);
Hmm, these lines are wrong, because it will:
1. Give player money (amount you wrote)
2. Check if you have money you have given the player
3. If yes then it decerases your money
4. If no, then it doesnt decerase your money, sends you 'You dont have enough money' msg, but still gives 'myId' the money..

Do it this way:
pawn Код:
if(GetPlayerMoney(playerid) < amount)
{
SendClientMessage(playerid, 0xFF0000FF, "You do not have enough money");
return 1;
}
else
{
GivePlayerMoney(myId, amount);
GivePlayerMoney(playerid, -amount);
}
Should work..

Greetz,
LetsOWN
Reply


Messages In This Thread
[HELP] dialog - by NvidiaForTheWin - 18.12.2012, 18:27
Re: [HELP] dialog - by LetsOWN[PL] - 18.12.2012, 18:39
Re : [HELP] dialog - by NvidiaForTheWin - 18.12.2012, 18:50
Re: [HELP] dialog - by LetsOWN[PL] - 18.12.2012, 18:52
Re : [HELP] dialog - by NvidiaForTheWin - 18.12.2012, 19:03
Re: [HELP] dialog - by LetsOWN[PL] - 18.12.2012, 19:04
Re : [HELP] dialog - by NvidiaForTheWin - 18.12.2012, 19:16
Re: [HELP] dialog - by LetsOWN[PL] - 18.12.2012, 19:19
Re : Re: [HELP] dialog - by NvidiaForTheWin - 18.12.2012, 19:24
Re: [HELP] dialog - by LetsOWN[PL] - 18.12.2012, 19:27

Forum Jump:


Users browsing this thread: 1 Guest(s)