[MTA]revenngeR Posted October 4, 2009 Share Posted October 4, 2009 This is on the client side local vehicle = getPedOccupiedVehicle ( getLocalPlayer() ) triggerServerEvent ( "invisibility", getLocalPlayer(), vehicle ) This on server side function invisibility () local vehicle = getPedOccupiedVehicle ( getLocalPlayer() ) --get your current vehicle local driver = getVehicleOccupant ( vehicle ) setElementAlpha ( vehicle, 0 ) setElementAlpha ( driver, 0 ) end addEvent ( "invisibility", true ) addEventHandler ( "invisibility", getRootElement(), invisibility ) On debugscript it doesnt show anything and on the server console either Link to comment
robhol Posted October 4, 2009 Share Posted October 4, 2009 Erm.. how do you suppose getLocalPlayer() should work server-side? Link to comment
DakiLLa Posted October 4, 2009 Share Posted October 4, 2009 i think it should be like this: function invisibility ( vehicle ) local driver = getVehicleOccupant ( vehicle ) setElementAlpha ( vehicle, 0 ) setElementAlpha ( driver, 0 ) end addEvent ( "invisibility", true ) addEventHandler ( "invisibility", getRootElement(), invisibility ) you are sending 'vehicle' from client side to the server, so..i've added 'vehicle' argument in server side function. Link to comment
Dark Dragon Posted October 4, 2009 Share Posted October 4, 2009 if debug doesn't tell you anything theres a huge chance that your scripts aren't even loaded. getLocalPlayer() will be nil server side. add some outputs and debug it yourself this way. 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