Problem at /kick.
#2

PHP код:
CMD:kick(playeridparams[])
{
        if(
PlayerInfo[playerid][pAdmin] >= 3)
        {
            new 
PID//define the playerid we wanna kick
            
new reason[64]; //the reason, put into a string
            
new str[128]; //a new message string
            
new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME]; //defines the function with the playername we wanna get
            
if(sscanf(params"us[64]"PID,reason)) return SendClientMessage(playeridCOLOR_GREY"USAGE: /kick [playerid] [reason]"); //tell sscanf if the parameters/the syntax is written wrong to return a message (PID and the reason used here)
            
if(!IsPlayerConnected(PID)) // if the ID is wrong or not connected, return a message! (PID used here)
                
return SendClientMessage(playeridCOLOR_GREY"Player is not connected!");
            
GetPlayerName(playeridAdminnamesizeof(Adminname)); //defines the function with the adminname we wanna get
            
GetPlayerName(PIDPlayernamesizeof(Playername));
            
format(strsizeof(str), "'%s' has been kicked by administrator '%s'. Reason: %s "PlayernameAdminnamereason); //format the string we've defined to send the message, playername and adminname are used to receive the information about the names
            
SendClientMessageToAll(COLOR_REDstr); //send that message to all
            
Kick(PID); //kick the playerid we've defined
        
}
        else 
//if he has not got the permissions
        
{
            
SendClientMessage(playeridCOLOR_GREY"You have to be level 3 to use that command!"); //return this message
        
}
        return 
1;

Reply


Messages In This Thread
Problem at /kick. - by GabiXx - 01.08.2015, 14:10
AW: Problem at /kick. - by Macronix - 01.08.2015, 14:12
Re: Problem at /kick. - by GabiXx - 01.08.2015, 14:53
AW: Problem at /kick. - by Macronix - 01.08.2015, 14:57
Re: Problem at /kick. - by xVIP3Rx - 01.08.2015, 14:58
Re: Problem at /kick. - by GabiXx - 01.08.2015, 15:04
Re: Problem at /kick. - by xVIP3Rx - 01.08.2015, 15:17
Re: Problem at /kick. - by GabiXx - 01.08.2015, 16:07
AW: Problem at /kick. - by Macronix - 01.08.2015, 16:10
Re: Problem at /kick. - by GabiXx - 01.08.2015, 16:24

Forum Jump:


Users browsing this thread: 4 Guest(s)