Temp Ban System
#1

Hello earthlings. My issue isn't that I need a temp ban system, or don't know to make loading/saving system, etc, I'm just stuck on the actual command. I am stumped with the time banning.

I want to be able to ban players with the following options,

[minutes] [hours] [days] [months] [years]

And if one is "0" then it just won't be added. For instance if I want to ban someone for 2 days, and 50 minutes I would do the syntax in-game like so,

/tban 50 2 0 0

Thanks.
Reply
#2

Use this then? https://sampforum.blast.hk/showthread.php?tid=164359
Reply
#3

Quote:

My issue isn't that I need a temp ban system

I don't want a link/script I just want to know how to do it.
Reply
#4

Then check one of these scripts' code and come back with what you don't understand! Always give it a try before posting.
Reply
#5

I've looked at many how-ever I am still stumped with minutes, days, months % years. Most(released anyway) only have days, or hours.
Reply
#6

Okay, you would do it like this.
pawn Код:
new time;
time = gettime(); // this is the current time stored in seconds passed since 1st January 1970
time += 604800; // 604800 is 7 days in seconds. We are adding this to the current time because we want ban the user for a week
// this goes under i.e. OnPlayerConnect
if(gettime() < TempBanTime(playerid)) // this is just an example, TempBanTime is a variable from enum which contains player's data
{
         Kick(playerid);
}
Reply
#7

Alright, thank you for replying, how-ever how would I calculate the minutes,hours,days,months and years in seconds? I can't just put it an array...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)