Perfect Posted August 19, 2012 Share Posted August 19, 2012 Hi All, I make this gate but its not working. mgate1 = createObject ( 989, 864.5, -3973, 2.2999999523163, 0, 0, 267.99499511719 ) function opengate(thePlayer) local id = getElementModel (thePlayer) moveObject ( mgate1, 1000, 859.79998779297, -3972.6000976563, 2.0999999046326 ) end addCommandHandler("mopen", opengate) function closegate(theplayer) local id = getElementModel (thePlayer) moveObject ( mgate1, 1000, 864.5, -3973, 2.2999999523163 ) end addCommandHandler("mclose", closegate) Meta "Perfect" name="gates" version="1.2.0" type="script"/> Link to comment
albers14 Posted August 19, 2012 Share Posted August 19, 2012 mgate1 = createObject ( 989, 864.5, -3973, 2.2999999523163, 0, 0, 267.99499511719 ) function opengate(thePlayer) local id = getElementModel (thePlayer) moveObject ( mgate1, 1000, 859.79998779297, -3972.6000976563, 2.0999999046326 ) end addCommandHandler("mopen", opengate) function closegate(thePlayer) -- thePlayer not theplayer local id = getElementModel (thePlayer) moveObject ( mgate1, 1000, 864.5, -3973, 2.2999999523163 ) end addCommandHandler("mclose", closegate) Script should work and had no problem unless that it couldnt gain the element model in the last function because you used theplayer in function and thePlayer in model. Link to comment
Perfect Posted August 19, 2012 Author Share Posted August 19, 2012 lol, only . ok can you tell me how to do this for admins only ? Link to comment
Guest Guest4401 Posted August 19, 2012 Share Posted August 19, 2012 isObjectInACLGroup E.g: if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)),aclGetGroup"Admin") then Link to comment
Tete omar Posted August 19, 2012 Share Posted August 19, 2012 lol, only . ok can you tell me how to do this for admins only ? local accName = getAccountName(getPlayerAccount(source)) if isObjectInACLGroup("user."..accName, aclGetGroup("Admin")) then -- your code Link to comment
Perfect Posted August 19, 2012 Author Share Posted August 19, 2012 Oh wait, that still not working, there is no gate and i put that server side or client side ? Link to comment
Tete omar Posted August 19, 2012 Share Posted August 19, 2012 Oh wait, that still not working, there is no gate and i put that server side or client side ? ofc server side Link to comment
Perfect Posted August 19, 2012 Author Share Posted August 19, 2012 ok, ok and why that still not working ? Link to comment
Flaker Posted August 19, 2012 Share Posted August 19, 2012 What about debugscript? And give full code... Link to comment
Perfect Posted August 19, 2012 Author Share Posted August 19, 2012 Debug WARNING: Script 'gates/gates.lua' is not encoded in UTF-8. Loading as ANSI... WARNING: Loading script failed: gates\gates.lua:1: unexpected symbol near '(' Fullcode gates.lua mgate1 = createObject ( 989, 864.5, -3973, 2.2999999523163, 0, 0, 267.99499511719 ) function opengate(thePlayer) local id = getElementModel (thePlayer) moveObject ( mgate1, 1000, 859.79998779297, -3972.6000976563, 2.0999999046326 ) end addCommandHandler("mopen", opengate) function closegate(thePlayer) local id = getElementModel (thePlayer) moveObject ( mgate1, 1000, 864.5, -3973, 2.2999999523163 ) end addCommandHandler("mclose", closegate) meta.xml "Sterick" name="gates" version="1.2.0" type="script"/> Link to comment
sockz Posted August 19, 2012 Share Posted August 19, 2012 nothing wrong with it, and those errors are false. Use /restart gates Link to comment
Perfect Posted August 20, 2012 Author Share Posted August 20, 2012 nothing wrong with it, and those errors are false.Use /restart gates i try many times but still not working Link to comment
TAPL Posted August 20, 2012 Share Posted August 20, 2012 Your problem not in the code the problem from the encoded change it to UTF-8 and it will work just fine. Link to comment
Perfect Posted August 20, 2012 Author Share Posted August 20, 2012 Your problem not in the codethe problem from the encoded change it to UTF-8 and it will work just fine. What is uncoded ? and how to change it to UTF-8 ? Link to comment
TAPL Posted August 20, 2012 Share Posted August 20, 2012 Your problem not in the codethe problem from the encoded change it to UTF-8 and it will work just fine. What is uncoded ? and how to change it to UTF-8 ? with Notepad: File > Save As > Encoding: UTF-8 > Save done. Link to comment
Perfect Posted August 20, 2012 Author Share Posted August 20, 2012 Thank You So Much!!! 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