Need help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need help (
/showthread.php?tid=149991)
Need help -
ViruZZzZ_ChiLLL - 24.05.2010
I don't get it why is says the error that he already has 5 Coins
"The SendClientMessage error"
pawn Код:
if(coin[playerid] < 5) return SendClientMessage(playerid, Red, "ERROR : You can only have 5 coins!");
coin[playerid] += 1;
Re: Need help -
ViruZZzZ_ChiLLL - 24.05.2010
Quote:
Originally Posted by Seif_
Elaborate more.
|
Well, basically, it sends me the error message even though I buy one coin
when it must send me that, when I already have 5 coins.
/buycoins
Re: Need help -
AK47KILLA - 24.05.2010
You'd have to have the code like this then, correct?
pawn Код:
if(coin[playerid] == 5) return SendClientMessage(playerid, Red, "ERROR : You can only have 5 coins!");
coin[playerid] += 1;
Re: Need help -
Hiddos - 24.05.2010
It now checks if the player has less then 5 coins and, if so, returns that he already has 5 coins.
Re: Need help -
ViruZZzZ_ChiLLL - 24.05.2010
Quote:
Originally Posted by AK47KILLA
You'd have to have the code like this then, correct?
pawn Код:
if(coin[playerid] == 5) return SendClientMessage(playerid, Red, "ERROR : You can only have 5 coins!"); coin[playerid] += 1;
|
Well, that won't send me the error, it will infinitely give me coins when I /buycoins
Re: Need help -
Fj0rtizFredde - 24.05.2010
Your code check's if the player has less then 5 coins :P
make it like:
pawn Код:
if(coin[playerid] > 5) return SendClientMessage(playerid, Red, "ERROR : You can only have 5 coins!");
coin[playerid] += 1;
Re: Need help -
ViruZZzZ_ChiLLL - 24.05.2010
Quote:
Originally Posted by Fj0rtizFredde
Your code check's if the player has less then 5 coins :P
make it like:
pawn Код:
if(coin[playerid] > 5) return SendClientMessage(playerid, Red, "ERROR : You can only have 5 coins!"); coin[playerid] += 1;
|
It still lets me use /buycoins even though I already have 5
![Sad](images/smilies/sad.gif)
OMG, this is really confusing
Re: Need help -
Hiddos - 24.05.2010
Quote:
Originally Posted by ViruZZzZ_ChiLLL
Quote:
Originally Posted by Fj0rtizFredde
Your code check's if the player has less then 5 coins :P
make it like:
pawn Код:
if(coin[playerid] > 5) return SendClientMessage(playerid, Red, "ERROR : You can only have 5 coins!"); coin[playerid] += 1;
|
It still lets me use /buycoins even though I already have 5 ![Sad](images/smilies/sad.gif)
OMG, this is really confusing ![undecided](images/smilies/neutral.gif)
|
That is checking if he has more then 5 coins, so 6 would apply.
pawn Код:
if(coin[playerid] >= 5) return SendClientMessage(playerid, Red, "ERROR : You can only have 5 coins!");
coin[playerid] += 1;
Re: Need help -
ViruZZzZ_ChiLLL - 24.05.2010
Quote:
Originally Posted by Hiddos
Quote:
Originally Posted by ViruZZzZ_ChiLLL
Quote:
Originally Posted by Fj0rtizFredde
Your code check's if the player has less then 5 coins :P
make it like:
pawn Код:
if(coin[playerid] > 5) return SendClientMessage(playerid, Red, "ERROR : You can only have 5 coins!"); coin[playerid] += 1;
|
It still lets me use /buycoins even though I already have 5 ![Sad](images/smilies/sad.gif)
OMG, this is really confusing ![undecided](images/smilies/neutral.gif)
|
That is checking if he has more then 5 coins, so 6 would apply.
pawn Код:
if(coin[playerid] >= 5) return SendClientMessage(playerid, Red, "ERROR : You can only have 5 coins!"); coin[playerid] += 1;
|
Still... I can /buycoins even though I already have 100000 of them
Re: Need help -
aircombat - 24.05.2010
Код:
if(coin[playerid] > 4) return SendClientMessage(playerid, Red, "ERROR : You can only have 5 coins!");