11.11.2012, 03:19
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
It worked perfectly until i added this into it
My errors are
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.
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.
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;
}
Код:
&& (Player[playerid][group] == 9)
Код:
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.
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)
Thanks in advance if somone could help, Will be repping.


