[MTA]revenngeR Posted October 4, 2009 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
robhol Posted October 4, 2009 Posted October 4, 2009 Erm.. how do you suppose getLocalPlayer() should work server-side? Do NOT PM ME for help unless invited. - New MTA Script Editor Scripting help "etiquette": understandable language, relevant code (ALL code if unsure), [Lua] tags, error messages with line numbers. Super simple stuff.
DakiLLa Posted October 4, 2009 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.
Dark Dragon Posted October 4, 2009 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. Loads of fun for free! Also a lot of fun for free!
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