SA-MP Forums Archive
Number Of Arguments Does Not Match Defenition - 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: Number Of Arguments Does Not Match Defenition (/showthread.php?tid=245874)



Number Of Arguments Does Not Match Defenition - Jack_Rocker - 02.04.2011

I have this
if ((GetPlayerHealth(i)) <= 25.0)

and It gives me warning
number of arguments does not match defenition


Re: Number Of Arguments Does Not Match Defenition - HyperZ - 02.04.2011

pawn Код:
new Float:health;
GetPlayerHealth(i,health);
if (health < 25.0)
{
    // Bla Bla Bla
}
https://sampwiki.blast.hk/wiki/GetPlayerHealth


Re: Number Of Arguments Does Not Match Defenition - Jack_Rocker - 02.04.2011

Quote:
Originally Posted by Clive
Посмотреть сообщение
pawn Код:
new Float:health;
GetPlayerHealth(i,health);
if (health < 25.0)
{
    // Bla Bla Bla
}
https://sampwiki.blast.hk/wiki/GetPlayerHealth
Now its worse!!

(starting at line 39503) (this is a timer btw)
pawn Код:
public healthcheck()
{
    new animonoroff;
    for(new i;i<MAX_PLAYERS;i++)
    new Float:health;
    GetPlayerHealth(i,health);
    if (health < 25.0)
    {
        OnPlayerCommandText(i,"/crack");
        SendClientMessage(i, COLOR_YELLOW, "You Can Use /kill if you want to die, or use /call 911 for EMS");
        animonoroff = 1;
    }
    else
    {
        if ((animonoroff) == 1)
            {
            ClearAnimations(i);
            }
    }
}
and I get these errors and warnings!


C:\Users\Jack\Desktop\samp\gamemodes\testgm.pwn(39 507) : error 003: declaration of a local variable must appear in a compound block
C:\Users\Jack\Desktop\samp\gamemodes\testgm.pwn(39 507) : warning 221: label name "Float" shadows tag name
C:\Users\Jack\Desktop\samp\gamemodes\testgm.pwn(39 507) : error 017: undefined symbol "health"
C:\Users\Jack\Desktop\samp\gamemodes\testgm.pwn(39 507) : warning 215: expression has no effect
C:\Users\Jack\Desktop\samp\gamemodes\testgm.pwn(39 50 : error 017: undefined symbol "i"
C:\Users\Jack\Desktop\samp\gamemodes\testgm.pwn(39 509) : error 017: undefined symbol "health"
C:\Users\Jack\Desktop\samp\gamemodes\testgm.pwn(39 511) : error 017: undefined symbol "i"
C:\Users\Jack\Desktop\samp\gamemodes\testgm.pwn(39 512) : error 017: undefined symbol "i"
C:\Users\Jack\Desktop\samp\gamemodes\testgm.pwn(39 519) : error 017: undefined symbol "i"
C:\Users\Jack\Desktop\samp\gamemodes\testgm.pwn(39 507) : warning 203: symbol is never used: "Float"


HELP!!


Re: Number Of Arguments Does Not Match Defenition - Jeffry - 02.04.2011

pawn Код:
public healthcheck()
{
    new animonoroff;
    for(new i;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerConnected(i))
        {
            new Float:health;
            GetPlayerHealth(i,health);
            if (health < 25.0)
            {
                OnPlayerCommandText(i,"/crack");
                SendClientMessage(i, COLOR_YELLOW, "You Can Use /kill if you want to die, or use /call 911 for EMS");
                animonoroff = 1;
            }
            else
            {
                if ((animonoroff) == 1)
                {
                    ClearAnimations(i);
                }
            }
        }
    }
}
Have fun.

Jeffry