CMD:cgate(playerid, params[])
{
if(PInfo[playerid][pCop] >= 3) {
MoveObject(ogate,1592.7605, -1638.0819, 14.9281,3.0);
SendClientMessage(playerid, -1, "You've CLOSED the PD garage gate, /ogate to open it.");
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You've to be an Police Officer I to use this.");
}
return 1;
}
CMD:ogate(playerid, params[])
{
if(PInfo[playerid][pCop] >= 3) {
MoveObject(ogate, 1592.7605, -1638.0819, 9.8567,3.0);
SendClientMessage(playerid, -1, "You've OPENED the PD garage gate, /cgate to close it.");
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You've to be an Police Officer I to use this.");
}
return 1;
}
CMD:bclose(playerid, params[])
{
if(PInfo[playerid][pCop] >= 3) {
MoveObject(ogate2,1544.6466, -1626.7156, 13.9754,3.0);
SendClientMessage(playerid, -1, "You've CLOSED the LSPD main Gate, type /bopen to open it again.");
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You've to be an Police Officer I to use this.");
}
return 1;
}
CMD:bopen(playerid, params[])
{
if(PInfo[playerid][pCop] >= 3) {
MoveObject(ogate2, 1544.7471, -1619.6561, 13.9754,3.0);
SendClientMessage(playerid, -1, "You've OPENED the LSPD main Gate, /bclose to close it");
}
else
{
SendClientMessage(playerid, COLOR_GREY, "You've to be an Police Officer I to use this.");
}
return 1;
}
|
You have to use this, because if not when you execute the command will open the two together.
https://sampwiki.blast.hk/wiki/IsPlayerInRangeOfPoint |