SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 21/09/2018, 02:02 PM   #1
TaligaroW
Little Clucker
 
Join Date: Jun 2018
Posts: 24
Reputation: 0
Question /admins in dialog

Hello everyone,i have /admins command that shows online admins in chat,but i want to make it to be in dialog
Here's my command
PHP Code:
CMD:admins(playerid,params[])
{
SendClientMessage(playerid,COLOR_RED,"**____________VORTEX-SAMP ADMINS____________**");
new 
j;
GetPlayerPoolSize();
for(new 
id=0;id<=j;id++)
{
GetPlayerName(id,name,sizeof(name));
format(iname,sizeof(iname),"%s.ini",name);
if(
dini_Int(iname,"Admin")!=0)
{
new 
str[MAX_PLAYER_NAME+100];
format(str,sizeof(str),"Íèê: {00FF00}%s {FF0000}Àäìèí Íèâî: {FFFF00}%d",name,dini_Int(iname,"Admin"));
SendClientMessage(playerid,COLOR_ORANGE,str);
}
}
return 
1;

So i want to make this command to show online admins in dialog(the non selectable dialog).
I'll be really thankful if anyone help me!
TaligaroW is offline   Reply With Quote
Old 21/09/2018, 04:21 PM   #2
DeMoo
Big Clucker
 
DeMoo's Avatar
 
Join Date: Dec 2015
Location: Georgia
Posts: 64
Reputation: 3
Default Re: /admins in dialog

maybe like this?

PHP Code:
CMD:admins(playeridparams[])
{
    new 
string[1024],string1[512],total 0;
    foreach(new 
Player)
    {
        if(
IsPlayerConnected(i))
            {
            if(
PlayerInfo[i][pAdmin] > 1)
                {
                new 
admin[20];
                if(
PlayerInfo[i][pAdmin] == 1) { admin "Admin"; }
                else if(
PlayerInfo[i][pAdmin] == 2) { admin "Moderator"; }
                else if(
PlayerInfo[i][pAdmin] == 3) { admin "Administrator"; }
                else if(
PlayerInfo[i][pAdmin] == 4) { admin "Main Administrator"; }
                else if(
PlayerInfo[i][pAdmin] == 5) { admin "Developer"; }
                if(
PlayerInfo[i][pAdmin] >= total++;
                new 
sendername[MAX_PLAYER_NAME];
                
GetPlayerName(isendernamesizeof(sendername));
                
format(string1024"%s\n{00CCFF}%s: {FFFFFF}%s (ID: %d) Status:{00ff00} Online",stringadminsendernamei);
                }
            }
    }
       
format(string1,512,"Admins Online: {ff3300}%d",total);
    
ShowPlayerDialog(playerid65535DIALOG_STYLE_MSGBOXstring1string"Close""");
    return 
1;

__________________
DeMoo is offline   Reply With Quote
Old 21/09/2018, 04:32 PM   #3
CaptainBoi
Huge Clucker
 
CaptainBoi's Avatar
 
Join Date: May 2018
Location: Inside Game
Posts: 232
Reputation: 26
Default Re: /admins in dialog

PHP Code:
playername(playerid)
{
 new 
pname[MAX_PLAYER_NAME];
 
GetPlayerName(playeridpnameMAX_PLAYER_NAME);
 return 
pname;
}
CMD:admins(playerid)
{
    new 
count 0;
    new 
str[200];
    for(new 
ii<MAX_PLAYERS;i++)
    {
        if(
MakeVariableOfAdmin[i] > 0)
        {
            
format(strsizeof str"%s[%d] || Admin Level: %d\n""Close"""playername(i), iMakeVariableOfAdmin[i]);
            
ShowPlayerDialog(playerid1DIALOG_STYLE_MSGBOX"Current online Admins:"str"""Close");
            
count++;
        }
    }
    if (
count == 0ShowPlayerDialog(playerid1DIALOG_STYLE_MSGBOX"Current online Admins:""No admins online\n_____________________""Close""");
    return 
1;

__________________
Code:
Releases
[FilterScript] Dynamic MySQL GPS System
[Tutorial] How to make TDM Team Selection.
[Include] moneybar.inc || Coloured Moneybar || Released
[Tutorial] PAWN Compiler In Notepad++
[FilterScript] Perks System (v: [On Update]) [DINI, ZCMD]
[FilterScript] Realistic Transmission Speedometer
CaptainBoi is offline   Reply With Quote
Old 21/09/2018, 04:35 PM   #4
CodeStyle175
Banned
 
Join Date: Apr 2014
Posts: 455
Reputation: 35
Default Re: /admins in dialog

PHP Code:
new arrAdminRanks[][]={"Admin","Moderator","Moderator","Administrator","Main Administrator","Developer"};
GetUserName(p){
    new 
s[20];
    
GetPlayerName(p,s,20);
    return 
s;
}

CMD:admins(p){
    new 
s[1024],
        
s2[20],
        
cnt;
    foreach(new 
Player){
        if(!
PlayerInfo[i][pAdmin])continue;
        
cnt++;
        
format(s,1024,"%s%d | %s | %s\n",s,cnt,arrAdminRanks[PlayerInfo[i][pAdmin]],GetUserName(i));
    }
    
format(s2,20,"Admins online - %d",cnt);
    
ShowPlayerDialog(p,d_admins,DIALOG_STYLE_MSGBOX,s2,s,"Close","");
    return 
1;


Last edited by CodeStyle175; 21/09/2018 at 06:36 PM.
CodeStyle175 is offline   Reply With Quote
Old 21/09/2018, 05:58 PM   #5
TaligaroW
Little Clucker
 
Join Date: Jun 2018
Posts: 24
Reputation: 0
Default Re: /admins in dialog

thanks alot
TaligaroW is offline   Reply With Quote
Reply

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
[Ajuda] Admins em Dialog /Admins GuiKommander Português/Portuguese 15 08/01/2017 05:35 PM
Online admins dialog /admins help please. SilentSoul Scripting Help 8 28/08/2013 09:33 PM
/admins in dialog MrTinder Scripting Help 3 13/05/2013 02:58 PM
/admins dialog Total online admins do help:( y@sin1 Scripting Help 10 14/01/2012 04:58 PM


All times are GMT. The time now is 12:54 PM.


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