SA-MP Forums Archive
Error 010: invalid function or declaration - 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: Error 010: invalid function or declaration (/showthread.php?tid=449957)



Error 010: invalid function or declaration - Leo_Black - 10.07.2013

Quote:

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/gotospawn", cmdtext, true, 10) == 0)
{
SetPlayerPos(playerid, 1758.0182,-1894.4288,13.5561);
SendClientMessage(playerid, 0x00C0FF, "Uspijeљno si se portao do spawna!");
}
return 1;
}

if (strcmp(cmdtext, "/suicide", true) == 0)
{
SetPlayerHealth(playerid,0.0);
SendClientMessage(playerid, COLOR_BASIC, "You committed suicide!");
return 1;
{

Im a newb please tell me what did i do wrong here? I just putted the /suicide command and it shows me error.


Re: Error 010: invalid function or declaration - Sandiel - 10.07.2013

Post the errors next time.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/gotospawn", cmdtext, true, 10) == 0)
    {
        SetPlayerPos(playerid, 1758.0182,-1894.4288,13.5561);
        SendClientMessage(playerid, 0x00C0FF, "Uspiješno si se portao do spawna!");
        return 1;
    }
    if(strcmp(cmdtext, "/suicide", true) ==0)
    {
        SetPlayerHealth(playerid,0.0);
        SendClientMessage(playerid, COLOR_BASIC, "You committed suicide!");
        return 1;
    }
    return 0;
}



Re : Error 010: invalid function or declaration - morocco - 10.07.2013

pawn Код:
if (strcmp("/gotospawn", cmdtext, true, 10) == 0)
    {
        SetPlayerPos(playerid, 1758.0182,-1894.4288,13.5561);
        SendClientMessage(playerid, 0x00C0FF, "Uspiješno si se portao do spawna!");
        return 1;
    }

    if (strcmp(cmdtext, "/suicide", true) == 0)
    {
        SetPlayerHealth(playerid,0.0);
        SendClientMessage(playerid, COLOR_BASIC, "You committed suicide!");
        return 1;
    }



Re: Error 010: invalid function or declaration - Leo_Black - 10.07.2013

Thanks alot!