.:HyPeX:. Posted February 13, 2014 Share Posted February 13, 2014 Guys got a problem with this code, first the command always turns off, and if i use the state to turn it on force, it doesnt do anything, according to the admin panel, the setting is still false, and admin cannot modify it. EDIT//: Aparently, the function alone without state will turn to current state, if i force it to true, then it will always display ON without state. function ToggleAutomatic(player,cmd,state) local account = getPlayerAccount(player) local accountName = getAccountName(account) if (isObjectInACLGroup("user." ..accountName, aclGetGroup("Admin"))) then if getPlayerCount() >= 3 then if state then if state == "true" or state == "false" then if state == "true" then set("AutomaticPodium", "true") set("TurnPodium", "true") stateturn = "ON" elseif state == "false" then stateturn = "OFF" set("AutomaticPodium", "false") set("TurnPodium", "false") end outputChatBox("#FF0000Automatic Podium was turn ".. stateturn, player,255,255,255,true) else outputChatBox("#FF0000Please enter a valid value! [true,false]", player, 255,255,255,true) end else if get("AutomaticPodium") == "true" then set("AutomaticPodium", "true") set("TurnPodium", "true") outputChatBox("#FF0000Automatic Podium was turn ON", player,255,255,255,true) else set("AutomaticPodium", "false") set("TurnPodium", "false") outputChatBox("#FF0000Automatic Podium was turn OFF", player,255,255,255,true) end end else if get("TurnPodium") == "false" then outputChatBox("#FF0000There must be at least 3 players online for script to work!", player, 255,255,255,true) outputChatBox("#FF0000Script will automatically turn on when there are 3 players online.", player, 255,255,255,true) set("TurnPodium", "true") elseif get("TurnPodium") == "true" then outputChatBox("#FF0000Script will no longer automatically start when there are more than 3 players online", player, 255,255,255,true) set("TurnPodium", "false") end end else outputChatBox("#FF0000This is only for admins!", player, 255,255,255,true) end end addCommandHandler("PodiumTurn", ToggleAutomatic,false) Meta: <meta> <info name="HyPeX's Podium Script" description="" author="HyPeX" type="script" version="1.0.0"/> <file src="fonts/podium.ttf" /> <script src="ganadores.lua" type="client" /> <script src="ganadores_s.lua" type="server" /> <export function="setPodiumPlayers" /> <settings> <setting name="*AutomaticPodium" value="false" friendlyname="On/Off Podium automatic" group="" accept="true,false" examples="true,false" desc="Dont touch this, use the script command." /> <setting name="*TurnPodium" value="false" friendlyname="On/Off Podium automatic" group="" accept="true,false" examples="true,false" desc="Dont touch this, use the script command." /> </settings> </meta> Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now