• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

[TFS 1.0] "/closeserver shutdown" not working.

Jack Parsons

Member
Joined
Mar 8, 2016
Messages
32
Reaction score
12
Location
São Paulo State, Brazil
My "accounts" table has no group_id column, only page_access (And changing it to 5 makes no difference). Nevertheless, the "players" table has a group_id column, but changing it to 6 renders the player useless (Since the terminal states that such group_id does not exist). I've tried 3 and this one worked. Now I can use /up, /down and other "commands". But, when I input "/closeserver shutdown", nothing happens. The server keeps running, and I need to shut it down in order to save the houses and other stuff (As it was instructed to me in my previous thread).

Here's closeserver.lua:

Code:
function onSay(cid, words, param)
    local player = Player(cid)
    if not player:getGroup():getAccess() then
        return true
    end

    if player:getAccountType() < ACCOUNT_TYPE_GOD then
        return false
    end
 
    if param == "shutdown" then
        Game.setGameState(GAME_STATE_SHUTDOWN)
    else
        Game.setGameState(GAME_STATE_CLOSED)
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Server is now closed.")
    end
    return false
end

And in talkactions.xml:

Code:
<talkactions>
    <talkaction words="/closeserver" separator=" " script="closeserver.lua" />
</talkactions>
 
My "accounts" table has no group_id column, only page_access (And changing it to 5 makes no difference). Nevertheless, the "players" table has a group_id column, but changing it to 6 renders the player useless (Since the terminal states that such group_id does not exist). I've tried 3 and this one worked. Now I can use /up, /down and other "commands". But, when I input "/closeserver shutdown", nothing happens. The server keeps running, and I need to shut it down in order to save the houses and other stuff (As it was instructed to me in my previous thread).

Here's closeserver.lua:

Code:
function onSay(cid, words, param)
    local player = Player(cid)
    if not player:getGroup():getAccess() then
        return true
    end

    if player:getAccountType() < ACCOUNT_TYPE_GOD then
        return false
    end

    if param == "shutdown" then
        Game.setGameState(GAME_STATE_SHUTDOWN)
    else
        Game.setGameState(GAME_STATE_CLOSED)
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Server is now closed.")
    end
    return false
end

And in talkactions.xml:

Code:
<talkactions>
    <talkaction words="/closeserver" separator=" " script="closeserver.lua" />
</talkactions>
You want to change column type to 5 in accounts, not group_id.
Change accounts type to 5, and players group_id to 3.
 
Back
Top