SnoopCat Posted May 15, 2011 Share Posted May 15, 2011 hey hello this is a script i have and i want to put some smoke functions for the players to trow smoke into their cars... well i tried alot but is not working i hope u can help me... Server Side part: addEvent("premiumbuysmoke", true) addEventHandler("preiumbuysmoke", getRootElement(), function() if isPedInVehicle(source) then local targetPlayerName = getPlayerFromName ( source ) local x, y, z = getElementPosition( source ) local car = getPedOccupiedVehicle( source ) local ramp = createObject ( 2780, 0, 0, 0, true, 0 ) attachElements ( ramp, vehicle, 0.0, -5.255, 0, 0, 0, true, 45, 118 ) outputChatBox("*Premium: "..getPlayerName(source).." Ur Car Get Smoked!",getRootElement(),0,255,0) end end) and now Client Side part i made: elseif (source == GUIEditor_Button[2]) then triggerServerEvent ("premiumbuysmoke", getLocalPlayer()) Note*: This is not all the scritp is just a part of it... Link to comment
karlis Posted May 15, 2011 Share Posted May 15, 2011 you have typo in line2, its "premiumbuysmoke". not "preiumbuysmoke" also delete line 5, no use for it. EDIT: your params for attach is incorrect, theres a boolean where rotZ should be, and 2 more params with no use. EDIT2: also createObject requires no booleans, but 1more rotation value. Link to comment
SnoopCat Posted May 15, 2011 Author Share Posted May 15, 2011 now the outputchatbox is working but i didnt get smoke on my car Link to comment
karlis Posted May 15, 2011 Share Posted May 15, 2011 is it the right obj, and did you fix the arguments? also vehicle argument was incorrect. pay more attention on typos. addEvent("premiumbuysmoke", true) addEventHandler("premiumbuysmoke", getRootElement(), function() if isPedInVehicle(source) then local x, y, z = getElementPosition( source ) local car = getPedOccupiedVehicle( source ) local ramp = createObject ( 2780, 0, 0, 0, 0, 0, 0 ) attachElements ( ramp, car, 0, -5.255, 0, 0, 45, 118 ) outputChatBox("*Premium: "..getPlayerName(source).." Ur Car Got Smoked!",getRootElement(),0,255,0) end end) 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