CMD kick doesnt work
#10

PHP код:
CMD:kick(playeridparams[])
    {
        if(
PInfo[playerid][Level] >= 1) {
            new 
id//define the playerid we wanna kick
            
new reason[64]; //the reason, put into a string
            
new str[128]; //a new message string
            
new Name[MAX_PLAYER_NAME], DealerMessage[128];
            new 
Name2[MAX_PLAYER_NAME];
        
GetPlayerName(playeridNamesizeof(Name));
        
GetPlayerName(idName2sizeof(Name2));
             
//defines the function with the playername we wanna get
            
if(sscanf(params"us[64]"id,reason)) return SendClientMessage(playeridCOLOR_RED"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(id)) // if the ID is wrong or not connected, return a message! (PID used here)
                
return SendClientMessage(playeridCOLOR_RED"Player is not connected!");

            
format(strsizeof(str), "%s has been kicked by %s %s [reason: %s] ",PlayerName(id),aLevel(playerid), PlayerName(playerid), reason); //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
            
SetTimerEx("DelayKick",1200,0,"i",id);//delay the kick by 1 second 200

        
}
        else 
//if he has not got the permissions
        
{
            
SendClientMessage(playeridCOLOR_RED"You are not admin level 1."); //return this message
        
}
        return 
1;
    } 
Try this
Reply


Messages In This Thread
CMD kick doesnt work - by Deny1 - 31.01.2016, 17:06
Re: CMD kick doesnt work - by povargek - 31.01.2016, 17:09
Re: CMD kick doesnt work - by Deny1 - 31.01.2016, 17:15
Re: CMD kick doesnt work - by Deny1 - 31.01.2016, 19:06
Re: CMD kick doesnt work - by Deny1 - 31.01.2016, 19:33
Respuesta: CMD kick doesnt work - by !R1Ch@rD! - 31.01.2016, 23:52
Re: CMD kick doesnt work - by xTURBOx - 01.02.2016, 07:18
Re: CMD kick doesnt work - by Sew_Sumi - 01.02.2016, 07:55
Re: CMD kick doesnt work - by Untonyst - 01.02.2016, 09:05
Re: CMD kick doesnt work - by JamalMaddox - 01.02.2016, 10:02

Forum Jump:


Users browsing this thread: 1 Guest(s)