SA-MP Forums Archive
What's wrong with this pawno code? - 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)
+--- Thread: What's wrong with this pawno code? (/showthread.php?tid=403270)



What's wrong with this pawno code? - megamind2067 - 29.12.2012

Код:
if(GetPlayerHealth(playerid) > 100000 ) SetPlayerHealth(playerid,100);
This is the warning I get
Код:
warning 202: number of arguments does not match definition
Can someone fix it for me?


Re: What's wrong with this pawno code? - MichaelDavidson - 29.12.2012

Warning is nothing. Don't take care of it


Re: What's wrong with this pawno code? - zDevon - 29.12.2012

That is not the proper usage of GetPlayerHealth. You must store the value in a float (which is the argument you're missing, hence the warning). If you look at the wiki, https://sampwiki.blast.hk/wiki/GetPlayerHealth, they give you a perfect example of how to use it correctly.


Re: What's wrong with this pawno code? - megamind2067 - 29.12.2012

deleted


Re: What's wrong with this pawno code? - mau.tito - 29.12.2012

pawn Код:
if(GetPlayerHealth(playerid) >= 100000 )
           {
                SetPlayerHealth(playerid,100);
           }



Re: What's wrong with this pawno code? - zDevon - 29.12.2012

Quote:
Originally Posted by mau.tito
Посмотреть сообщение
pawn Код:
if(GetPlayerHealth(playerid) >= 100000 )
           {
                SetPlayerHealth(playerid,100);
           }
His initial method was fine.


Quote:
Originally Posted by megamind2067
Посмотреть сообщение
but it does not work
Quote:
Originally Posted by zDevon
Посмотреть сообщение
That is not the proper usage of GetPlayerHealth. You must store the value in a float (which is the argument you're missing, hence the warning). If you look at the wiki, https://sampwiki.blast.hk/wiki/GetPlayerHealth, they give you a perfect example of how to use it correctly.



Re: What's wrong with this pawno code? - megamind2067 - 29.12.2012

Quote:
Originally Posted by mau.tito
Посмотреть сообщение
pawn Код:
if(GetPlayerHealth(playerid) >= 100000 )
           {
                SetPlayerHealth(playerid,100);
           }

Still the same warning


Re: What's wrong with this pawno code? - megamind2067 - 29.12.2012

Quote:
Originally Posted by zDevon
Посмотреть сообщение
That is not the proper usage of GetPlayerHealth. You must store the value in a float (which is the argument you're missing, hence the warning). If you look at the wiki, https://sampwiki.blast.hk/wiki/GetPlayerHealth, they give you a perfect example of how to use it correctly.
FIXED THANKS


Re : What's wrong with this pawno code? - [HRD]Mar1 - 29.12.2012

pawn Код:
new Float:health;
     GetPlayerHealth(playerid,health);
     if (health > 100000)
     {
       SetPlayerHealth(playerid,100);
     }