Stanley Sathler Posted December 7, 2011 Share Posted December 7, 2011 -- Author: Stanley Sathler -- Date: 12/06/2011 -- Function: set an uniform for the player marca_troca_roupa_1 = getElementByID("marca_troca_roupa_1") -- Get the marker in map file using_uniform = false function SetUniform(player, in_dimension) if (using_uniform ~= true) then addPedClothes(player, "vest", "vest", 0) -- Set the shirt addPedClothes(player, "worktrcamogrn", "worktr", 2) -- Set the trouser addPedClothes(player, "bask1problk", "bask1", 3) -- Set the shoes addPedClothes(player, "beretblk", "beret", 16) -- Set the hat using_uniform = true end end addEventHandler("onMarkerHit", marca_troca_roupa_1, SetUniform) Hi again, guys. I am noob in Lua, thats very hard to me. :\ Well... the function of my code is change an especified clothes when a player enter on a marker. Ok, is working. But the function is called before I enter on a marker (2 meters before, approximately). I want call the function when I enter on the marker (size 1), and not before (near of the mark). Thank you for attention, Stanley Sathler. Link to comment
myonlake Posted December 7, 2011 Share Posted December 7, 2011 Well, the problem is GTA. You could make two markers in each other, the other one a little bigger and the other one smaller and the smaller one would be invinsible. So when you enter the marker, it should work just in the perimeter as how you want it. Link to comment
Stanley Sathler Posted December 7, 2011 Author Share Posted December 7, 2011 myonlake, it's a nice idea. But my marker have 1 of size. And I can't create a marker with less than 1. x_x Link to comment
Xeno Posted December 7, 2011 Share Posted December 7, 2011 Why dont you have a go at making the markers IN the script instead of a map file? Link to comment
Castillo Posted December 7, 2011 Share Posted December 7, 2011 Xeno, creating markers using a map file or via createMarker function is the same. Link to comment
Stanley Sathler Posted December 7, 2011 Author Share Posted December 7, 2011 Xeno, creating markers using a map file or via createMarker function is the same. And is more easy. Link to comment
Al3grab Posted December 8, 2011 Share Posted December 8, 2011 you could make the small marker with 0.5 size Link to comment
Stanley Sathler Posted December 9, 2011 Author Share Posted December 9, 2011 Al3Grab, I tried but the script doesn't work. Link to comment
unknooooown Posted December 9, 2011 Share Posted December 9, 2011 Al3Grab, I tried but the script doesn't work. Post your code and any errors. And make sure you write ' 0.5 ' not ' 0,5 ' Link to comment
Stanley Sathler Posted December 10, 2011 Author Share Posted December 10, 2011 Wafamde, there's not an output with errors in console if is it that you want. The code just doesn't work when I enter on marker. And I used 0.5. ----- EDIT ----- I tried use createMarker() and the code work now. Well, I'll use createMarker then. It will be more hard, but is the unique method, I guess. Thank all, guys. 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