Not changing
#1

So for my script I am trying to add /admins so it shows if you are on duty or off duty. Except it is stuck at off duty.

PHP код:
YCMD:admins(playerid, params[], help) {
    if(
help) {
        
SendClientMessage(playerid, X11_WHITE, "Lists in game admins");
        return 
1;
    }
    new 
EAdminFlags:aflags = EAdminFlags:GetPVarInt(playerid, "AdminFlags");
    new 
EAdminFlags:userflags;
    new 
msg[128];
    new 
count;
    
SendClientMessage(playerid, COLOR_YELLOW, "{BDBDBD}Admins Online:");
    foreach(
Player, i) {
        if(
IsPlayerConnectEx(i)) {
            
userflags = EAdminFlags:GetPVarInt(i, "AdminFlags");
            if(((
GetPVarInt(i, "AdminHidden") == 0 || aflags & EAdminFlags_All)) || aflags & EAdminFlags_ServerManager) {
                if(
userflags != EAdminFlags_None) {
                    if(
GetPVarInt(i, "AdminHidden") != 2) {
                        if(
GetPVarInt(i, "AdminDuty"); == 1){
                        
format(msg,sizeof(msg), "{F2F2F2}%s %s (%s) {30BF00}[ON DUTY]",getAdminName(i), GetPlayerNameEx(i, ENameType_CharName), GetPlayerNameEx(i, ENameType_AccountName));
                    } else {
                        
format(msg,sizeof(msg), "{F2F2F2}%s %s (%s) {FF6347}[OFF DUTY]",getAdminName(i), GetPlayerNameEx(i, ENameType_CharName), GetPlayerNameEx(i, ENameType_AccountName));
                    }
                        
SendClientMessage(playerid, GetPVarInt(i,"AdminHidden") == 1 ? X11_GREY : (GetPVarInt(i, "AdminDuty") == 0 ?COLOR_YELLOW2:getNameTagColour(i)), msg);
                        
count++;
                    }
                }
            }
        }
    }
    if(
count != 0) {
        
format(msg, sizeof(msg), "{D8D8D8}Admin Count: %s",getNumberString(count));
        
SendClientMessage(playerid, X11_ORANGE, msg);
    }
    return 
1;
} 
Reply
#2

if(GetPVarInt(i, "AdminDuty"); == 1){

i guess that semi colon is blocking your code
Reply


Forum Jump:


Users browsing this thread: