ID:169181
 
Hi i want to make a timer on my mute code. could some one give me some idea on making the timer on my mute code. Making sure if the player logs off and comes back the timer should tick. Timer should stop when the player go off line.

Give me some ideas.. XD

Dtroys
sleep()
In response to DeathAwaitsU
DeathAwaitsU wrote:
sleep()

wouldn't you think this would work?

proc
Ticker(Ticker=10)
while(Ticker)
world<<Ticker
--Ticker
sleep(10)

is there any way i could use this help to make a timer mute on IP if the player logs in with a different player or key.?
In response to DeathAwaitsU
mob
verb
Mute(mob/M in world)
var/mutetime = input("How long would you like to mute them for?","Minutes",)as num
if(!M.admin == 0)
M.mute = 1
M<<"You have been muted for [mutetime] minutes!"
world<<"[src] has muted [M] for [mutetime] minutes!"
sleep(M.mutetime*100)//i think thats the minute calculations...lol might wanna test it though
M.mute = 0



mob/var
mute = 0
mutetime
In response to Dtroys
mob
verb
Mute(mob/M in world)
var/mutetime = input("How long would you like to mute them for?","Minutes",)as num
if(!M && M.admin == 0)
M.mute = 1
Mute+=M.client.address
M<<"You have been muted for [mutetime] minutes!"
world<<"[src] has muted [M] for [mutetime] minutes!"
sleep(M.mutetime*100)//i think thats the minute calculations...lol might wanna test it though
M.mute = 0
Mute-=M.client.address



proc/MuteCheck(mob/M as mob)
var/savefile/F = new("mute.sav")
var/checking
F["[M.client.address]"] >> checking
if(M.client.address == checking)
M.mute = 1
..()
Should work