Management Karbust 4913 Posted July 22, 2014 Management Share Posted July 22, 2014 Hi guys I'm here with a problem in a function To ban I have this: pc.setqf("ban1dia", get_time()+1*60*60*24) But if I want retire the ban before the times up how I can do? I have this to take retire the ban: pc.setqf("ban1dia", 0) pc.setqf("ban2dias", 0) pc.setqf("ban7dias", 0) pc.setqf("ban15dias", 0) pc.setqf("ban30dias", 0) pc.setqf("banperma", 0) mysql_query("INSERT INTO log.log_desban_nickname (id, gm, player, razao, data) VALUES ('', '"..name.."', '".. player_name .."', '".. razao .."', '"..data1.."');") set_quest_state("bans","ban") end And this is the login: when login begin if get_time() < pc.getqf("ban1dia") then return elseif get_time() > pc.getqf("ban1dia") then say("Personagem Banida durante 1 dia") say("[DELAY value; 1000]. . . . .[/DELAY]") command("quit") end The problem is: I can't retire the ban :S Someone can help me please? Thanks to all Link to comment Share on other sites More sharing options...
Active Member ATAG 311 Posted July 22, 2014 Active Member Share Posted July 22, 2014 If you set the "ban1dia" to 0, then get_time() > 0 always will be true. Try when login begin if get_time() < pc.getqf("ban1dia") then say("Personagem Banida durante 1 dia") say("[DELAY value; 1000]. . . . .[/DELAY]") command("quit") end 1 Link to comment Share on other sites More sharing options...
Frozen 189 Posted July 22, 2014 Share Posted July 22, 2014 If you set the "ban1dia" to 0, then get_time() > 0 always will be true. Try when login begin local ban1dia = pc.getqf("ban1dia") if get_time() < ban1dia then return elseif ban1dia ~= 0 and (get_time() > ban1dia) then say("Personagem Banida durante 1 dia") say("[DELAY value; 1000]. . . . .[/DELAY]") command("quit") end if is in that way it will still be wrong becuase ur making if get_time() < ban1dia then the ban is in going on and if get_time() > ban1dia the ban stopps. so he has to make like this if get_time() > ban1dia then return elseif ban1dia ~= 0 and (get_time() < ban1dia) then say("Personagem Banida durante 1 dia") say("[DELAY value; 1000]. . . . .[/DELAY]") command("quit") 1 Link to comment Share on other sites More sharing options...
Management Karbust 4913 Posted July 22, 2014 Author Management Share Posted July 22, 2014 Any of those two works :S With those if is ban works like isn't ban Link to comment Share on other sites More sharing options...
Active Member ATAG 311 Posted July 22, 2014 Active Member Share Posted July 22, 2014 Ok, i did some logical mistake. Above code edited and must work. ban1dia is the timestamp, when ban will expire. If current timestamp is lowerthen ban1dia, ban is active... Link to comment Share on other sites More sharing options...
Management Karbust 4913 Posted July 22, 2014 Author Management Share Posted July 22, 2014 I'm not at the computer now, a friend help me but I don't test already, he use the game.set_event_flag to set the bans Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now