Right, here's a a command that ACTUALLY might help you, I know you wanted it so it's like /gate opens and closes, but maybe this will help you more. as you can have
/gate open
/gate close
/gate lock
Or things like that? idk.
pawn Код:
if(strcmp(cmd,"/gate",true) == 0) // Command, obviously.
{
if(IsPlayerConnected(playerid)) // This basically makes sure the person is connected (So they can't use commands if they ain' spawned)
{
if(IsARebel(playerid)) // This is a faction I have in my server.
{
new x_job[128]; // This is what they say after /rgate
x_job = strtok(cmdtext, idx);
if(!strlen(x_job))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /rgate [OPEN/CLOSE]"); // Say they type /rgate. and no input, it says that.
return 1;
}
if(strcmp(x_job,"open",true) == 0) // /rgate open
{
SetObjectPos(bar1, X,Y,Z); // You need to define what "bar1" is.
SetObjectRot(bar1,X,Y,Z); // XYZ = The rotation and stuff like that (You can get it from the .map file)
return 1;
}
else if(strcmp(x_job,"close",true) == 0) // This is if they type /rgate close
{
SetObjectPos(bar1,X,Y,Z); // Same as last time.
SetObjectRot(bar1,X,Y,Z);
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_BRIGHTRED, "Sorry, you are not a rebel so you can gtfo"); // This is basicalyl if they arn't in the Rebel faction (Which is defined in the script)
}
}
return 1;
}
Hope it helps a bit, if you want a example of it - PM me.