SA-MP Forums Archive
[HELP]/admins <Show current admins online by ID, Name, Rank and Duty> - 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: [HELP]/admins <Show current admins online by ID, Name, Rank and Duty> (/showthread.php?tid=258736)



[HELP]/admins <Show current admins online by ID, Name, Rank and Duty> - Deal-or-die - 01.06.2011

Hello Fellow Scripters,
I have recently just come across the part of setting up my /admins bit in my script
This part basically just shows you the current admins online and if they are on duty or not
If anyone could help many thanks to you

pawn Code:
if (strcmp(cmd, "/admins", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            SendClientMessage(playerid, COLOR_RED, " ** Admins Online: **");
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(IsPlayerConnected(i))
                {
                    if(PlayerInfo[i][pAdmin] >= 1)
                    {
                        GetPlayerName(i, sendername, sizeof(sendername));
                        format(string, 256, "%s: %s ( %s ) Duty: %s", pAdmin, sendername, playerid, pAOnDuty);
                        SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
                    }
                }
            }
        }
        return 1;
    }
This is what i want

pawn Code:
format(string, 256, "<Admin Rank>: <Name> ( ID ) Duty: <If they are on duty"
Yes i am a little embarrassed at my effort of scripting :S

Cheers, Steve


Re: [HELP]/admins <Show current admins online by ID, Name, Rank and Duty> - DeathOnaStick - 01.06.2011

I don't understand your problem completely. Doesn't it work? / Where is the problem exactly? / Does something work wrong? / Shall it do more than it does at the moment? / What doesnt it do what it should do?


Re: [HELP]/admins <Show current admins online by ID, Name, Rank and Duty> - Biesmen - 01.06.2011

pawn Code:
if(strcmp(cmd, "/admins", true) == 0)
{
    SendClientMessage(playerid, COLOR_RED, " ** Admins online: **");
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(PlayerInfo[i][pAdmin] >= 1)
            {
                GetPlayerName(i, sendername, sizeof(sendername));
                format(string, 100, "%i: %s ( %i ) Duty: %i", PlayerInfo[i][pAdmin], sendername, i, PlayerInfo[i][pAOnDuty]);
                SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
            }
        }
    }
    return 1;
}



Re: [HELP]/admins <Show current admins online by ID, Name, Rank and Duty> - vladi866 - 01.06.2011

Quote:
Originally Posted by Biesmen
View Post
pawn Code:
if(strcmp(cmd, "/admins", true) == 0)
{
    SendClientMessage(playerid, COLOR_RED, " ** Admins online: **");
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(PlayerInfo[i][pAdmin] >= 1)
            {
                GetPlayerName(i, sendername, sizeof(sendername));
                format(string, 100, "%s: %s ( %s ) Duty: %s", PlayerInfo[i][pAdmin], sendername, i, PlayerInfo[i][pAOnDuty]);
                SendClientMessage(playerid, COLOR_LIGHTGREEN, string);
            }
        }
    }
    return 1;
}
first of all you don't know what kind of script he has maybe how he wrote it's ok and why %s on player's id?
%s is for string
%f float
%d number
%c character....


Re: [HELP]/admins <Show current admins online by ID, Name, Rank and Duty> - Biesmen - 01.06.2011

Quote:
Originally Posted by vladi866
View Post
first of all you don't know what kind of script he has maybe how he wrote it's ok and why %s on player's id?
%s is for string
%f float
%d number
%c character....
Because I didn't check the string, I just fixed what he said.
My bad I didn't check the string, I changed it. Now everyone's happy, you too?

And use your common sense regarding his pAdmin stuff and pAdminOnDuty stuff. It's clear he didn't create a stock or anything like that for pAdmin and pAdminOnDuty.


Re: [HELP]/admins <Show current admins online by ID, Name, Rank and Duty> - Deal-or-die - 01.06.2011

Ok, well Thanks for your help so far but ill put up a SS of what is actually happening just so you guys might be able to Further but i am happy to give you guys what ever Info you guys need just wanna get this over and done with so i can move on

^Rank^........^Name^.....^ID^......^Duty On/Off^
Cheers,
Steve


Re: [HELP]/admins <Show current admins online by ID, Name, Rank and Duty> - Biesmen - 01.06.2011

Who's code are you using? If it's none of those stated above, then post the code.


Re: [HELP]/admins <Show current admins online by ID, Name, Rank and Duty> - Deal-or-die - 01.06.2011

What do you mean by what code? im using bits of the LSL-RP script so thought i would steal /admins to fix up my troubles by just made more Lol