Bean666 Posted February 10, 2021 Posted February 10, 2021 (edited) 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 February 10, 2021 by Shaman123
Bean666 Posted February 10, 2021 Author Posted February 10, 2021 (edited) 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 February 10, 2021 by Shaman123
Moderators Tut Posted February 10, 2021 Moderators Posted February 10, 2021 Closing as it appears resolved.
Recommended Posts