Error 010: invalid function or declaration
#1

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

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;
}
Reply
#3

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;
    }
Reply
#4

Thanks alot!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)