kick command
#1

Once again, i scripted a /kick command to kick a player but i don't know how to show the "targetid" who kicked him/her and what the reason is.

To those who are interested on helping me, please edit/add a line that shows the KICKED player who kicked him/her and what the reason is.

OR make this command more unique and understandable for a newbie like me.

PHP код:
CMD:kick(playeridparams[])
{
    if(
pInfo[playerid][pAdmin] < 1)
        return 
SendClientMessage(playeridGREY"You are not authorized to use that command.");
        
    new
        
targetid,
        
Reason[128],
        
str[128]
    ;
    
    if(
sscanf(params"us[128]"targetidReason))
        return 
SendClientMessage(playeridGREY"USAGE: /kick [Playerid] [Reason]");
        
    if(!
IsPlayerConnected(targetid))
        return 
SendClientMessage(playeridGREY"Player is not connected.");
        
    new
        
pname[MAX_PLAYER_NAME],
        
tname[MAX_PLAYER_NAME]
    ;
    
    
GetPlayerName(playeridpnamesizeof(pname));
    
GetPlayerName(playeridtnamesizeof(tname));
    
    
format(strsizeof(str), "You have been kicked by %s."tnameReason);
    
SendClientMessage(targetidREDstr);
    
format(strsizeof(str), "You have kicked %s."pnameReason);
    
SendClientMessage(playeridREDstr);
    
Kick(targetid);
    return 
1;

Reply


Messages In This Thread
kick command - by iCurse - 08.04.2016, 14:42
Re: kick command - by sheNdjze - 08.04.2016, 14:54
Re: kick command - by X337 - 08.04.2016, 15:00
Re: kick command - by AndySedeyn - 08.04.2016, 15:02
Re: kick command - by Akbaig - 08.04.2016, 15:11
Re: kick command - by AndySedeyn - 08.04.2016, 15:42

Forum Jump:


Users browsing this thread: 1 Guest(s)