Einheit-101 Posted January 14, 2011 Share Posted January 14, 2011 (edited) Hello People, As you can see I am back from the underground . Bad for you? But I have a problem with this script down there. The objective is to "attach" one of the objects (2052, 2053, 2054) to the HEAD of a player (2052,53 and 54 are helmets) but if i type for example "/stahl 2" nothing happens. Thats the way it should work: If u type "/stahl 1" element 2052 will be generated If u type "/stahl 2" element 2053 will be generated If u type "/stahl 3" element 2054 will be generated If u type "/stahl 0" all elements will be destroyed. I think the problems are the arguments, i`ve scripted not for a long time now... helm = nil helmart = nil zahl = nil function stahlhelm() if (zahl ~= nil or zahl ~= 0) then local r = getPedRotation (getLocalPlayer) local px, py, pz = getPedBonePosition(getLocalPlayer, 8) if (zahl == 1) then moveObject (helm, 10, px, py, pz+0.05, 0, 0, 0 ) setElementRotation ( helm, 0, 0, r ) end end end addEventHandler ( "onClientRender", getRootElement(), stahlhelm ) addCommandHandler("stahl", function (player, command, helmart) if helmart == or helmart == nil then outputChatBox ( "Valid numbers are 0,1,2 and 3." ) end if (helmart == 0) then destroyElement(helm) zahl = 0 end if (helmart == 1) then local r = getPedRotation (getLocalPlayer) local px, py, pz = getPedBonePosition(getLocalPlayer, 8) helm = createObject (2052, px, py, pz+0.05, 0, 0, r ) -- tommy zahl = 1 end if helmart == 2 then local r = getPedRotation (getLocalPlayer) local px, py, pz = getPedBonePosition(getLocalPlayer, 8) helm = createObject (2053, px, py, pz+0.05, 0, 0, r ) -- jerry zahl = 1 end if (helmart == 3) then local r = getPedRotation (getLocalPlayer) local px, py, pz = getPedBonePosition(getLocalPlayer, 8) helm = createObject (2054, px, py, pz+0.05, 0, 0, r ) -- officer zahl = 1 end if (helmart > 3) then outputChatBox ( "Valid numbers are 0,1,2 and 3." ) end end) Edited January 14, 2011 by Guest Link to comment
LT Uranus Posted January 14, 2011 Share Posted January 14, 2011 nice to see you einheit i wish i could help you but i am in job right now ( brake ) Link to comment
Einheit-101 Posted January 14, 2011 Author Share Posted January 14, 2011 Way hey, uranus, YOU here?? Link to comment
12p Posted January 14, 2011 Share Posted January 14, 2011 Some DEBUGGING would help a lot Link to comment
Einheit-101 Posted January 14, 2011 Author Share Posted January 14, 2011 *EDIT* Fixed some n00bish errors... Link to comment
Towncivilian Posted January 14, 2011 Share Posted January 14, 2011 nice to see you einheit i wish i could help you but i am in job right now ( brake ) Way hey, uranus, YOU here?? Please try to keep off-topic chatter in PMs or elsewhere. Link to comment
LT Uranus Posted January 14, 2011 Share Posted January 14, 2011 nice to see you einheit i wish i could help you but i am in job right now ( brake ) Way hey, uranus, YOU here?? Please try to keep off-topic chatter in PMs or elsewhere. sorry 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