Flameeagle Posted September 12, 2015 Posted September 12, 2015 Server: function call() triggerClientEvent(getRootElement(), "chdg",getRootElement(), shy1) end addEventHandler("onResourceStart",getRootElement(),call) Client: function hydra(hydname) if getElementType(getRootElement(hydname))=="vehicle" then local hyd=getRootElement() setVehicleAdjustableProperty(hydname,5000) end end addEvent("chdg",true) addEventHandler("chdg",getRootElement(),hydra) when the above codes are executed, i get an error in debugscript 3 that: ERROR: Server triggered clientside event chdg, but event is not added Clientside. please help me! Paid Scripter/Developer worked behind a lot of RPG gamemode scripts, and scripts of varied functionality. Also working actively with Non-MTA related scripts especially in Python, websites, backend coding, as well as Server management and stuffs like those. PS: I'm better with Python than LUA-MTA. my discord: FlaMe#0704
Flameeagle Posted September 12, 2015 Author Posted September 12, 2015 i have now started using onClientResourceStart instead of onResourceStart, but still, the thrusters of the hydras done turn.. Paid Scripter/Developer worked behind a lot of RPG gamemode scripts, and scripts of varied functionality. Also working actively with Non-MTA related scripts especially in Python, websites, backend coding, as well as Server management and stuffs like those. PS: I'm better with Python than LUA-MTA. my discord: FlaMe#0704
JR10 Posted September 12, 2015 Posted September 12, 2015 Why are you using getRootElement? setVehicleAdjustableProperty's only parameter is the vehicle element. Business System viewtopic.php?f=108&t=35797 Notepad++ Syntax Highlighting & Auto Completion viewtopic.php?f=91&t=76726 SQLite Tutorial viewtopic.php?f=148&t=38203
Flameeagle Posted September 14, 2015 Author Posted September 14, 2015 finally i decided to give up on this script.. Paid Scripter/Developer worked behind a lot of RPG gamemode scripts, and scripts of varied functionality. Also working actively with Non-MTA related scripts especially in Python, websites, backend coding, as well as Server management and stuffs like those. PS: I'm better with Python than LUA-MTA. my discord: FlaMe#0704
Markeloff Posted September 14, 2015 Posted September 14, 2015 I don't think using 'call' as a function name is correct because call is already there. function adjustHydras() for i,veh in ipairs(getElementsByType ( "vehicle" )) do if getElementModel(veh) == 520 then setVehicleAdjustableProperty (veh,5000) end end end addEventHandler( "onClientResourceStart", resourceRoot, adjustHydras) Some people want it to happen, some wish it would happen, others make it happen.
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