wesleywillems17 Posted January 17, 2017 Share Posted January 17, 2017 Hi all, I'm busy with a trucker job resource for my server. But i have a problem with hiding the marker and blip when the player get's out of the truck. The markers are created at the client-side but i have no idea how i could send the marker and blip to the server-side (to hide). Client-side: addEventHandler("onClientVehicleExit", root, function(thePlayer) local Truck = getPedOccupiedVehicle ( thePlayer ) if Truck and getElementModel(Truck) == 403 then end end ) Server-side: function HideBlipMarker ( thePlayer ) setElementVisibleTo ( *Marker, thePlayer, false ) setElementVisibleTo ( *Blip, thePlayer, false ) end Can somebody help me please Link to comment
LoPollo Posted January 17, 2017 Share Posted January 17, 2017 1 hour ago, wesleywillems17 said: The markers are created at the client-side That means they do not exist in the server. You can destroy (or hide them) using events like onClientPlayerVehicleExit, onClientVehicleExit and so on Otherwise rethink your script Good luck Link to comment
wesleywillems17 Posted January 17, 2017 Author Share Posted January 17, 2017 Ow yeah.. i didn't think of that. Link to comment
Moderators IIYAMA Posted January 18, 2017 Moderators Share Posted January 18, 2017 I recommend to create mission markers and blips clientside. Less bandwidth for players that do not do the mission, less element managing required serverside and less problems with: setElementVisibleTo Which has to be called again for new joining players. But do what suits you best! 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