I need help right now please !
#6

ok loook this is all the script :

Code:
   CMD:kick(playerid, params[])
    {
            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
            GetPlayerName(playerid, Adminname, sizeof(Adminname)); //defines the function with the adminname we wanna get
 	  		GetPlayerName(PID, Playername, sizeof(Playername));
            if(sscanf(params, "us[64]", PID,reason)) return SendClientMessage(playerid, COLOR_GREYWHITE, "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(playerid, COLOR_GREYWHITE, "Player is not connected!");

            format(str, sizeof(str), "'%s' has been kicked by administrator '%s'. Reason: %s ", Playername, Adminname, 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_RED, str); //send that message to all
  		    Kick(PID); //kick the playerid we've defined

        }
        else //if he has not got the permissions
        {
            SendClientMessage(playerid, COLOR_GREYWHITE, "You have to be an admin to use that command!"); //return this message


		
return 1;
}
Reply


Messages In This Thread
I need help right now please ! - by MarkNelson - 19.04.2016, 15:49
Re: I need help right now please ! - by introzen - 19.04.2016, 16:00
Re: I need help right now please ! - by MarkNelson - 19.04.2016, 16:05
Re: I need help right now please ! - by MarkNelson - 19.04.2016, 16:33
Re: I need help right now please ! - by Ritzy2K - 19.04.2016, 16:37
Re: I need help right now please ! - by MarkNelson - 19.04.2016, 16:42
Re: I need help right now please ! - by Ritzy2K - 19.04.2016, 17:00
Re: I need help right now please ! - by MarkNelson - 19.04.2016, 17:03
Re: I need help right now please ! - by Ritzy2K - 19.04.2016, 17:11
Re: I need help right now please ! - by iKevin - 19.04.2016, 17:15

Forum Jump:


Users browsing this thread: 1 Guest(s)