#1

Please anyone explain for me how to make ban command and please don't give me link to a filterscripts.
Thank you !
Reply
#2

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
Код:
/rcon ban PLAYERID
or
Код:
/rcon banip PLAYERIP
It's that simple.
Reply
#3

I want to make a command for admins
PHP код:
if(PlayerInfo[playerid][pAdmin] != 0)



Anyone ??
Reply
#4

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..
Reply
#5

okai but why this
PHP код:
PlayerInfo[targetid][Banned] = 1
Reply
#6

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;
Reply
#7

Thank you but you forget a small thing
PHP код:
if(sscanf(params,"u"targetid)) return SendClientMessage(playeridCOLOR_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
Reply
#8

another thing how to unban the player
without a command anyway ?
Reply
#9

Quote:
Originally Posted by nezo2001
Посмотреть сообщение
Thank you but you forget a small thing
PHP код:
if(sscanf(params,"u"targetid)) return SendClientMessage(playeridCOLOR_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.
Reply
#10

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)