[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
#2

usefull.ty
Reply
#3

Good job.
Reply
#4

Nice Nice
Reply
#5

BanPlayer, like nick ban?
Reply
#6

An IP ban
Reply
#7

Can I kick NPC's and then simply get them back with a timer?

Thanks for the include! I use it :P

This forum requires that you wait 120 seconds between posts. Please try again in 63 seconds.
Reply
#8

idk, didn't test that ^^
Btw I think that I found an bug. I'm gonna try to fix it tomorrow. But then I'm gonna celebrate "sinterklaas" (Im Dutch, idk if you're a "Vlaams" or French language person (Belgium ^^))

- Kevin
Reply
#9

flemish ; )
lol, why tomorrow, it's 6december in one week...
Reply
#10

Because my parents are divorced. And this weekend I'm by my dad, so then we're gonna celebrate "Sinterklaas". Monday I'm just home. Then I'm gonna celebrate it with my mum.
But whatever, enough off topic. If you have futher comments, PM me
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)