11.08.2010, 02:53
(
Последний раз редактировалось Nathan_Taylor; 11.08.2010 в 03:13.
Причина: Wrong Coordinates
)
First define the new gates
Then, to spawn the gates, use the following two lines
This can go in the OnGamemodeInit or OnFilterscriptInit.
After this, comes the command.
And the Close Command
I am not sure how to make it only open if you are a cop. You could do it if you are only admin tho. I am sure there is a way of doing it if you are only a cop, but I do not know how. This will at least let you open and close the gates. (If you want the gates to go sideways or down, just change the coordinates in the MoveObjects)
----------------------------------------------------------------------------------------
----------------------------Not sure if anything below this will work----------------------
----------------------------------------------------------------------------------------
You can try setting up a new variable like so
Put that in the top of your file. It is the list of cops's skin ids then change the commands to...
Open
Close
Again, I am not sure if this will work!
Код:
//on top new Gate1; new Gate2;
Код:
Gate1 = CreateObject(988,1781.16040039,-1534.00585938,8.56611252,0.00000000,0.00000000,87.33950806); //(ws_apgate) Yard 1 close Gate2 = CreateObject(988,1781.18664551,-1533.96008301,11.65782928,0.00000000,0.00000000,87.33950806); //(ws_apgate) Yard 1 Open
After this, comes the command.
Код:
if (strcmp("/prisongateopen", cmdtext, true) == 0) { MoveObject(Gate1, 11781.16040039, -1534.00585938, 14.56611252, 1.4); //raise gate1 MoveObject(Gate2, 11781.18664551, -1533.96008301, 17.65782928, 1.4); //raise gate2 } return 1; }
Код:
if (strcmp("/prisongateclose", cmdtext, true) == 0) { MoveObject(Gate1, 11781.16040039, -1534.00585938, 8.56611252, 1.4); //lower gate1 MoveObject(Gate2, 11781.18664551, -1533.96008301, 11.65782928, 1.4); //lower gate2 } return 1; }
----------------------------------------------------------------------------------------
----------------------------Not sure if anything below this will work----------------------
----------------------------------------------------------------------------------------
You can try setting up a new variable like so
Код:
new CopId[][] = { "280", "281", "282", "283", "284", "285", "286", "287", "288" };
Open
Код:
if (strcmp("/prisongateopen", cmdtext, true) == 0) { new skinid; skinid = GetPlayerSkin(playerid); if(skinid = CopId){ MoveObject(Gate1, 11781.16040039, -1534.00585938, 14.56611252, 1.4); //raise gate1 MoveObject(Gate2, 11781.18664551, -1533.96008301, 17.65782928, 1.4); //raise gate2 } else { return sendClientMessage(playerid,0x24FF0AB9,"You must be a cop to open these doors"); } return 1; }
Код:
if (strcmp("/prisongateclose", cmdtext, true) == 0) { new skinid; skinid = GetPlayerSkin(playerid); if(skinid = CopId){ MoveObject(Gate1, 11781.16040039, -1534.00585938, 8.56611252, 1.4); //lower gate1 MoveObject(Gate2, 11781.18664551, -1533.96008301, 11.65782928, 1.4); //lower gate2 } else { return SendClientMessage(playerid,0x24FF0AB9,"You must be a cop to close these doors"); } return 1; }