19.04.2012, 11:05
Well i made /lockhq and unlockhq
see this is the code
the lock works only when i /unlockhq i cant enter because its say locked
On top there is /enter.
Any solutions guys??
see this is the code
PHP код:
if(strcmp(cmd, "/lockhq", true) == 0)
{
new fam = PlayerInfo[playerid][pMember];
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMember] <= 6)
{
return 1;
}
if(FamilyInfo[fam][FamilyLocked] == 0)
{
FamilyInfo[fam][FamilyLocked] = 1;
SendClientMessage(playerid,COLOR_GREY,"HQ Locked.");
}
}
return 1;
}
if(strcmp(cmd, "/unlockhq", true) == 0)
{
new fam = PlayerInfo[playerid][pMember];
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMember] <= 6)
{
return 1;
}
if(FamilyInfo[fam][FamilyLocked] == 1)
{
FamilyInfo[fam][FamilyLocked] = 0;
SendClientMessage(playerid,COLOR_GREY,"HQ Unlocked.");
}
}
return 1;
}
PHP код:
for(new h = 5; h < sizeof(FamilyInfo); h++)
{
if(PlayerToPoint(2.0, playerid, FamilyInfo[h][FamilySpawn][0],FamilyInfo[h][FamilySpawn][1],FamilyInfo[h][FamilySpawn][2]))
{
if(PlayerInfo[playerid][pMember] != 1 && PlayerInfo[playerid][pMember] != h && FamilyInfo[h][FamilyLocked] == 1 && AdminDuty[playerid] != 1)
{
GameTextForPlayer(playerid, "~r~Locked", 5000, 1);
}
else
{
if(FamilyInfo[h][FamilyInterior] == 0)
{
GameTextForPlayer(playerid, "~r~Entrance is in Construction", 5000, 1);
}
else if(FamilyInfo[h][FamilyInterior] == 1) // Crackden
{
format(string, sizeof(string), "~p~%s~n~~w~HQ", FamilyInfo[h][FamilyName]);
GameTextForPlayer(playerid, string, 5000, 1);
SetPlayerVirtualWorld(playerid,h);
SetPlayerInterior(playerid,5);
DOO_SetPlayerPos(playerid, 318.6968,1117.9586,1083.8828);
}
else if(FamilyInfo[h][FamilyInterior] == 2) // Ryders
{
format(string, sizeof(string), "~p~%s~n~~w~HQ", FamilyInfo[h][FamilyName]);
GameTextForPlayer(playerid, string, 5000, 1);
SetPlayerVirtualWorld(playerid,h);
SetPlayerInterior(playerid,2);
DOO_SetPlayerPos(playerid, 2465.8018,-1698.3330,1013.5078);
}
else if(FamilyInfo[h][FamilyInterior] == 3) // Cjs
{
format(string, sizeof(string), "~p~%s~n~~w~HQ", FamilyInfo[h][FamilyName]);
GameTextForPlayer(playerid, string, 5000, 1);
SetPlayerVirtualWorld(playerid,h);
SetPlayerInterior(playerid,3);
DOO_SetPlayerPos(playerid, 2496.0498,-1694.3333,1014.7422);
}
}
return 1;
}
}
Any solutions guys??