Admin Scripting Help
#10

Quote:
Originally Posted by L.Hudson
Посмотреть сообщение
I suggest you to use a stock for all "GetPlayerFunctions" example:

pawn Код:
stock NAME(playerid) // Put it in the last line of your script
{
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pname, sizeof(pname));
    return pname;
}
in other words, try using this:
pawn Код:
CMD:requestban(playerid, params[])
{
    new id[128], reason[128];
    if(AdminLevel[playerid] < 1) return SendClientMessage(playerid, COLOR_SILVER, "You must be atleast a level 1 administrator (Moderator) to use this command!");
    if(sscanf(params, "us[128]", id, reason)) return SendClientMessage(playerid, COLOR_SILVER, "/requestban [id] [reason]"); //Define these variables (id, reason)

    for(new a; a<MAX_PLAYERS; a++)
    {
        if(AdminLevel[playerid] >= 4)
        {
            new str[128];
            format(str, sizeof(str), "[Ban Request] %s(%d) requested a ban on %s(%d) for %s", NAME(playerid), playerid, NAME(id), id, reason);
            SendClientMessage(a, COLOR_RED, str);
        }
    }
    return 1;
}
First, thank you very much for your response.

I don't really like to use stocks, as I've had trouble with them in the past.



Quote:

Try :

pawn Код:
GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
GetPlayerName(id, PlayerName2, MAX_PLAYER_NAME);
should work.

EDIT : too late.

Thanks again for your help, but I'm still getting the same error.
Reply


Messages In This Thread
Admin Scripting Help - by Anjh - 04.04.2013, 15:40
Re: Admin Scripting Help - by emokidx - 04.04.2013, 15:54
Re: Admin Scripting Help - by Dj_maryo1993 - 04.04.2013, 16:01
Re: Admin Scripting Help - by Anjh - 04.04.2013, 16:27
Re: Admin Scripting Help - by L.Hudson - 04.04.2013, 16:28
Re: Admin Scripting Help - by SilverKiller - 04.04.2013, 16:29
Re: Admin Scripting Help - by Anjh - 04.04.2013, 16:30
Re: Admin Scripting Help - by Anjh - 04.04.2013, 16:32
Re: Admin Scripting Help - by L.Hudson - 04.04.2013, 16:33
Re: Admin Scripting Help - by Anjh - 04.04.2013, 16:36

Forum Jump:


Users browsing this thread: 1 Guest(s)