10.11.2008, 10:18
Hello. I got a little problem. I was making a HQs witch can enter just Faction members, and when I write /openhq, can enter that HQ everyone, when I write /closehq can enter just faction members... But I have problem. When I write /closehq its still opened.. Here is a code, maybe someone know what to do.
This is on command "/enter"
and this is on "/exit"
Код:
new factionhq = 1;
Код:
if(strcmp(cmd, "/openhq", true) == 0) { if(IsPlayerConnected(playerid)) { if (PlayerToPoint(3.0, playerid,2445.5452,-1759.2820,13.5911)) // { if (PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6) { factionhq = 0; SendClientMessage(playerid, COLOR_GREEN, " HQ OPEN"); } else { SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!"); } }
Код:
if(strcmp(cmd, "/closehq", true) == 0) { if(IsPlayerConnected(playerid)) { if (PlayerToPoint(3.0, playerid,2445.5452,-1759.2820,13.5911)) // { if (PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6) { factionhq = 0; BroadCast(COLOR_RED, " HQ CLOSED"); } else { SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command!"); } }
Код:
else if (PlayerToPoint(3.0, playerid,2445.5452,-1759.2820,13.5911))// { if(PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6) { SetPlayerInterior(playerid,9); SetPlayerPos(playerid,82.8803,1323.3667,1083.8662); GameTextForPlayer(playerid, "~w~Welcome to Faction HQ", 5000, 1); } else if(factionhq == 0) { SetPlayerInterior(playerid,9); SetPlayerPos(playerid,82.8803,1323.3667,1083.8662); GameTextForPlayer(playerid, "~w~Welcome to Faction HQ", 5000, 1); } }
Код:
else if (PlayerToPoint(3.0, playerid,82.8803,1323.3667,1083.8662)) // { SetPlayerInterior(playerid,0); SetPlayerPos(playerid,2445.5452,-1759.2820,13.5911); }