Andres99907 Posted June 6, 2020 Share Posted June 6, 2020 I'm very noob at scripting :' (, but i did this: (It's a script for the Imponte Deluxo of GTA Online) Serverside: function deluxe ( player ) local vehicle = getPedOccupiedVehicle(player) if isElement(vehicle) then if getVehicleDoorOpenRatio(vehicle,5) > 0 then setVehicleDoorOpenRatio(vehicle,5,0,ms) setVehicleDoorOpenRatio(vehicle,4,0,ms) setVehicleDoorOpenRatio(vehicle,0,0,ms) else setVehicleDoorOpenRatio(vehicle,5,1,ms) setVehicleDoorOpenRatio(vehicle,4,1,ms) setVehicleDoorOpenRatio(vehicle,0,1,ms) end end end addEvent( "deluxo", true ) addEventHandler( "deluxo", resourceRoot, deluxe) This function puts the Deluxo on flying mode, works fine if i use addCommandHandler instead addEventHandler... Clientside: triggerServerEvent ( "deluxo", resourceRoot) this is the triggerServerEvent that is activated by BindKey (Shift) but i got at line2 on serverside: Bad Argument @ ´getPedoccupiedvehicle´ [Expected Ped at Argument 1, got nil] I need help Link to comment
Moderators IIYAMA Posted June 6, 2020 Moderators Share Posted June 6, 2020 function deluxe ( ) local player = client addEventHandler doesn't work the same as the addCommandHandler. Use the predefined variable `client`, to get the player that did activate the event. 1 Link to comment
Andres99907 Posted June 6, 2020 Author Share Posted June 6, 2020 2 minutes ago, IIYAMA said: function deluxe ( ) local player = client addEventHandler doesn't work the same as the addCommandHandler. Use the predefined variable `client`, to get the player that did activate the event. Thx man! it has helped me a lot! 1 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