if(strcmp(cmdtext, "/apdlocker", true) == 0) // LSPD Locker { if(IsPlayerConnected(playerid)) { if(IsACop(playerid)) { if(IsPlayerConnected(playerid)//Would ask for a cord but I changed it to see if that was the problem) { DisplayDialogForPlayer(playerid, 10); } else { SendClientMessage(playerid, COLOR_GRAD2, " You are not in your locker room !"); return 1; } } else { SendClientMessage(playerid, COLOR_GREY, " You are not a MPD officer!"); return 1; } } return 1; }
if(strcmp(cmdtext, "/apdlocker", true) == 0) // LSPD Locker
{
if(IsPlayerConnected(playerid))
{
printf("IsACop: %i",IsACop(playerid));
if(IsACop(playerid))
{
if(IsPlayerConnected(playerid)//Would ask for a cord but I changed it to see if that was the problem)
{
DisplayDialogForPlayer(playerid, 10);
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " You are not in your locker room !");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GREY, " You are not a MPD officer!");
return 1;
}
}
return 1;
}
Hi!
Replace your code with this: PHP код:
|
[22:25:00] [cmd] [Harry_Peng] /apdlocker [22:25:00] IsACop: 0
Can you show us the IsACop function? It's probably something to do with that
|
stock IsACop(playerid) { if(IsPlayerConnected(playerid)) { /*new leader = PlayerInfo[playerid][pLeader]; new member = PlayerInfo[playerid][pMember]; if(member == 1 || member == 2 || member == 3 || member == 7) return 1; else if(leader == 1 || leader == 2 || leader == 3 || leader == 7) return 1;*/ new type = FactionInfo[PlayerInfo[playerid][pMember]][FactionType]; if(type == 1) return 1; //else if(type == 2) return 1; //else if(type == 5) return 1; } return 0; }
stock IsACop(playerid)
{
if(IsPlayerConnected(playerid))
{
/*new leader = PlayerInfo[playerid][pLeader];
new member = PlayerInfo[playerid][pMember];
if(member == 1 || member == 2 || member == 3 || member == 7) return 1;
else if(leader == 1 || leader == 2 || leader == 3 || leader == 7) return 1;*/
new type = FactionInfo[PlayerInfo[playerid][pMember]][FactionType];
printf("type: %i",FactionInfo[PlayerInfo[playerid][pMember]][FactionType]);
if(type == 1) return 1;
//else if(type == 2) return 1;
//else if(type == 5) return 1;
}
return 0;
}