diegofkda Posted March 28, 2011 Posted March 28, 2011 (edited) 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 March 28, 2011 by Guest "Everything exists, because otherwise nothing would", Bob Marley, 2015.
Castillo Posted March 28, 2011 Posted March 28, 2011 onClientResourceRestart? that event doesn't exist P.S: Why you put getPedOccupiedVehicle out of function? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Moderators Citizen Posted March 28, 2011 Moderators Posted March 28, 2011 And if is in the function, you have to warpPedIntoVehicle before that this code is executed ( you can warp him in "onPlayerJoin" ) The rEvolution is coming ...
Dre-+- Posted March 28, 2011 Posted March 28, 2011 function damageproof() vehicle = getPedOccupiedVehicle (getLocalPlayer()) setVehicleDamageProof (vehicle, true) end addEventHandler ("onClientPlayerVehicleEnter, getLocalPlayer(), damageproof) BTW: in original script you forgot add string: root = getRootElement() Sorry for my bad english(
Kenix Posted March 28, 2011 Posted March 28, 2011 gme = getLocalPlayer() function damageproof() local vehicle = getPedOccupiedVehicle (gme) setVehicleDamageProof (vehicle, true) end addEventHandler ("onClientPlayerVehicleEnter", getLocalPlayer(), damageproof) http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
proracer Posted March 28, 2011 Posted March 28, 2011 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.
diegofkda Posted March 28, 2011 Author Posted March 28, 2011 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 ! Ok ty all "Everything exists, because otherwise nothing would", Bob Marley, 2015.
diegofkda Posted March 28, 2011 Author Posted March 28, 2011 onClientResourceRestart?that event doesn't exist P.S: Why you put getPedOccupiedVehicle out of function? Yes I failed. I put "getPedOccupiedVehicle" out of function because I failed again. I made this question when I was... sleepy lol. "Everything exists, because otherwise nothing would", Bob Marley, 2015.
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