03.09.2012, 19:16
Add this on top of your script
then on your "OnPlayerCommandText"
Код:
new impaund_Open; // it checks if gates is open
Код:
if (strcmp("/open", cmdtext, true, 10) == 0) { if(impaund_Open == 1) return SendClientMessage(playerid ,SOME COLOR ,"Gate is already open!"); if(IsPlayerInRangeOfPoint(playerid, 15.0, 1620.66, -1862.22, 15.33) ) { // NEW = position of gates when they are open MoveObject(impaund, NEW X postion, NEW Y postion, NEW Z postion, 3.0); impaund_Open = 1; } else return SendClientMessage(playerid ,SOME COLOR ,"You are not near that gate!"); return 1; } else if (strcmp("/close", cmdtext, true, 10) == 0) { if(impaund_Open == 0) return SendClientMessage(playerid ,SOME COLOR ,"Gate is already closed!"); if(IsPlayerInRangeOfPoint(playerid, 15.0, 1620.66, -1862.22, 15.33) ) { MoveObject(impaund, 1620.66, -1862.22, 15.33, 3.0); impaund_Open = 0; } else return SendClientMessage(playerid ,SOME COLOR ,"You are not near that gate!"); return 1; }