[HELP]/admins <Show current admins online by ID, Name, Rank and Duty>
#1

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
Reply
#2

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?
Reply
#3

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;
}
Reply
#4

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....
Reply
#5

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.
Reply
#6

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
Reply
#7

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

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)