SA-MP Forums Archive
need help with /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)
+--- Thread: need help with /admins (/showthread.php?tid=341639)



need help with /admins - Torus - 11.05.2012

Guys I am working on my admin system and i am stuck in the middle of /admins command . when more than 4 admins are there the line comes blank and i want like if there are more than 3 admins there should be a new line like

Admins:Torus[OWNER],ZIPPER[OWNER],KILLER[Admin]
Admins:Micheal[OWNER]

Can Some One Tell me how to make like that i am going crazy to make the command like that?

+ 1 REP


Re: need help with /admins - iGetty - 11.05.2012

Well, I can help you to make the command like this:

I did the command /admins:

Admins online:
Name1[OWNER]
Name2[OWNER]
Name3[ADMIN]
Name4[OWNER]

I could make it like that for you, if you want?


Re: need help with /admins - TheDominator - 11.05.2012

You could do it like this:

pawn Код:
COMMAND:admins(playerid, params[])
{
    new count = 1, name[24], string[128];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && IsPlayerAdmin(i))
        {
            GetPlayerName(i, name, sizeof(name));
            format(string, sizeof(string), "%s%s \n", string, name);
            count ++;
        }
    }
   
    if(count != 1)
    {
        ShowPlayerDialog(playerid, 123, DIALOG_STYLE_MSGBOX, "Online Admins", string, "OK", "");
    }
    else ShowPlayerDialog(playerid, 123, DIALOG_STYLE_MSGBOX, "[!] Online Admins", "No online admins", "OK", "");
}
I've decided to use a dialog box here.

This is in Zcmd, if you aren't using Zcmd then convert it to your desired choice.


Re: need help with /admins - Torus - 11.05.2012

No no i just want like
Admins: admin name 1 [admin level ] admin name 2 [adminlevel] admin name3 [adminlevel]
and if more than 3
then
Admins: admin name 1 [admin level ] admin name 2 [adminlevel] admin name3 [adminlevel]
Admins: admin name 4 [admin level]


Re: need help with /admins - Torus - 11.05.2012

not in dialogs i want in sendclientmessage


Re: need help with /admins - Torus - 11.05.2012

Guys hmm can u help me please?


Re: need help with /admins - Yuryfury - 11.05.2012

There is a limit for the length of a SendClientMessage string. Do a loop through all the admins and a SendClientMessage for each admin.

Alternatively, a message dialog as mentioned above.


Re: need help with /admins - TheDominator - 11.05.2012

To be honest the dialog box makes the server look a lot more professional rather than SendClientMessage.


Re: need help with /admins - Torus - 11.05.2012

Quote:
Originally Posted by Yuryfury
Посмотреть сообщение
There is a limit for the length of a SendClientMessage string. Do a loop through all the admins and a SendClientMessage for each admin.

Alternatively, a message dialog as mentioned above.
srry bro mere begginer show me code please i will be thankfull


Re: need help with /admins - Torus - 11.05.2012

Quote:
Originally Posted by TheDominator
Посмотреть сообщение
To be honest the dialog box makes the server look a lot more professional rather than SendClientMessage.
i know but .... i just want like that i will define one var so i can switch to dialogs anytime