Saving banned player
#1

Hello,

So i want know how should i made When i use ban command on playerid, this ban will be saved on Scriptfiles and when player try rejoin he will be banned ?

Код:
CMD:ban(playerid, params[])
{
        if(pInfo[playerid][Level] < 2) return SCM(playerid, red, "You are not allowed to use this command!");
		{
            new PID; 
            new reason[64]; 
            new str[128]; 
            new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME]; 
            GetPlayerName(playerid, Adminname, sizeof(Adminname)); 
            GetPlayerName(PID, Playername, sizeof(Playername));
            if(sscanf(params, "us[64]", PID,reason)) return SCM(playerid, red, "[USAGE]: /ban (playerid) (reason)"); 
            if(!IsPlayerConnected(PID))
            return SCM(playerid, -1, "[ERROR]: Currect player is not found!");

            format(str, sizeof(str), "%s has been banned by Administrator %s | %s", Playername, Adminname, reason);
            SCMToAll(-1, str); 
            Ban(PID);

        }
        return 1;
}
Reply
#2

Make a new enum
PHP код:
enum pInfo
{
    
pBanned
}
new 
PlayerInfo[MAX_PLAYERS][pInfo]; 
and OnPlayerConnect
PHP код:
public OnPlayerConnect(playerid)
{
     if(
PlayerInfo[playerid][pBanned] == 1)
    {
                
SCM(playeridCOLOR_DEFINE"What you message should be");
                
Kick(playerid);
    }
    return 
1;

Also add that enum in all locations of the ini writer
Reply
#3

ok i make it all but when i ban playerid he rejoin and he is not banned
Reply
#4

Edit the command also
Reply
#5

Quote:
Originally Posted by Gotham
Посмотреть сообщение
Edit the command also
Well read my first post above! How to do that...
Reply
#6

BUMP!
Reply
#7

Show me the enum, PATH where you save the things and forward_LoadUserData
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)