Einheit-101 Posted January 14, 2011 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
LT Uranus Posted January 14, 2011 Posted January 14, 2011 nice to see you einheit i wish i could help you but i am in job right now ( brake )
Einheit-101 Posted January 14, 2011 Author Posted January 14, 2011 *EDIT* Fixed some n00bish errors...
Towncivilian Posted January 14, 2011 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.
LT Uranus Posted January 14, 2011 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
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