08.12.2014, 16:37
Hello, I have command Called /door, which moves the LSPD doors inside the Lobby, I wanted to ask if you guys can help me change the /door to a KEY.. for example, instead of writing /door, pressing F and the door will open..
Here's the /door Command:
Here's the /door Command:
Код:
CMD:door(playerid, params[]) { if(IsPlayerConnected(playerid)) { new string[ 128 ]; if(PlayerInfo[playerid][pFaction] == 1) { if(IsPlayerInRangeOfPoint(playerid, 3, 246.3489,72.0905,1003.6406)) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); if(IsLSPDDoorOpen == 0) { MoveDynamicObject(lspddoor1, 248.35150146484, 72.547714233398, 1002.640625, 1.50); MoveDynamicObject(lspddoor2, 243.03300476074, 72.547714233398, 1002.640625, 1.50); ApplyAnimation(playerid, "HEIST9", "Use_SwipeCard", 10.0, 0, 0, 0, 0, 0); format(string, sizeof(string), "* %s slides their card and opens the door", name); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); IsLSPDDoorOpen = 1; } else { IsLSPDDoorOpen = 0; MoveDynamicObject(lspddoor1, 246.35150146484, 72.547714233398, 1002.640625, 1.50); MoveDynamicObject(lspddoor2, 245.03300476074, 72.568511962891, 1002.640625, 1.50); ApplyAnimation(playerid, "HEIST9", "Use_SwipeCard", 10.0, 0, 0, 0, 0, 0); format(string, sizeof(string), "* %s slides their card and closes the door", name); ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); IsLSPDDoorOpen = 0; } } } } return 1; }