SA-MP Forums Archive
Saving banned player - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Saving banned player (/showthread.php?tid=617705)



Saving banned player - Hunud - 25.09.2016

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;
}



Re: Saving banned player - Gotham - 25.09.2016

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


Re: Saving banned player - Hunud - 25.09.2016

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


Re: Saving banned player - Gotham - 25.09.2016

Edit the command also


Re: Saving banned player - Hunud - 25.09.2016

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


Re: Saving banned player - Hunud - 25.09.2016

BUMP!


Re: Saving banned player - Gotham - 25.09.2016

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