[Help]Commands
#6

try this:
PHP код:
CMD:kick(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] >= || PlayerInfo[playerid][pGameMaster] >= 1)
    {
        new 
string[128], giveplayeridreason[64];
        if(
sscanf(params"us[64]"giveplayeridreason)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /kick [playerid/partofname] [reason]");

        if(
IsPlayerConnected(giveplayerid))
        {
            if(
PlayerInfo[giveplayerid][pAdmin] < PlayerInfo[playerid][pAdmin] || PlayerInfo[giveplayerid][pGameMaster] < PlayerInfo[playerid][pGameMaster]) {
                new 
playerip[32];
                
GetPlayerIp(giveplayeridplayeripsizeof(playerip));
                
format(stringsizeof(string), "AdmCmd: %s (IP:%s) was kicked by %s, reason: %s"GetPlayerNameEx(giveplayerid), playeripGetPlayerNameEx(playerid), reason);
                
Log("logs/kick.log"string);
                
format(stringsizeof(string), "AdmCmd: %s was kicked by %s, reason: %s"GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
                
SendClientMessageToAllEx(COLOR_LIGHTREDstring);
                
Kick(giveplayerid);
            }
            return 
1;
        } else 
SendClientMessage(playeridCOLOR_GRAD2"Invalid player specified.");
    }

    return 
1;

remember to use #include <ZCMD> in your top of ur script. i made it ZCMD because its faster and easier for me
Reply


Messages In This Thread
[Help]Commands - by vannesenn - 28.11.2012, 11:45
Re: [Help]Commands - by Ballu Miaa - 28.11.2012, 12:16
Re: [Help]Commands - by vannesenn - 28.11.2012, 13:20
Re: [Help]Commands - by David (Sabljak) - 28.11.2012, 13:45
Re: [Help]Commands - by vannesenn - 28.11.2012, 14:40
Re: [Help]Commands - by HarryPotter - 28.11.2012, 14:47
Re: [Help]Commands - by vannesenn - 28.11.2012, 15:11

Forum Jump:


Users browsing this thread: 2 Guest(s)