Jump to content

Help in something


diegofkda

Recommended Posts

Maybe this will sound stupid, but I want to know how to add an event with getPedOccupiedVehicle...

  
vehicle = getPedOccupiedVehicle (getLocalPlayer()) 
function damageproof() 
   setVehicleDamageProof (vehicle, true) 
end 
addEventHandler ("onClientResourceStart", root, damageproof) 

Idk if is that correct, but it is just an example, (it isnt correct yes I know) it isnt working, it is a "bad argument"...

the same thing happens with all, so i think that "vehicle" needs something to work with events, so I want to know what it needs.

Edited by Guest
Link to comment
  
function damageproof() 
vehicle = getPedOccupiedVehicle (getLocalPlayer()) 
   setVehicleDamageProof (vehicle, true) 
end 
addEventHandler ("onClientPlayerVehicleEnter, getLocalPlayer(), damageproof) 
  
  
 

BTW: in original script you forgot add string: root = getRootElement()

Link to comment
  
gme = getLocalPlayer() 
  
function damageproof() 
local vehicle = getPedOccupiedVehicle (gme) 
   setVehicleDamageProof (vehicle, true) 
end 
addEventHandler ("onClientPlayerVehicleEnter", getLocalPlayer(), damageproof) 
  

Link to comment
  
function damageproof() 
vehicle = getPedOccupiedVehicle (getLocalPlayer()) 
   setVehicleDamageProof (vehicle, true) 
end 
addEventHandler ("onClientPlayerVehicleEnter, getLocalPlayer(), damageproof) 
  
  
  
 

BTW: in original script you forgot add string: root = getRootElement()

root is already defined as a keyword in MTA:

MTA Wiki:

Note: all resources have a predefined global variable called root that has the root element as value. The variable exists server side as well as client side.

Link to comment
  
function damageproof() 
vehicle = getPedOccupiedVehicle (getLocalPlayer()) 
   setVehicleDamageProof (vehicle, true) 
end 
addEventHandler ("onClientPlayerVehicleEnter, getLocalPlayer(), damageproof) 
  
  
  
  
 

BTW: in original script you forgot add string: root = getRootElement()

root is already defined as a keyword in MTA:

MTA Wiki:

Note: all resources have a predefined global variable called root that has the root element as value. The variable exists server side as well as client side.

LOL i failed "onClientResourceRestart", its just Start xD!

Ok ty all

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...