25.07.2015, 12:39
Hello guys!
I am creating my own Admin System and I need help! Please! So the problem is that when I am alone on the server I type /admins and it says that I am Level 4. But when someone joins my server I type /admins and it shows
that HE is Level 4! Please help as fast as you can!
My script:
I am creating my own Admin System and I need help! Please! So the problem is that when I am alone on the server I type /admins and it says that I am Level 4. But when someone joins my server I type /admins and it shows
that HE is Level 4! Please help as fast as you can!
My script:
PHP код:
CMD:admins(playerid,params[]){
new str[256],DIALOG[999],name[MAX_PLAYER_NAME],count=0;
for(new p=0; p<MAX_PLAYERS; p++){
if(IsConnect(p)){
if(P_DATA[playerid][alevel] > 0){
GetPlayerName(p,name,sizeof(name));
switch(P_DATA[playerid][alevel]){
case 1:format(str,sizeof(str),"{FFFFFF}Player:{FF9900} %s{FFFFFF} |{FFFFFF} Rank:{FF9900} Moderator{FFFFFF} |{FFFFFF} Level:{FF9900} %d",name,P_DATA[playerid][alevel]);
case 2:format(str,sizeof(str),"{FFFFFF}Player:{FF9900} %s{FFFFFF} |{FFFFFF} Rank:{FF9900} Admin{FFFFFF} |{FFFFFF} Level:{FF9900} %d",name,P_DATA[playerid][alevel]);
case 3:format(str,sizeof(str),"{FFFFFF}Player:{FF9900} %s{FFFFFF} |{FFFFFF} Rank:{FF9900} Co-Owner{FFFFFF} |{FFFFFF} Level:{FF9900} %d",name,P_DATA[playerid][alevel]);
case 4:format(str,sizeof(str),"{FFFFFF}Player:{FF9900} %s{FFFFFF} |{FFFFFF} Rank:{FF9900} Owner{FFFFFF} |{FFFFFF} Level:{FF9900} %d",name,P_DATA[playerid][alevel]);
}
if(IsPlayerAdmin(p))format(str,sizeof(str),"{FFFFFF}Player:{FF9900} %s{FFFFFF} |{FFFFFF} Rank:{FF9900} Owner{FFFFFF} |{FFFFFF} Level:{FF9900} %d",name,P_DATA[playerid][alevel]);
strcat(DIALOG,str);
count+=1;
}
}
}
if(count > 0)return SPD(playerid,DIALOG_ADMINS,DIALOG_STYLE_MSGBOX,"{FF0000}Online Admins",str,"Close","");
else return SPD(playerid,DIALOG_ADMINS,DIALOG_STYLE_MSGBOX,"{FF0000}Online Admins","{FF0000}No admins online!","Close","");
}