if(strcmp(cmdtext,"/ap") == 0)
{
if(PlayerTeam[playerid] == Team_Fire || PlayerTeam[playerid] == Team_LVPD || PlayerTeam[playerid] == Team_EMS)
{
MoveObject(AirportGate,2114.857421875,2841.505859375,12.5,10);
}
return 1;
}
if(strcmp(cmdtext,"/fd") == 0)
{
if(PlayerTeam[playerid] == Team_Fire)
{
SendClientMessage(playerid,COLOR_YELLOW,"[INFO]: Fire Dept Gate Opening!");
MoveObject(FireGate,2526.25,683.5712890625,11.495002746582,10);
}
return 1;
}
#define COLOR_YELLOW 0x33AA33AA
new AirportGate;
new FireGate;
forward Resetbase();
public OnPlayerCommandText(playerid, cmdtext[])
{
//AirportGate
if (strcmp("/ap", cmdtext, true) == 0)
{
if(PlayerTeam[playerid] == Team_Fire || PlayerTeam[playerid] == Team_LVPD || PlayerTeam[playerid] == Team_EMS)
{
MoveObject(AirportGate, 2114.857421875,2841.505859375,12.5,10); //Coordinates when it should be open
SetTimer("Resetbase",5000,0); //you can change the time, it closes after 5 seconds now.
return 1;
}
}
//FireGate
if (strcmp("/fd", cmdtext, true) == 0)
{
if(PlayerTeam[playerid] == Team_Fire)
{
SendClientMessage(playerid,COLOR_YELLOW,"[INFO]: Fire Dept Gate Opening!");
MoveObject(FireGate,2526.25,683.5712890625,11.495002746582,10) //Coordinates when it should be open
SetTimer("Resetbase",5000,0); //you can change the time, it closes after 5 seconds now.
return 1;
}
}
return 0;
}
public Resetbase()
{
MoveObject(AirportGate, 958.1621,2103.1962,1011.2694, 2.00); //Coordinates when it should be locked
MoveObject(FireGate, 960.1875,2090.7861,9.7842, 2.00); //Coordinates when it should be locked
}
Fixed it.
AirportGate = CreateDynamicObject. Public GateClose() had MoveObject Not MoveDynamicObject |