30.10.2010, 14:22
(
Последний раз редактировалось Kwarde; 30.10.2010 в 14:38.
)
Remove Player include
Hi everyone.
I've made an include to kick or ban an player. The functions + their effect:
And
Some examples to use the functions
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:
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
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'
Код:
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)
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");
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;
}
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