K4stic Posted December 24, 2013 Posted December 24, 2013 1. How to calculate percents( % ) ? I mean i have number a = 100 and number b = 20 the number b must be the % or a and return result ex. 80 2. what wrong i do here? Serverside: triggerClientEvent( root, "JobSystem.CreateCustomBlip", root, x, y, 18, 18, "images/medic.png" ) ClientSide: addEvent("JobSystem.CreateCustomBlip", true) addEventHandler("JobSystem.CreateCustomBlip", root, function ( x, y, w, h, pach ) exports.customblips:createCustomBlip( x, y, w, h, path, 400 ) end ) ERROR saying Serverside trigger Clientside event JobSystem.CreateCustomBlip, but event is not added Clientside
Tete omar Posted December 24, 2013 Posted December 24, 2013 1- ( CurrentValue / MaxValue ) * 100. E.g: ( 30 / 50 ) * 100 = 60%. 2- When did you use triggerClientEvent? (Show us the whole code).
K4stic Posted December 24, 2013 Author Posted December 24, 2013 marker = createMarker(1000, 1250.1, 13.6, "cylinder", 2, 25, 60, 95, 125) the data on trigger getting from marker used onClientResourceStart any else need? i think that wasen't need
Tete omar Posted December 24, 2013 Posted December 24, 2013 So you used, onClientResourceStart > triggerServerEvent > triggerClientEvent? Show us your code please.
K4stic Posted December 24, 2013 Author Posted December 24, 2013 Why the fuck you need it? you need the marker or any other shit? function start() marker = createMarker(1000, 1250.1, 13.6, "cylinder", 2, 25, 60, 95, 125) triggerClientEvent( root, "JobSystem.CreateCustomBlip", root, 1000, 1250.1, 18, 18, "images/medic.png" ) end addEventHandler("onResourceStart", resourceRoot, start )
Tete omar Posted December 24, 2013 Posted December 24, 2013 First of all, be respectful, otherwise, i won't help you. This explains why you get that error .. the serverside starts before clientside, so you'll have to use: onClientResourceStart, then use triggerServerEvent, and then use triggerClientEvent and pass the marker cords as the extra arguments as you already did.
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