Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //This example has been made by BigETIĀ©
- //News
- new mygateid, bool:gatestate = false;
- //Publics
- public OnGameModeInit()
- {
- //...Your Stuff
- mygate = CreateObject(...); //The variable 'mygate' returns now the Object ID we want.
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- //...Your Stuff
- if(!strcmp("/tgate", cmdtext, true))
- {
- switch(gate)
- {
- case false:
- {
- gatestate = true; //Setting it to true, because we are opening the gate
- //Example: MoveObject(objectid, Float:X, Float:Y, Float:Z, Float:Speed)
- //objectid stays for the Object ID which returns your gate (not Model ID!)
- //Float:X stays for the future X coordinate of your gate.
- //Float:Y stays for the future Y coordinate of your gate.
- //Float:Z stays for the future Z coordinate of your gate.
- //Float:Speed stays for the speed of your gate (amount/sec)
- MoveObject(mygateid, 791.44879150391, -2304.7546386719, 26.623531341553, 2.0);
- SendClientMessage(playerid, 0x3333FF, "You have opened the gate.");
- }
- case true:
- {
- gatestate = false; //Setting it to false because we are closing the gate now.
- //Example: MoveObject(objectid, Float:X, Float:Y, Float:Z, Float:Speed)
- //objectid stays for the Object ID which returns your gate (not Model ID!)
- //Float:X stays now for the old X coordinate of your gate.
- //Float:Y stays now for the old Y coordinate of your gate.
- //Float:Z stays now for the old Z coordinate of your gate.
- //Float:Speed stays for the speed of your gate (amount/sec)
- MoveObject(mygateid, 787.18463134766, -2295.435546875, 26.623531341553, 2.0);+
- SendClientMessage(playerid, 0x3333FF, "You have closed the gate.");
- }
- }
- return 1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment