[Include] k_rplayer : Remove Player
#1

Remove Player include

Hi everyone.
I've made an include to kick or ban an player. The functions + their effect:

Код:
KickPlayer(playerid, kickid, bool:UseCustomName, CustomName[], kickreason[]);

- This will kick a player from the server, and it'll show a message to all the players + the kicked player.
- All the kicks will be saved in 'scriptfiles/KICK.log'
And
Код:
BanPlayer(playerid, banid, bool:UseCustomName, CustomName[], banreason[]);

- This will ban a player from the server, and it'll show a message to all the players + the banned player.
- The bans won't be saved in samp.ban , but in 'scriptfiles/Bans' -> Every IP their own file; example: 'scriptfiles/Bans/127.0.0.1.ban'
- If the file 'IP.ban' exists (if the file has the IP of the player) the player will see: YOU ARE BANNED! Reason: Ban reason
- In the ban file there is: BannedBy (who banned the player), BanReason (ban reason) and BanDateTime (Date+Time of the ban)
- To unban someone: Remove the IP file (soon there'll be an 'UnBanIp' function)
Some examples to use the functions

pawn Код:
//For example: Someone didn't fill in his password:
KickPlayer(playerid, false, true, "Admin Bot", "Not logging in");
// Now players will see: "PLAYERNAME has been kicked by Admin Bot [Reason: Not logging in]
// This was an example for how to use the the Kick Command with a custom name (admin bot)
// To use for a player ID:
KickPlayer(playerid, an_id, false, "", "Ban Reason");
You can use the same with BanPlayer. Here's a whole ban command (copy-paste from my gamemode. It probally won't work in your gamemode:

pawn Код:
dcmd_ban(playerid, params[])
{
    new GiveID, GiveReason[65];
    if(PlayerInfo[playerid][pLogged]){
        if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 2){
            if(sscanf(params, "iz", GiveID, GiveReason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /ban [playerid] [reason]");
            if(!strlen(GiveReason) || strlen(GiveReason) > 65) return SendClientMessage(playerid, COLOR_GRAY, "[ERROR] Reason may not be longer then 65 characters");
            if(!IsPlayerConnected(GiveID) || GiveID == INVALID_PLAYER_ID/* || GiveID == playerid*/) return SendClientMessage(playerid, COLOR_RED, "[ERROR] That player isn't connected or it's yourself");
            BanPlayer(GiveID, playerid, false, "", GiveReason);
        }
        else return SendNoAdminMessage(playerid, 2);
    }
    else return SendClientMessage(playerid, COLOR_GRAY, ERROR_NOTLOGGED);
    return 1;
}
INSTALLATION
1) Download the file
2) Copy all the files to your SAMP folder
3) Open your filterscript/gamemode
4) Add this in your filterscript/gamemode: #include <k_rplayer>
5) Add 'rplayer_OnConnect(playerid);' to 'OnPlayerConnect(playerid)' to your filterscript/gamemode
6) You can use the functions

DOWNLOAD
Just click on the link below:
http://www.rpdsamp.nl/get/gta/sa/mp/.../k_rplayer.zip

CREDITS
- Kwarde (me) - For creating the script
- Draconblue - For the DINI include

Just enjoy this script.
If you don't understand something, send me an PM or reply in this topic

Please report bugs

Kind Regards,
Kevin aka Kwarde
Reply


Messages In This Thread
k_rplayer : Remove Player - by Kwarde - 30.10.2010, 14:22
Re: k_rplayer : Remove Player - by Seven. - 30.10.2010, 14:26
Re: k_rplayer : Remove Player - by Whizion - 30.10.2010, 14:37
Re: k_rplayer : Remove Player - by willsuckformoney - 30.10.2010, 14:45
Re: k_rplayer : Remove Player - by Gh0sT_ - 30.10.2010, 16:15
Re: k_rplayer : Remove Player - by Kwarde - 30.10.2010, 16:43
Re: k_rplayer : Remove Player - by knackworst - 27.11.2010, 10:34
Re: k_rplayer : Remove Player - by Kwarde - 27.11.2010, 10:42
Re: k_rplayer : Remove Player - by knackworst - 27.11.2010, 11:00
Re: k_rplayer : Remove Player - by Kwarde - 27.11.2010, 11:10

Forum Jump:


Users browsing this thread: 2 Guest(s)