SA-MP Forums Archive
command /admins - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: command /admins (/showthread.php?tid=113895)



command /admins - MrLeNy - 16.12.2009

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:
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;
}
Please help me


Re: command /admins - Robert007 - 16.12.2009

https://sampwiki.blast.hk/wiki/ShowPlayerDialog


Re: command /admins - MrLeNy - 16.12.2009

function is:
ShowPlayerDialog


Re: command /admins - Robert007 - 16.12.2009

Code:
dcmd_admins(playerid,params[])
{
#pragma unused params
new sadmin[128], admin[128], modek[128], string[256];
new a,v,m;
//Administratorzy
for(new i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i))
{
if(IsPlayerAdmin(i))format(sadmin, sizeof(sadmin), "%s jest obecnie online.\n%s", PlayerName(i),sadmin),a++;
if(PlayerInfo[i][IsPlayerAdm])format(admin, sizeof(admin), "%s jest obecnie online.\n%s", PlayerName(i),admin),v++;
if(PlayerInfo[i][IsPlayerMod])format(modek, sizeof(modek), "%s jest obecnie online.\n%s", PlayerName(i),modek),m++;
}
if(!a)format(sadmin, sizeof(sadmin), "Aktualnie nie ma Super Adminуw OnLine");
if(!v)format(admin, sizeof(admin), "Aktualnie nie ma Adminуw OnLine");
if(!m)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;
}



Re: command /admins - MrLeNy - 16.12.2009

thank you very much. The script works