little help with banning
#2

By using the RCON command "banip {ip}", the same happens when you use Ban or BanEx(). You should remove that (if you don't want the samp.ban).
Then, if you want to ban someone using the value in that userfile; check if the player is banned (by reading the userfile, the "Banned" data), kick the player

EDIT:
You are using sscanf wrong. You must not use "i" (which stands for "integer") for the string, you should use "s". Also, add the max size of that string;

pawn Код:
new ID; //?
new string[25];

sscanf(params, "us[25]", ID, string);
EDIT 2:
I see you're using "AdminLevelName()". I suggest you don't use that (I assume you're using if statements and formats to get the admin level name). Check this out:

pawn Код:
/*
Admin level 0: Player
Admin level 1: Mod
Admin level 2: Admin
Admin level 3: Owner
*/

new AdmLvlName[][] =
{
    "Player", //level 0
    "Mod", //level 1
    "Admin", //level 2
    "Owner" //level 3
};

//Then, to show the admin level;

printf("Name of admin level 0: %s", AdmLvlName[0]);
printf("Player ID %d has admin level: %d", 0, AdmLvlName[pInfo[playerid][AdminLevel]);

//You could eventually use this:
stock AdminLevelName(playerid) return AdmLvlName[pInfo[playerid][AdminLevel]];
//or:
#define AdminLevelName(%0) AdmLvlName[pInfo[%0][AdminLevel]
Reply


Messages In This Thread
little help with banning - by LeXuZ - 13.11.2014, 17:28
Re: little help with banning - by Kwarde - 13.11.2014, 17:31
Re: little help with banning - by LeXuZ - 13.11.2014, 17:54

Forum Jump:


Users browsing this thread: 1 Guest(s)