xXGhostXx Posted October 1, 2019 Share Posted October 1, 2019 (edited) Hello guys, I am making an script with onVehicleExplode function. What is problem in my code? Chat box 2 send for player? and how can i send chat box for intended person ? function Test () if getElementData(source,"owner") then outputChatBox("ID: "..getElementData(source, "vehicleID")) end end addEventHandler("onVehicleExplode", getRootElement(), Test) Thanks. Edited October 1, 2019 by xXGhostXx Link to comment
Lachuks Posted October 1, 2019 Share Posted October 1, 2019 Who is your INTENDED person? You should provide player as 2nd arg so it wont be visible to everyone. Link to comment
xXGhostXx Posted October 1, 2019 Author Share Posted October 1, 2019 2 minutes ago, Emix said: Who is your INTENDED person? You should provide player as 2nd arg so it wont be visible to everyone. Intended for example : thePlayer or ... My main problem : chat box in my script 2 times send but i want 1 times send chat box! Link to comment
Lachuks Posted October 1, 2019 Share Posted October 1, 2019 (edited) 8 minutes ago, xXGhostXx said: Intended for example : thePlayer or ... player who owns that vehicle or player who was in a vehicle or smth... if you want to make it global use getRootElement() Sry i dont understand what do ya want Edited October 1, 2019 by Emix Link to comment
xXGhostXx Posted October 1, 2019 Author Share Posted October 1, 2019 2 minutes ago, Emix said: player who owns that vehicle or player who was in a vehicle or smth... if you want to make it global use getRootElement() Sry i dont understand what do ya want Dear, i want when vehicle exploding 1 chat box sended no 2 chat box. Link to comment
VenomOG Posted October 2, 2019 Share Posted October 2, 2019 function Test () if getElementData(source, "Owned") then outputChatBox("Vehicles: "..getElementData(source, "vehicleID").." been has destroyed",getElementData(source,"owner") ,0,0,0) end end addEventHandler("onVehicleExplode", getRootElement(), Test) Add a new data to set the Owner , to playerAccount . Link to comment
Lachuks Posted October 2, 2019 Share Posted October 2, 2019 2 hours ago, Network said: function Test () if getElementData(source, "Owned") then outputChatBox("Vehicles: "..getElementData(source, "vehicleID").." been has destroyed",getElementData(source,"owner") ,0,0,0) end end addEventHandler("onVehicleExplode", getRootElement(), Test) Add a new data to set the Owner , to playerAccount . His problem is that message outputs twice. Link to comment
xXGhostXx Posted October 2, 2019 Author Share Posted October 2, 2019 2 hours ago, Network said: function Test () if getElementData(source, "Owned") then outputChatBox("Vehicles: "..getElementData(source, "vehicleID").." been has destroyed",getElementData(source,"owner") ,0,0,0) end end addEventHandler("onVehicleExplode", getRootElement(), Test) Add a new data to set the Owner , to playerAccount . Please fix it Link to comment
VenomOG Posted October 3, 2019 Share Posted October 3, 2019 (edited) ----- WHERE U SET THE CAR owner if u have a vehicle spawner or what trigger that event with vehicle ID addEvent("onPlayerSpawnVehicle",true) addEventHandler("onPlayerSpawnVehicle",root,function(ID,X,Y,Z,ROT) veh = createVehicle(ID,X,Y,Z,ROT) setElementData(veh, "Owned", "yes") setElementData(veh, "Owner", getAccountName(getPlayerAccount(source))) addEventHandler("onVehicleExplode", veh, function() if getElementData(source, "Owned") == "yes" then outputChatBox("Vehicles: Your vehicle has been has destroyed",getElementData(source,"Owner") ,0,0,0) end end) end) Edited October 3, 2019 by Network 1 Link to comment
xXGhostXx Posted October 3, 2019 Author Share Posted October 3, 2019 Guys what is problem in my code ? function onVehicleRespawn ( exploded ) if ( exploded == true ) then outputChatBox("1") end end addEventHandler ( "onVehicleRespawn", getRootElement(), onVehicleRespawn ) Link to comment
DNL291 Posted October 3, 2019 Share Posted October 3, 2019 I see no erros. Can you explain what you're trying to achieve? Link to comment
VenomOG Posted October 3, 2019 Share Posted October 3, 2019 He's not explaining the error or what hes trying to do. Link to comment
xXGhostXx Posted October 4, 2019 Author Share Posted October 4, 2019 Guys i want healthy function for make Insurance system. Guys please see a my problems : function BimeKamKon () outputChatBox("ee") end addEventHandler("onVehicleExplode", getRootElement(), BimeKamKon) 2 Chat box sended Link to comment
Moderators IIYAMA Posted October 5, 2019 Moderators Share Posted October 5, 2019 13 hours ago, xXGhostXx said: Help me Can you please stop bumping? (3e bump) If you continue, I will have to lock your topic, not matter the reason. Bumping is annoying for everybody that wants to keep track of content they have already checked. Please think about that. Normally I would lock a topic after a 2e bump, but for the people that replied I will leave it open for now. Link to comment
xXGhostXx Posted October 6, 2019 Author Share Posted October 6, 2019 On 04/10/2019 at 11:08, xXGhostXx said: Guys i want healthy function for make Insurance system. Guys please see a my problems : function BimeKamKon () outputChatBox("ee") end addEventHandler("onVehicleExplode", getRootElement(), BimeKamKon) 2 Chat box sended ? Link to comment
Moderators IIYAMA Posted October 6, 2019 Moderators Share Posted October 6, 2019 On 05/10/2019 at 18:43, IIYAMA said: Can you please stop bumping? (3e bump) If you continue, I will have to lock your topic, not matter the reason. Bumping is annoying for everybody that wants to keep track of content they have already checked. Please think about that. Normally I would lock a topic after a 2e bump, but for the people that replied I will leave it open for now. 50 minutes ago, xXGhostXx said: ? Locked Link to comment
Recommended Posts