SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 16/12/2009, 04:17 PM   #1
MrLeNy
Big Clucker
 
Join Date: Sep 2009
Posts: 161
Reputation: 0
Default 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
MrLeNy is offline  
Old 16/12/2009, 05:25 PM   #2
Robert007
Little Clucker
 
Join Date: Sep 2008
Posts: 15
Reputation: 0
Default Re: command /admins

http://wiki.sa-mp.com/wiki/ShowPlayerDialog
Robert007 is offline  
Old 16/12/2009, 05:28 PM   #3
MrLeNy
Big Clucker
 
Join Date: Sep 2009
Posts: 161
Reputation: 0
Default Re: command /admins

function is:
ShowPlayerDialog
MrLeNy is offline  
Old 16/12/2009, 05:40 PM   #4
Robert007
Little Clucker
 
Join Date: Sep 2008
Posts: 15
Reputation: 0
Default 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;
}
Robert007 is offline  
Old 16/12/2009, 05:46 PM   #5
MrLeNy
Big Clucker
 
Join Date: Sep 2009
Posts: 161
Reputation: 0
Default Re: command /admins

thank you very much. The script works
MrLeNy is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
/admins online command Pawel2k9 Help Archive 6 19/09/2009 03:42 PM
[Help] /admins command. [SOLVED] Nakash Help Archive 11 29/08/2009 02:44 PM
Admins command [TouchX]Ash Help Archive 2 24/06/2009 04:57 PM


All times are GMT. The time now is 10:34 PM.


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