!!! I think I did my /admins wrong !!!
#1

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

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

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

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

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

You must put it under OnPlayerCommandText.
Reply
#7

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

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

AASDASDASD

EDIT: Sorry mate :S
Reply
#10

@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]");
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)