Invalid Function or call
#1

Hi, I have a problem with this code
pawn Код:
CMD:kill(playerid, params[])
{
    if(Suicide(playerid) == 0) // Check if the player has comitted suicide recently
    {
        SetPlayerHealth(playerid, 0);
        SendClientMessage(playerid, RED, "You committed suicide! Please don't abuse it or else you'll get kicked.");
        SetTimer(playerid, "SuicideTimer", 20000, false);
        Suicide(playerid) = 1;
    }
    else
    {
        SendClientMessage(playerid, RED, "You have to wait before committing suicide again.");
    }
    return 1;
it gives me these errors

Код:
C:\Users\Cretu\Desktop\Fri's TDM\gamemodes\fritdm.pwn(362) : error 012: invalid function call, not a valid address
C:\Users\Cretu\Desktop\Fri's TDM\gamemodes\fritdm.pwn(362) : warning 215: expression has no effect
C:\Users\Cretu\Desktop\Fri's TDM\gamemodes\fritdm.pwn(362) : error 001: expected token: ";", but found ")"
C:\Users\Cretu\Desktop\Fri's TDM\gamemodes\fritdm.pwn(362) : error 029: invalid expression, assumed zero
C:\Users\Cretu\Desktop\Fri's TDM\gamemodes\fritdm.pwn(362) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
The 362nd line:
Код:
if(Suicide(playerid) == 0) // Check if the player has comitted suicide recently
I've already defined Suicide(playerid) with new Suicide[MAX_PLAYERS];

Please help me, what is the problem?
Reply
#2

Change Suicide(playerid) to Suicide[playerid].
Reply
#3

It should be:
pawn Код:
Suicide[playerid]
instead of using parentheses.
Reply
#4

Oh, thank you guys, +repped both of you. I really didn't knew...I'm a noob. :3
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)