• Log in or sign up for an account here: https://www.sythe.org/login

::tempban (1-10hours) help!

Dragonflame

Newcomer
Joined
Sep 16, 2009
Sythe Gold
0
Messages
3
Yeh guys im Head administrator Dragonflame from falconpking and i wanna know how to make ::tempban (1-10 hours) if someone can help me, please help.
 
Ban them, then unban in 1-10 hours.

Simple enough.
 
well i don't think SMF supports doing stuff like that. I may be wrong but your best bet is yeah to ban and unban them.
 
why do u even code if you don't know how to make something simple like this...
 
Smooth listen, this isn't simple to code, i don't know how to add the hours in the ::tempban command. That's why i ask it. If u think it is so easey why don't u tell me then? I'm working on a bigg server so if i would ban and then unban, i would make mistakes.
 
Wrong section.
why do u even code if you don't know how to make something simple like this...
It's not easy at all, lol. Would either involve an ingame process timer, which would most likely cause major lag, or make an SQL based temp ban system, both of which I won't go over. User Rune-Server or some shit for that.
 
Wrong section.

It's not easy at all, lol. Would either involve an ingame process timer, which would most likely cause major lag, or make an SQL based temp ban system, both of which I won't go over. User Rune-Server or some shit for that.

It's very easy timers don't lag it is things like constant gfx or respawning objects that are already there.


I am geussing SQL is far to hard for you.
However it could read the time from your computer everytime you start your server.

I shall provide something simpler

60 seconds = 1 minute
60 minute = 1 hour
24 hours = 1 day

We need atleast 4 voids and 4 valuables
1 for every valuable we it is very simple

public void minutetimer() {
if (timeseconds == 60) {
timeseconds = 0;
timeminutes = +1;
server.java (banedminutes = -1);
}}
public void hourtimer() {
if (timeminutes == 60) {
timeminutes = 0;
timehours = +1;
server.java (banedhours = -1);
}}
public void resettimer() {
if (timehours == 24) {
timeseconds = 0;
timeminutes = 0;
timehours = 0;
}}

you add this under boolean process()
minutetimer();
hourtimer();
resettimer() ;
timeseconds = +1;

then you make it save the time to a notepad so when you restard your server it pick up the timer where it last stopted.
Now that you have global time it is very easy to add a punichsment system based on that,all you do is add a void like this and put it inside the hour or minute void depending on what amount u require.
Add a notepad that writes the names down of timed bans,use bans as an example it's nothing big.

This void for example disconects the player if timedban = set to true
this happends when an admin banns him be sure to make timedban save to the characters server file or it will reset when he gets kicked
when its true and he trys to login it wil show a message above the login box stating he has to wait the amount u entered - the amount the time afetr hes ban has passed.

public void timedban() {
if (timedban == true){
sendloginmessage ("Sorry but you are banned +"bannedhours". +"Bannedminutes" more please come back after.)
ignorelogin();
disconect();
}}

after that create a command where you enter ban player and enter (timeban username hours minutes)
combine ban and setitem commands to create this!

I know it is evry roughly explained it is also not copy and paste i jut coded this without any server files so most valuables are rong.
 
Runescape Gamblingrunescape gambling
Back
Top