Ban -
nezo2001 - 28.12.2014
Please anyone explain for me how to make ban command and please don't give me link to a filterscripts.
Thank you !
Re: Ban -
gdkparadox - 28.12.2014
Quote:
Originally Posted by nezo2001
Please anyone explain for me how to make ban command and please don't give me link to a filterscripts.
Thank you !
|
Enter your server, type
Код:
/rcon login yourrconpassword
than you can type
or
Код:
/rcon banip PLAYERIP
It's that simple.
Re: Ban -
nezo2001 - 28.12.2014
I want to make a command for admins
PHP код:
if(PlayerInfo[playerid][pAdmin] != 0)
{
Anyone ??
Re: Ban -
gdkparadox - 28.12.2014
Guessing you are using zcmd, I guess you could do this.. Correct me if it's wrong, it's just from the top of my head.
Код:
CMD:ban(playerid, params[])
{
new targetid;
if(PlayerInfo[playerid][aLevel] < 1) return SendClientMessage(playerid, RED, "Only Admins can use this command.");
if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, RED, "Player not found.");
if(PlayerInfo[targetid][aLevel] > 0) return SendClientMessage(playerid, RED, "You cannot ban admins.");
if(IsPlayerNPC(targetid)) return SendClientMessage(playerid, RED, "You cannot ban NPCs.");
{
PlayerInfo[targetid][Banned] = 1;
format(fstr, sizeof(fstr), "Admin %s [%d] has banned %s [%d].", GetName(playerid), playerid, GetName(targetid), targetid);
SendClientMessageToAll(RED, fstr);
GameTextForPlayer(targetid, "~r~Banned", 5000, 5);
format(fstr2, sizeof(fstr2), "You have been banned by admin %s.", GetName(playerid));
SendClientMessage(targetid, RED, fstr2);
BanEx(targetid, fstr);
}
return true;
}
Hope that helps..
Re: Ban -
nezo2001 - 28.12.2014
okai but why this
PHP код:
PlayerInfo[targetid][Banned] = 1;
Re: Ban -
gdkparadox - 28.12.2014
Quote:
Originally Posted by nezo2001
okai but why this
PHP код:
PlayerInfo[targetid][Banned] = 1;
|
You need to switch that to whatever sort of "database" your using if you want to, so you can have a /banlist or something, if not, just delete that line or
Код:
// PlayerInfo[targetid][Banned] = 1;
Re: Ban -
nezo2001 - 28.12.2014
Thank you but you forget a small thing
PHP код:
if(sscanf(params,"u", targetid)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /ban [id]");
Don't forget it again because this will make the command only work on the player who typed it

.
Thank you man
Re: Ban -
nezo2001 - 28.12.2014
another thing how to unban the player
without a command anyway ?
Re: Ban -
gdkparadox - 28.12.2014
Quote:
Originally Posted by nezo2001
Thank you but you forget a small thing
PHP код:
if(sscanf(params,"u", targetid)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /ban [id]");
Don't forget it again because this will make the command only work on the player who typed it  .
Thank you man 
|
Oh yea, how did I forget that ahah sorry, but yeah, no problem.
Re: Ban -
gdkparadox - 28.12.2014
Quote:
Originally Posted by nezo2001
another thing how to unban the player
without a command anyway ?
|
I don't know how to make a command to do that, all I know is that if you want to unban someone, you have to delete the said line from samp.ban