Ban system.
#1

Hi all.I try to do my self ban system like that:

Код:
/ban [playerid] [time] [reason]
Ok,I ban my self for 5 min.Then i come to server,and i get message you are banned for 5min,and it no change,it always be 5min.Then maybe need to set timer or something
Reply
#2

Maybe you need to show us the command.
Reply
#3

Indeed - without code we can't do much.
Reply
#4

Here when player gets banned:

pawn Код:
new Query[90];
format(Query, sizeof(Query),"UPDATE `playerdata` SET `BanTime` = '%d' WHERE `Name` = '%s'",banTime*60,PlayerName(pID));
mysql_query(Query);
Kick(pID);
Reply
#5

You need to get current time when player banned and + how long you want it to be banned
Save it to file or MySql (i think you use MySql)and when player connects you check is the current time (time at connect) bigger than a banned time
Reply
#6

I don't know if this will work but try it
pawn Код:
//When the player is banned put this:
new Hour, Minute, Second, BannedTime;
gettime(Hour, Minute, Second);
#pragma unsed Second
#pragma unsed Minute
BannedTime = Hour + 24; //This will make the player banned for 1 day, (P.S: change the 24 with your [time] variable)
//And finally save "BannedTime" and when player attempts to log in into his banned account, load his saved data, check if BannedTime is higher than the current server time using gettime. if it's smaller kick the player.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)