Jump to content

Smoke problems help plz


Recommended Posts

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...