SA-MP Forums Archive
HELP! - 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: HELP! (/showthread.php?tid=285351)



HELP! - alaripennar - 23.09.2011

I have these errors:
(226) : error 021: symbol already defined: "OnPlayerCommandText"
(396) : error 055: start of function body without function header
(39 : error 010: invalid function or declaration

And this is the script

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{ // Line 226 !! ERROR 1
    if (strcmp("/open", cmdtext, true, 5) == 0) 
    {
        if(IsPlayerInRangeOfPoint(playerid, 25, 1360.0083, -842.9781,45.8299))
           {
        MoveObject(gate1, 1352.1815185547,-844.67443847656, 46.521034240723, 5000);
                SendClientMessage(playerid, 0xEF994300, "The gate has opened.");
        }
        return 1;
    }
        if (strcmp("/close", cmdtext, true, 6) == 0)
    {
        if(IsPlayerInRangeOfPoint(playerid, 25, 1360.0083, -842.9781,45.8299))
        {
                  MoveObject(gate1, 1356.8719482422, -837.70202636719, 46.521034240723, 5000);
              SendClientMessage(playerid, 0xEF994300, "The gate has closed.");
                }//closing bracket
        return 1;
    }
    return 0;
}
The other 2 errors

Код:
{   // 2nd error
    gate1 = CreateObject(969, 1356.8719482422, -837.70202636719, 46.521034240723, 0, 0, 246, 5) //Creating the object
    return 1; //3rd error
}



Re: HELP! - iJumbo - 23.09.2011

Welcome to samp forum

have you check if you have another OnPlayerCommandText in your script?


Re: HELP! - alaripennar - 23.09.2011

Thanks !

Yes i do have, but when i remove this one, it gives me alot of different errors


Re: HELP! - iJumbo - 23.09.2011

so this code must be in the normal onplayercommandtext not this ...


Re: HELP! - alaripennar - 23.09.2011

Can u take a look at this ?