samp.ban unbanning
#1

Hey guys, I know it's a lame question, but I never actually worked with file functions, so I really got no clue

I know its possible to unban an IP address using /rcon unbanip
but if I want to unban using a name instead of IP ?
Shall I use like File:ban = fopen: blah blah blah
and then strfind(ban, playername, false) ?
Sorry for the "newbie" question but I never actually used it :/
Reply
#2

Huh?you need unban cmd?
Reply
#3

PHP код:
CMD:unban(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] >= 2)
    {
        new 
string[128];
        if(
isnull(params)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /unban [playername]");
        if( 
PlayerInfo[playerid][pBan] >= )
        {
            
PlayerInfo[playerid][pBan] = 0;
            print(
"OnPlayerOfflineLogin: Variables saved properly");
            
format(string128"[ADMIN] %s (IP:%s) was unbanned by %s."paramsPlayerInfo[playerid][pIP], GetPlayerNameEx(playerid));
            
SendStaffMessage(COLOR_RED,string);
            new 
yearmonth,day;
            
getdate(yearmonthday);
            new 
playa[MAX_PLAYER_NAME];
            
GetPlayerName(playeridplayaMAX_PLAYER_NAME);
            
format(stringsizeof(string), "[ADMIN] %s : was unbanned by %s."paramsplaya);
            
SendStaffMessage(COLOR_REDstring);
        }
        else
        {
            
SendClientMessageplayeridCOLOR_WHITE"Not a banned account or no such account was found!" );
        }
    }
    return 
1;

Reply
#4

Quote:
Originally Posted by darkdevil
Посмотреть сообщение
PHP код:
CMD:unban(playeridparams[])
{
    if(
PlayerInfo[playerid][pAdmin] >= 2)
    {
        new 
string[128];
        if(
isnull(params)) return SendClientMessage(playeridCOLOR_WHITE"USAGE: /unban [playername]");
        if( 
PlayerInfo[playerid][pBan] >= )
        {
            
PlayerInfo[playerid][pBan] = 0;
            print(
"OnPlayerOfflineLogin: Variables saved properly");
            
format(string128"[ADMIN] %s (IP:%s) was unbanned by %s."paramsPlayerInfo[playerid][pIP], GetPlayerNameEx(playerid));
            
SendStaffMessage(COLOR_RED,string);
            new 
yearmonth,day;
            
getdate(yearmonthday);
            new 
playa[MAX_PLAYER_NAME];
            
GetPlayerName(playeridplayaMAX_PLAYER_NAME);
            
format(stringsizeof(string), "[ADMIN] %s : was unbanned by %s."paramsplaya);
            
SendStaffMessage(COLOR_REDstring);
        }
        else
        {
            
SendClientMessageplayeridCOLOR_WHITE"Not a banned account or no such account was found!" );
        }
    }
    return 
1;

-__-
No, it wouldn't work since im missing half of your functions, anyways, got it working alone
thx for trying (?)
Reply
#5

You have to unban the IP first through the command "unbanip".

Then, you will have to reload the bans so the said IP is removed from the file, the command to do that is "reloadbans".
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)