SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Help Archive (https://forum.sa-mp.com/forumdisplay.php?f=89)
-   -   command /admins (https://forum.sa-mp.com/showthread.php?t=113895)

MrLeNy 16/12/2009 03:17 PM

command /admins
 
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 :-[

Robert007 16/12/2009 04:25 PM

Re: command /admins
 
http://wiki.sa-mp.com/wiki/ShowPlayerDialog

MrLeNy 16/12/2009 04:28 PM

Re: command /admins
 
function is:
ShowPlayerDialog :|

Robert007 16/12/2009 04:40 PM

Re: command /admins
 
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;
}


MrLeNy 16/12/2009 04:46 PM

Re: command /admins
 
thank you very much. The script works :)


All times are GMT. The time now is 12:09 AM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.