Hello I have the following code below it is to work as rcon but is there a way to make the gate open by just driving up to it if your logged in as rcon?
Код:
public OnFilterScriptExit()
{
print("\n--------------------------------------");
print(" Admin base by [AF]Zues unloded!");
print("--------------------------------------\n");
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/ho", cmdtext, true, 10) == 0)
{
if(IsPlayerAdmin(playerid) == 1)
{
MoveObject(admingate, -460.0388, 2593.2056, 62.0600, 2.00);
SendClientMessage(playerid, 0xFFFF00AA, "Admin Base gate Opened");
return 1;
}
else
{
return 1;
}
}
if(strcmp("/hc", cmdtext, true, 10) == 0)
{
if(IsPlayerAdmin(playerid) == 1)
{
MoveObject(admingate, -459.97452, 2593.31567, 56.50000, 2.00);
SendClientMessage(playerid, 0xFFFF00AA, "Admin Base gate Closed");
return 1;
}
else
{
return 1;
}
}
if(strcmp("/home", cmdtext, true, 10) == 0)
{
if(IsPlayerAdmin(playerid) == 1)
{
SetPlayerPos(playerid, -524.257690, 2593.366210, 53.415000);
SendClientMessage(playerid, 0xFFFF00AA, "You have been teleported to the admin base");
return 1;
}
else
{
return 1;
}
}
return 0;
}
You have to check how close player is to gates, then check if he is an admin and open the gates.