Welcome to Onforum.net - Web and gaming resource community

Join us now to get access to all our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, and so, so much more. It's also quick and totally free, so what are you waiting for?
  • elefant.ro%20

Quests /Python maintenance Quest

Vanilla

Elite
Elite
Credits
1,073
code_language.lua:
quest maintenance begin
state start begin
when 40003.use with pc.is_gm () begin
say_title ("Maintenance System")
say ("What do you want to do?")
say ("") local s = select ("Start maintenance system", "End maintenance system", "Cancel") if s == 1then
mysql_query ("UPDATE account.account SET account.status = 'SHUTDOWN' WHERE status = 'OK' and account.login NOT IN (SELECT mAccount FROM common.gmlist);")
command ("shutdown" ifend)



s == 2 then
mysql_query ("UPDATE account.account SET account.status = 'OK' WHERE status = 'SHUTDOWN' and account.login NOT IN (SELECT mAccount FROM common.gmlist);")
end
if s == 3 then
return
end
end
end
 

[RaffaeL]

Administrator
Administrator
Credits
9
code_language.lua:
quest maintenance begin
state start begin
when 40003.use with pc.is_gm () begin
say_title ("Maintenance System")
say ("What do you want to do?")
say ("") local s = select ("Start maintenance system", "End maintenance system", "Cancel") if s == 1then
mysql_query ("UPDATE account.account SET account.status = 'SHUTDOWN' WHERE status = 'OK' and account.login NOT IN (SELECT mAccount FROM common.gmlist);")
command ("shutdown" ifend)



s == 2 then
mysql_query ("UPDATE account.account SET account.status = 'OK' WHERE status = 'SHUTDOWN' and account.login NOT IN (SELECT mAccount FROM common.gmlist);")
end
if s == 3 then
return
end
end
end

Nice, but a little bit messed up. Here's corrected version(your quest, my edit):
code_language.lua:
quest maintenance begin
    state start begin
        when 40003.use with pc.is_gm () begin
        say_title ("Maintenance System")
        say ("What do you want to do?")
        say ("")
        local s = select ("Start maintenance system", "End maintenance system", "Cancel")
            if s == 1 then
                mysql_query ("UPDATE account.account SET account.status = 'SHUTDOWN' WHERE status = 'OK' and account.login NOT IN (SELECT mAccount FROM common.gmlist);")
                command ("shutdown")
            end
            if s == 2 then
                mysql_query ("UPDATE account.account SET account.status = 'OK' WHERE status = 'SHUTDOWN' and account.login NOT IN (SELECT mAccount FROM common.gmlist);")
            end
            if s == 3 then
                return
            end
        end
    end
end
 

Similar threads


About us

OnForum.net is a resource community where aspiring webmasters and designers can share content and receive support for a wide variety of software platforms. We are working every day to make sure our community is one of the best.

PARTNERS

Follow us

We recommend

Doza de Blog
Top

Dear User!

We found that you are blocking the display of ads on our site.

Please add it to the exception list or disable AdBlock.

The advertises that you'll see aren't intrusive they just help us to keep the community alive

If you don't want to see those ads just buy an upgrade.

Thank you for understanding!