OnPlayerConnect Ban kicker.
#1

i scripted a account ban kicker but didn't works.can help me solve to make this works.
And i put this under my OnPlayerConnect
pawn Код:
if(PlayerInfo[playerid][pBan] >= 1)
    {
        new id,string2[124], string1[125];
        format(string2, sizeof(string2), "SERVER:You Have been kicked.Reason:Account Still Banned.");
        SendClientMessage(playerid,COLOR_RED,string2);
        format(string1, sizeof(string1), "SERVER:%s Have been kicked.Reason:Account Still Banned.", GetPlayerNameEx(id));
        SendClientMessageToAll(COLOR_RED,string1);
        Kick(id);
        return 1;
    }
Reply
#2

Probably because the 'pBan' variable is set to 0, are you getting a value from the player file first?
Reply
#3

This may work..
pawn Код:
if(PlayerInfo[playerid][pBan] == 1)
    {
        new string[128];new pname[MAX_PLAYER_NAME];
        SendClientMessage(playerid,COLOR_RED,"SERVER: You have been kicked! Reason: Your account is still banned.);
        format(string, sizeof(string), "
SERVER: %s Have been kicked. REASON: Account Still Banned.", GetPlayerName(playerid,pname,sizeof(pname)));
        SendClientMessageToAll(COLOR_RED,string);
        Kick(playerid);
    }
Reply
#4

first get the players name variable then you have to do BanEx(); then Kick the player with the message or just

get names and bla bla and kick then it should work perfectly or there must be something wrong with the ini write or

yours which can't get to the ban oh almost forgot If(FoundInBanDatabase) you have varible write your ban database

name in it to search for bans so it detects if the ban is running or not and if player is ban on your command give

pBan[playerid] = 1; hope it helped you
Reply
#5

Quote:
Originally Posted by Bicentric
Посмотреть сообщение
Probably because the 'pBan' variable is set to 0, are you getting a value from the player file first?
Yeah im getting value from user file.
Reply
#6

Quote:
Originally Posted by Rajat_Pawar
Посмотреть сообщение
This may work..
pawn Код:
if(PlayerInfo[playerid][pBan] == 1)
    {
        new string[128];new pname[MAX_PLAYER_NAME];
        SendClientMessage(playerid,COLOR_RED,"SERVER: You have been kicked! Reason: Your account is still banned.);
        format(string, sizeof(string), "
SERVER: %s Have been kicked. REASON: Account Still Banned.", GetPlayerName(playerid,pname,sizeof(pname)));
        SendClientMessageToAll(COLOR_RED,string);
        Kick(playerid);
    }
I add that in OnPlayerConnect and the result is it doesnt works.
Or Any idea to put it in other place ?
Reply
#7

Where does the players file get loaded?
Do this after the players file is loaded.
Reply
#8

Quote:
Originally Posted by Nirzor
Посмотреть сообщение
first get the players name variable then you have to do BanEx(); then Kick the player with the message or just

get names and bla bla and kick then it should work perfectly or there must be something wrong with the ini write or

yours which can't get to the ban oh almost forgot If(FoundInBanDatabase) you have varible write your ban database

name in it to search for bans so it detects if the ban is running or not and if player is ban on your command give

pBan[playerid] = 1; hope it helped you
Can give me an example? Because i'm still confused about what you typed.
Reply
#9

Quote:
Originally Posted by cosbraa
Посмотреть сообщение
Where does the players file get loaded?
Do this after the players file is loaded.
you mean load from this?

pawn Код:
public LoadUser_data(playerid,name[],value[])
{
    INI_Int("Password",PlayerInfo[playerid][pPassword]);
    INI_Int("Cash",PlayerInfo[playerid][pCash]);
    INI_Int("Level",PlayerInfo[playerid][pLevel]);
    INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
    INI_Int("Kills",PlayerInfo[playerid][pKills]);
    INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
    INI_Int("Ban",PlayerInfo[playerid][pBan]);
    INI_Int("Warnings",PlayerInfo[playerid][pWarns]);
    INI_Int("SkinID", PlayerInfo[playerid][pSkin]);
    return 1;
}
Reply
#10

Quote:
Originally Posted by zionx08
Посмотреть сообщение
Yeah im getting value from user file.
By this I mean you're probably checking if they're banned before you're actually loading their data, therefore the value is set to 0.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)