What's wrong with this pawno code?
#1

Код:
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?
Reply
#2

Warning is nothing. Don't take care of it
Reply
#3

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.
Reply
#4

deleted
Reply
#5

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

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.
Reply
#7

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

Still the same warning
Reply
#8

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
Reply
#9

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


Forum Jump:


Users browsing this thread: 2 Guest(s)