SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 22/11/2011, 03:26 PM   #1
sim_sima
Gangsta
 
Join Date: Mar 2010
Posts: 697
Reputation: 26
Default Timeban

Hi guys. I have a /ban <playerid> <reason>.
What is the fastest way to modify it into /ban <playerid> <time> <reason>?
Basically, i am asking how to make time based ban, so that i for example can ban a player for one hour and then he is automatically unbanned after one hour.

Thank you.
sim_sima is offline   Reply With Quote
Old 23/11/2011, 12:18 PM   #2
sim_sima
Gangsta
 
Join Date: Mar 2010
Posts: 697
Reputation: 26
Default Re: Timeban

So nobody knows how to make a time based ban system?
I already have the /ban <playerid> <reason>.
Only thing that needs to be added is the <time>.
I know the GetTime and GetDate functions, and those could do the job.
But if there is an easier way, please tell me. Thanks.
sim_sima is offline   Reply With Quote
Old 23/11/2011, 01:07 PM   #3
MP2
Godfather
 
MP2's Avatar
 
Join Date: Jan 2011
Location: England
Posts: 6,236
Reputation: 1004
Default Re: Timeban

I have a file with a number in that is increased every minute. When you ban players you set their 'unbantime', which will be the value in the file when the ban should expire. If you wanted the <time> parameter to be hours

unban_time = value_in_file += hours*60
__________________
Owner and developer of Mike's Cops and Robbers.

Click here to visit our site and find out more. Click here to view trailers.
Enter referral code SAMPFORUM after registering for a $5000 starting bonus!
MP2 is offline   Reply With Quote
Old 23/11/2011, 01:24 PM   #4
sim_sima
Gangsta
 
Join Date: Mar 2010
Posts: 697
Reputation: 26
Default Re: Timeban

Thank you both.
MP2; I already thourght about that idea, and you just confirmed it for me. Thank you.
sim_sima is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Include] FoxBan -|- TimeBan System PSPgamer_10 Includes 36 16/03/2014 01:24 PM
Timeban command - Help! Striker_Moe Help Archive 8 08/09/2009 11:10 AM


All times are GMT. The time now is 06:34 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.