Jump to content

onVehicleExplode


Bean666

Recommended Posts

function commandyes()
if (getElementData(source, "choosing", true)) then
local theVehicle = getPedOccupiedVehicle ( source)
setElementData(theVehicle, "vehmission", true)
setElementData(source,"choosing", false)
setElementData(source,"mission",true)
outputChatBox("deliver to the destination", source, 255, 0, 0, true)
setElementFrozen(theVehicle, false)
end
end
addEvent("yes", true)
addEventHandler("yes", root, commandyes)

Hi, this is my code, I want to create a deliver system, in this code i set a data on a vehicle that it's on a mission, how do i create if that vehicle explodes its data will be turned to false and also the player's "mission" data to false? and how will I make onVehicleExplode trigger only on the driver's vehicle aka theVehicle, cuz i have it serverside it might affect other vehicles? even those without the data.

i know i'll need

onVehicleExplode 

for that but what functions / what do i do to make it work.

Edited by Shaman123
Link to post
addEventHandler("onClientVehicleExplode", getRootElement(), function()
id = getVehicleID ( source )
  if id == 609 then
if getElementData(source, "vehmission") == true then
if getElementData(localPlayer, "mission") == true then
outputChatBox("test!")
end
end
end
end)

I tried this, but idk if it'll work, will it also send message to people who has the data "mission" to true? or just to the player himself.

edit: just tried with another player, its a no-no, message still shows maybe i need to set the vehicle ownership or smth? but idk how to do that

Edited by Shaman123
Link to post
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...