28.04.2009, 06:17
Hi there, I am looking if anyone can give me any help for a /gate command that would open AND close gates/barriers, I dont want to have to use LSPDBarrier1open/close that is stupid, ive been in servers where you just have to have a hotkey(well i do anyway)of /gate, and the command opens and closes the barriers/gates, I have down the requirements on if the player is connected, IsAcop/admin what not, just need help on how to check for one, to see if the person is like actually near the gate, and two, checking whether or not /gate opens or closes, meaning how do i check to see if the gate is already open or closed when /gate is entered, to choose whether to close or open...hope this isnt confusing..thank you and here is what i have so far:
Код:
if(strcmp(cmd, "/gate", true) == 0) // Command { if(IsACop(playerid) || PlayerInfo[playerid][pAdmin] >= 1) // Checks if the player is in the police { if(ProxDetectorS(11.0, playerid, LSPDBarrier1) && GetObjectPos(LSPDBarrier1,0.000000,89.000000,269.818847)) { SetObjectRot(LSPDBarrier1,0.000000,0.000000,269.818847); // Moves the object SetTimer("LSPDBarrier1Timer", 5000, 0); GameTextForPlayer(playerid, "~w~Access ~g~Granted", 5000, 4); } else if(ProxDetectorS(11.0, playerid, LSPDBarrier1) && GetObjectPos(LSPDBarrier1,0.000000,0.000000,269.818847)) { SetObjectRot(LSPDBarrier1,0.000000,89.000000,269.818847); } else if(strcmp(cmd, "/gate", true) == 0) { if(IsACop(playerid) || PlayerInfo[playerid][pAdmin] >= 1 && ProxDetectorS(11.0, playerid, LSPDGate1)) { MoveObject(LSPDGate1, 1588.265991,-1638.143554,9.534472,1.0); SetTimer("LSPDGate1Timer", 5000, 0); } } else if(strcmp(cmd, "/gate", true) == 0) { if(IsACop(playerid) || PlayerInfo[playerid][pAdmin] >= 1 && ProxDetectorS(11.0, playerid, LSPDGate1)) { MoveObject(LSPDGate1, 1588.265991,-1638.143554,15.014236,0.9);