what is wrong here ?
#6

Quote:
Originally Posted by expertprogrammer
Посмотреть сообщение
Here is my old /ban cmd modify for your needs:
pawn Код:
dcmd_ban(playerid, params[])
{
    if(IsPlayerAdmin2[playerid] == 2)
    {
    new level;
    new pid;
    if (sscanf(params, "us", pid, level))
    {
        SendClientMessage(playerid, 0xFF0000AA, "USAGE: /ban [ID] [Reason] - Ban a rule-breaker.");
    }
    else if (pid == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "Player not found");
    else
    {
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(pid, pname, sizeof(pname));
    new string[256];
    format(string, sizeof(string), "Administrator %s have banned %s for: %s", name, pname, level);
    SendClientMessageToAll(COLOR_BLUE, string);
    Ban(pid);
    }
    return 1;
}
    else return SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be an admin level 4 or higher to use this command.");
Note: You got to fix colors and messages to get this working.
Thanks dude i fix this i just forgot to return...
pawn Код:
if(sscanf(params, "us[64]", targetid, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /banid <playerid> <reason>");
FIXED
Reply


Messages In This Thread
what is wrong here ? - by Rafa - 25.07.2011, 17:11
Re: what is wrong here ? - by iPLEOMAX - 25.07.2011, 17:13
Re: what is wrong here ? - by Rafa - 25.07.2011, 17:19
Re: what is wrong here ? - by Rafa - 26.07.2011, 00:02
Re: what is wrong here ? - by Guest3598475934857938411 - 26.07.2011, 00:10
Re: what is wrong here ? - by Rafa - 26.07.2011, 00:22
Re: what is wrong here ? - by Guest3598475934857938411 - 26.07.2011, 11:00

Forum Jump:


Users browsing this thread: 2 Guest(s)