Jump to content

ps.setqf mais get_time()


Recommended Posts

  • Management

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

raw

raw

Link to comment
Share on other sites

 

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")

 

  • Love 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 4

      Feeding game source to LLM

    2. 0

      Quest 6/7 Problem

    3. 5

      Effect weapons

    4. 0

      [C++] Fix Core Downer Using Negative Number in GM Codes

    5. 3

      Crystal Metinstone

    6. 4

      Feeding game source to LLM

    7. 113

      Ulthar SF V2 (TMP4 Base)

    8. 4

      Feeding game source to LLM

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.