Jokeℝ1472771893 Posted August 2, 2012 Share Posted August 2, 2012 how to make this cods together ( if player spawn car from 1st marker and whan't to spawn car from 2nd the dirst car destrooyed?) ambulancee= createMarker(2000.921875, -1412.892578125, 16, "cylinder", 2.0, 255, 255,255, 255) setElementVisibleTo(ambulance, root, false) local jobVehicles = {} addEventHandler("onMarkerHit", ambulancee, function(hitElement) if (getElementType(hitElement) ~= "player") then return end local x, y, z = getElementPosition(hitElement) -- Gets the player's position and get his x,y,z coordinates local team = getPlayerTeam(hitElement) -- Gets the player's current team if(isPedInVehicle(hitElement)) then return end if (jobVehicles[hitElement] and isElement(jobVehicles[hitElement])) then destroyElement(jobVehicles[hitElement]) end if (team and getTeamName(team) == "Medic") then setElementVisibleTo(ambulance, root, true) jobVehicles[hitElement] = createVehicle (416, x, y, z, 0, 0, 180) -- creates a infernus at the player coordenates setTimer(warpPedIntoVehicle, 250, 1, hitElement, jobVehicles[hitElement]) -- warps the player inside the vehicle end end ) ambulancee= createMarker(1178.0423583984, -1338.7836914063, 13, "cylinder", 2.0, 255, 255,255, 255) -- Creates a marker in the center of the map setElementVisibleTo(ambulance, root, false) local jobVehicles = {} addEventHandler("onMarkerHit", ambulancee, function(hitElement) if (getElementType(hitElement) ~= "player") then return end local x, y, z = getElementPosition(hitElement) -- Gets the player's position and get his x,y,z coordinates local team = getPlayerTeam(hitElement) -- Gets the player's current team if(isPedInVehicle(hitElement)) then return end if (jobVehicles[hitElement] and isElement(jobVehicles[hitElement])) then destroyElement(jobVehicles[hitElement]) end if (team and getTeamName(team) == "Medic") then setElementVisibleTo(ambulance, root, true) jobVehicles[hitElement] = createVehicle (416, x, y, z, 0, 0, -90) -- creates a infernus at the player coordenates setTimer(warpPedIntoVehicle, 250, 1, hitElement, jobVehicles[hitElement]) -- warps the player inside the vehicle end end ) Link to comment
fmj02 Posted August 2, 2012 Share Posted August 2, 2012 how to make this cods together [/lua] These codes are same, what do you want to make 'together'? Link to comment
Jokeℝ1472771893 Posted August 2, 2012 Author Share Posted August 2, 2012 look coordinates of markers Link to comment
fmj02 Posted August 2, 2012 Share Posted August 2, 2012 And what it changes? Except this: setElementVisibleTo(ambulance, root, false) ambulance variable doesn't exist Link to comment
Castillo Posted August 2, 2012 Share Posted August 2, 2012 @Joker: Your variable name is: "ambulancee", not "ambulance". Link to comment
Jokeℝ1472771893 Posted August 2, 2012 Author Share Posted August 2, 2012 And what it changes? Except this: setElementVisibleTo(ambulance, root, false) ambulance variable doesn't exist nvm about it i was trying to make makrer visible only Medic Link to comment
fmj02 Posted August 2, 2012 Share Posted August 2, 2012 and? If some variable doesn't exist, script will not run. Nevermind, what is wrong with this code? Link to comment
Jokeℝ1472771893 Posted August 2, 2012 Author Share Posted August 2, 2012 i told u when i spawn car from 1st marker then i spawn car from 2nd marker the car still their(spawned in 1st makrer) Link to comment
fmj02 Posted August 2, 2012 Share Posted August 2, 2012 (edited) I don't understand you. Your english is more complicated than dog language.. Second marker shouldn't have same variable as first marker. Edited August 2, 2012 by Guest Link to comment
Jokeℝ1472771893 Posted August 2, 2012 Author Share Posted August 2, 2012 nvm i think Castiol will understand me 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