25.09.2009, 20:30
Код:
new gate;//this will be used later to be defined to the gate's id public OnGameModeInit() { gate = CreateObject(980, 1281.016357, -2055.733398, 60.624096, 0.0000, 0.0000, 268.0402);//defines and creates the gate return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/open", cmdtext, true, 5) == 0) { MoveObject(gate,1281.014893, -2055.825928, 54.935707,2.0);//Moves it away to open it SendClientMessage(playerid,0xFFFFFF,"Gate has been opened"); return 1; } if (strcmp("/close",cmdtext,true,6) == 0) { MoveObject(gate,1281.016357, -2055.733398, 60.624096,2.0);//Moves it to its original possition SendClientMessage(playerid,0xFFFFFF,"Gate has been closed"); return 1; } return 0; }