Moving gate error
#1

So my command was working perfectly, But i wanted to add it so only group 9 could use the command, Because it was for that groups faction, I'm only a beginner scripter, And i couldn't really find anything that'd help me, so I attempted it on my own.
Heres the code i made
Код:
#define FILTERSCRIPT

#include <a_samp>
#include <zcmd>

#if defined FILTERSCRIPT

#define ORANGE 	0xF97804FF

#endif

new Gate,
    bool:Open;
    
public OnFilterScriptInit()
{
    Gate = CreateObject(989,1428.6284, 241.9930, 20.3020,359.2969, 0.7000, 172.9962, 0.0);
    return 1;
}

CMD:gate(playerid,params[])
{
    if(IsPlayerInRangeOfPoint(playerid,10,1428.6456, 242.0033, 20.3020)) && (Player[playerid][group] == 9)
    {
        switch(Open)//Check whether the gate opened or closed
        {
            case true://If the gate opened
            {
                MoveObject(Gate,1428.6456, 242.0033, 20.3020,4);//Close the gate
                Open = false;//false for closed
            }
            case false://If the gate closed
            {
                MoveObject(Gate,1426.5259, 237.4716, 20.3020,4);//Open the gate
                Open = true;//true for opened
            }
        }
        return 1;
    }
    SendClientMessage(playerid,ORANGE,"You're not close enough to the gate.");//Send error message if player isn't near any gate
    return 1;
}
It worked perfectly until i added this into it
Код:
&& (Player[playerid][group] == 9)
My errors are
Код:
C:\Users\Josh\Desktop\FCSLRP\filterscripts\MovingGates.pwn(23) : error 029: invalid expression, assumed zero
C:\Users\Josh\Desktop\FCSLRP\filterscripts\MovingGates.pwn(23) : error 017: undefined symbol "Player"
C:\Users\Josh\Desktop\FCSLRP\filterscripts\MovingGates.pwn(23) : error 029: invalid expression, assumed zero
C:\Users\Josh\Desktop\FCSLRP\filterscripts\MovingGates.pwn(23) : fatal error 107: too many error messages on one line

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


4 Errors.
if someone could fix the code for me, that'd be great.
Usually if i want a command to only be usable by one group, it'd be something like this.
Код:
	    if(Groups[Player[playerid][Group]][CommandTypes] == 1 || Groups[Player[playerid][Group]][CommandTypes] == 4)
Thats for a cuff command, Command types 1 and 4 are the leo command ranks.
Thanks in advance if somone could help, Will be repping.
Reply


Messages In This Thread
Moving gate error - by Joshswag - 11.11.2012, 03:19
Re: Moving gate error - by Joshswag - 11.11.2012, 03:22
Re: Moving gate error - by -=Dar[K]Lord=- - 11.11.2012, 03:24
Re: Moving gate error - by Lordzy - 11.11.2012, 03:28
Re: Moving gate error - by -=Dar[K]Lord=- - 11.11.2012, 03:30
Re: Moving gate error - by UnknownGamer - 11.11.2012, 03:43
Re: Moving gate error - by Glad2BeHere - 11.11.2012, 05:03
Re: Moving gate error - by Joshswag - 11.11.2012, 05:27
Re: Moving gate error - by Camorra - 11.11.2012, 05:55
Re: Moving gate error - by Joshswag - 11.11.2012, 06:16

Forum Jump:


Users browsing this thread: 3 Guest(s)