Little problem with kick
#4

PHP код:
COMMAND:kick(playeridparams[])
{
    new 
PlayerToKickReason[128], ReasonMsg[128], Name[24], Kieken[150];
    
// Send the command to all admins so they can see it
    
SendAdminText(playerid"/kick"params);
    
// Check if the player has logged in
    
if (APlayerData[playerid][LoggedIn] == true)
    {
        
// Check if the player's admin-level is at least 1
        
if (APlayerData[playerid][PlayerLevel] >= 1)
        {
            if (
sscanf(params"us[128]"PlayerToKickReason)) SendClientMessage(playerid0xFF0000AA"Usage: \"/kick <PlayerToKick> <Reason>\"");
            else
                if (
IsPlayerConnected(PlayerToKick)) // If the player is a valid playerid (he's connected)
                
{
                    
// Get the name of the player who warned the player
                    
GetPlayerName(playeridNamesizeof(Name));
                    
// Send the warned player a message who kicked him and why he's been kicked
                    
format(ReasonMsg128"You have been kicked by %s %s"AdminLevelName[APlayerData[playerid][PlayerLevel]], Name);
                    
SendClientMessage(PlayerToKick0xFF0000FFReasonMsg);
                    
format(ReasonMsg128"Reason: %s"Reason);
                    
SendClientMessage(PlayerToKick0xFF0000FFReasonMsg);
                    
GetPlayerName(PlayerToKick,Namesizeof(Name));
                    new 
playeridname[MAX_PLAYER_NAME];
                    
GetPlayerName(playerid,playeridname,sizeofplayeridname ) );
                    
format(Kieken150"%s has been kicked for : %s by administrator : %s",Name,Reason,playeridname);
                    
SendClientMessageToAll(0xFFFFFFFFKieken);
                    
// Kick the player
                    
Kick(PlayerToKick);
                }
                else
                    
SendClientMessage(playerid0xFF0000FF"That player isn't online");
        }
        else
            return 
0;
    }
    else
        return 
0;
    
// Let the server know that this was a valid command
    
return 1;

Indent properly.
Reply


Messages In This Thread
Little problem with kick - by SomebodyAndMe - 21.11.2011, 13:37
Re: Little problem with kick - by juraska - 21.11.2011, 13:50
Re: Little problem with kick - by SomebodyAndMe - 21.11.2011, 13:59
Re: Little problem with kick - by =WoR=G4M3Ov3r - 21.11.2011, 14:01
Re: Little problem with kick - by SomebodyAndMe - 21.11.2011, 14:03
Re: Little problem with kick - by juraska - 21.11.2011, 14:07

Forum Jump:


Users browsing this thread: 1 Guest(s)