SA-MP Forums Archive
!!! I think I did my /admins wrong !!! - 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: !!! I think I did my /admins wrong !!! (/showthread.php?tid=244232)



!!! I think I did my /admins wrong !!! - Azzy - 26.03.2011

Hey guy's some of you might know I'm very new to scripting so I'm still learning,

I think I made a code for players to use to see which admins are on but it's not working.
Could someone post an example of /admins command in dcmd so I can compare to mine. I'd post but I'm not because I want to compare and see what I have done wrong this was I will remember in the future.

Thanks in advance.


Re: !!! I think I did my /admins wrong !!! - Medal Of Honor team - 26.03.2011

pawn Код:
if (strcmp("/admins", cmdtext, true) == 0)
    {
        new adminname[MAX_PLAYER_NAME];
        new string[128];
        new count=0;
        SendClientMessage(playerid, COLOR_BLUE, "________________________________________");
        for(new i=0; i<MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                if(PlayerInfo[i][pAdminLevel] > 1) // or whatever you use
                {
                GetPlayerName(i, adminname, sizeof(adminname));
                format(string, 256, "Admin: %s [ID %d] [Level %d]", adminname,i,PlayerInfo[i][pAdminLevel]);
                SendClientMessage(playerid, COLOR, string); // Your color
                count++;
                }
                if(PlayerInfo[i][pAdminLevel] == 1)
                {
                GetPlayerName(i, adminname, sizeof(adminname));
                format(string, 256, "Member: %s [ID %d] [Level %d]", adminname,i,PlayerInfo[i][pAdminLevel]);
                SendClientMessage(playerid, COLOR_BLUE, string); // Your color
                count++;
                }
            }
        }
        return true;
    }



Re: !!! I think I did my /admins wrong !!! - Azzy - 26.03.2011

Ok, I'm way off I've done it wrong, could you explain how to implement this into my Gamemode from the start?
Thanks.


Re: !!! I think I did my /admins wrong !!! - Serbish - 26.03.2011

Post yours and we will tell you what you did wrong.
This may help also other people who have the same problem.


Re: !!! I think I did my /admins wrong !!! - Azzy - 26.03.2011

Could I ask, does it matter where I put my code in GM?


Re: !!! I think I did my /admins wrong !!! - Serbish - 26.03.2011

You must put it under OnPlayerCommandText.


Re: !!! I think I did my /admins wrong !!! - kemppis_ - 26.03.2011

i think it is "if (strcmp(cmdtext, "/admins", true) == 0)"


Re: !!! I think I did my /admins wrong !!! - pawn_ - 26.03.2011

Quote:
Originally Posted by kemppis_
Посмотреть сообщение
i think it is "if (strcmp(cmdtext, "/admins", true) == 0)"
Doesn't matter, both the strcmp codes are the same, so it makes no difference at all.


Re: !!! I think I did my /admins wrong !!! - kemppis_ - 26.03.2011

AASDASDASD

EDIT: Sorry mate :S


Re: !!! I think I did my /admins wrong !!! - pawn_ - 26.03.2011

@kemppis_:

pawn Код:
COMMAND:pm(playerid, params[])
{
    new text;
    new pID;
    if(!sscanf(params, "us", pID, text))
    {
        new name[MAX_PLAYER_NAME];
        new string[128];
        GetPlayerName(playerid, name, sizeof(name));
        format(string, sizeof(string), "0xFFFFFF[PM]%s say: %s ", name, text);
        SendClientMessage(pID, playerid, string);
        return 1;
    }
    else return SendClientMessage(playerid, 0xFFFFFF, "USAGE: /pm [id] [Text]");
}