#1

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

Welcome to samp forum

have you check if you have another OnPlayerCommandText in your script?
Reply
#3

Thanks !

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

so this code must be in the normal onplayercommandtext not this ...
Reply
#5

Can u take a look at this ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)