28.05.2009, 17:22
It locks but I can't unlock it. When you do /yaklock, it locks correctly but when I do /yaklock again it does nothing.
The command:
The teleport part:
Also, if I added if(Locked) to all the doors, wouldn't /yaklock lock all of them rather than just one?
The command:
Код:
if(!strcmp(cmdtext,"/yaklock",true)) { if(PlayerToPoint(1.0,playerid,2324.0361,-1143.1575,1050.4922)) { if(PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2 ) { GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "* %s twists the key in the hole, locking the door.", sendername); ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); if(Locked) { Locked = false; //Unlocked } else { Locked = true; //Locked } } } return 1; }
Код:
else if (PlayerToPointStripped(1.0, playerid,1252.2933,-980.0336,37.5556, cx,cy,cz)) { //Yakuza if(Locked) { GameTextForPlayer(playerid, "~r~Locked", 5000, 1); } else { SetPlayerPos(playerid,2324.0361,-1143.1575,1050.4922); GameTextForPlayer(playerid, "~w~Yakuza HQ", 5000, 3); SetPlayerInterior(playerid,12); PlayerInfo[playerid][pInt] = 12; } }