Perfect Posted August 19, 2012 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"/>
albers14 Posted August 19, 2012 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.
Perfect Posted August 19, 2012 Author Posted August 19, 2012 lol, only . ok can you tell me how to do this for admins only ?
Guest Guest4401 Posted August 19, 2012 Posted August 19, 2012 isObjectInACLGroup E.g: if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(thePlayer)),aclGetGroup"Admin") then
Tete omar Posted August 19, 2012 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
Perfect Posted August 19, 2012 Author Posted August 19, 2012 Oh wait, that still not working, there is no gate and i put that server side or client side ?
Tete omar Posted August 19, 2012 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
Perfect Posted August 19, 2012 Author 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"/>
sockz Posted August 19, 2012 Posted August 19, 2012 nothing wrong with it, and those errors are false. Use /restart gates
Perfect Posted August 20, 2012 Author Posted August 20, 2012 nothing wrong with it, and those errors are false.Use /restart gates i try many times but still not working
TAPL Posted August 20, 2012 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.
Perfect Posted August 20, 2012 Author 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 ?
TAPL Posted August 20, 2012 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.
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