can someone tech me make simple admin commands
#4

[ame]http://www.youtube.com/watch?v=HwBeNNjLB8k&feature=channel_video_title[/ame]


Watch this...

Edit: I suggest you to use sscanf and than you can easily create any command.


So, your command will look like this if you use sscanf.

pawn Код:
CMD:kick(playerid, params[])
{
    new player, reason[128], str[128];
    if(PlayerInfo[playerid][pAdminLevel] >= 2)
    {
        if(!sscanf(params, "us[128]",player, reason))
        {
            if(IsPlayerConnected(player))
            {
                SendClientMessage( playerid , 0xFFFFFFFF, "You have kicked the player!");
                format(str, sizeof(str), "You got kicked by Admin | Reason: %s.", reason);
                SendClientMessage( player , 0xFFFFFFFF, str);
                Kick(player);
            }
            else return SendClientMessage( playerid , 0xFF0000FF, "This player is not online.");
        }
        else return SendClientMessage( playerid , 0xFFFFFFFF, "Usage: /kick [playerid][reason]");
    }
    else return SendClientMessage( playerid, 0xFF0000FF, "You'r not an admin!");
    return 1;
}
Untested.
Reply


Messages In This Thread
can someone tech me make simple admin commands - by Dr.Ghost - 13.03.2011, 09:35
Re: can someone tech me make simple admin commands - by xRyder - 13.03.2011, 09:43
Re: can someone tech me make simple admin commands - by Dr.Ghost - 13.03.2011, 09:50
Re: can someone tech me make simple admin commands - by xRyder - 13.03.2011, 09:53
Re: can someone tech me make simple admin commands - by Dr.Ghost - 13.03.2011, 10:30
Re: can someone tech me make simple admin commands - by bestr32 - 16.03.2011, 17:36
Re: can someone tech me make simple admin commands - by bestr32 - 16.03.2011, 17:44

Forum Jump:


Users browsing this thread: 1 Guest(s)