17.07.2012, 18:59
Here is an example:
Код:
new pdgate1; //Moving Object public GateClose(playerid) { MoveDynamicObject(pdgate1,1589.053344,-1638.123168,14.122960, 0.97); PlayerPlaySound(playerid, 1153, 1589.053344,-1638.123168,14.122960); lspdg = 0; return 1; } //Object pdgate1 = CreateDynamicObject(971,1589.053344,-1638.123168,14.122960,0.000000,0.000000,180); //Command if(!strcmp(cmdtext, "/go", true)) // By CuervO_NegrO { if(IsAPDMember(playerid) || IsAFreecop(playerid)) { if (IsPlayerInRangeOfPoint(playerid, 15,1589.053344,-1638.123168,14.122960)) { if(lspdg == 1) { SendClientMessage(playerid, COLOR_GREY, "** Gate is Already Opened"); return 1; } MoveDynamicObject(pdgate1,1599.053344,-1638.123168,14.122960, 0.8); SetTimer("GateClose", 12000, 0); //SendClientMessage(playerid, COLOR_BLUE,"A garage is opened and will close in 7 seconds."); format(string, sizeof(string), "* %s takes his/her remote and opens a garage.", sendername); ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5); PlayerPlaySound(playerid, 1153, 1589.053344,-1638.123168,14.122960); lspdg = 1; } else if ( PRESSED(KEY_SUBMISSION) && PRESSED(KEY_ACTION) ) { if(IsAPDMember(playerid) || IsAFreecop(playerid)) { if (IsPlayerInRangeOfPoint(playerid, 15,1589.053344,-1638.123168,14.122960)) { if(lspdg == 1) { SendClientMessage(playerid, COLOR_GREY, "** Gate is Already Opened"); return 1; } MoveDynamicObject(pdgate1,1599.053344,-1638.123168,14.122960, 0.8); SetTimer("GateClose", 12000, 0); SendClientMessage(playerid, COLOR_BLUE,"A garage is opened and will close in 7 seconds."); GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "* %s takes his/her remote and opens a garage.", sendername); ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5); PlayerPlaySound(playerid, 1153, 1589.053344,-1638.123168,14.122960); lspdg = 1; }