16.12.2009, 15:17
Hello. I created a command /admins but it does not work. When there is no admin or moderator shows well, but if someone logs in it does not change the text.
Here is the code:
Please help me
Here is the code:
Code:
dcmd_admins(playerid,params[]) { #pragma unused params new sadmin[128], admin[128], modek[128], string[256]; //Administratorzy for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i) && IsPlayerAdmin(i)) { format(sadmin, sizeof(sadmin), "%s jest obecnie online.", PlayerName(i)); }else{ format(sadmin, sizeof(sadmin), "Aktualnie nie ma Super Adminуw OnLine"); } if(IsPlayerConnected(i) && PlayerInfo[i][IsPlayerAdm]){ format(admin, sizeof(admin), "%s jest obecnie online.", PlayerName(i)); }else{ format(admin, sizeof(admin), "Aktualnie nie ma Adminуw OnLine"); } if(IsPlayerConnected(i) && PlayerInfo[i][IsPlayerMod]){ format(modek, sizeof(modek), "%s jest obecnie online.", PlayerName(i)); }else{ format(modek, sizeof(modek), "Aktualnie nie ma Moderatorуw OnLine"); } } format(string,256,"Super Administratorzy:\n %s \n\nAdministratorzy:\n %s \n\nModeratorzy:\n %s", sadmin, admin, modek); ShowPlayerDialog(playerid,ADMINS,DIALOG_STYLE_MSGBOX,"Administracja OnLine",string,"Ok","Wyjdz"); return 1; }