Jump to content

pa3ck

Members
  • Posts

    1,141
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by pa3ck

  1. Hi guys. As far as I know, whenever I use the addEventHandler the syntax is this (this is the exact code I'm using): addEventHandler('onResourceStart', resRoot, gpsSystem ) BUT it wont start with this code. But if I put this: addEventHandler('onResourceStart', resRoot, gpsSystem() ) It is working. Why is that? Also, in debugscript I'm getting a warning when I use the brackets WARNING: gps_system\c_gps.lua:220 Bad argument @ 'addEventHandler' [Expected function at argument 3, got none] Am I this stupid or what? Whenever I used an event or command handler I put the function name without brackets.
  2. I'm not sure what you mean by that now, but thats the exact function I have in my resource. Its not even working with this. Any idea? Any help would be higly appreciated!
  3. Hmm. I tried this: distance = getDistanceBetweenPoints3D(mx, my, mz, px, py, pz) guiSetText(gpsDistance, math.round(distance, 3)) but its not working...
  4. The last, last question > . < I made a button for showing the distance between the car and marker using getDistanceBetweenPoints3D, but its showing me a long-long number. How can I set it to show me like 12442.2? So 1 decimal?
  5. Thank you! I got it working now, I really appreciate your help mate.
  6. Thank you very much for your quick help! I'm a noob scripter ( yet ! ), so dont judge me The last question I will be askin ( today ) is, that I want to play a 3D sound whenever the driver hits the marker, I use the playSound3D. I've done that, its working, no problem. But I want to "attach" this sound to the driver, so if he leaves the marker the sound will be "following him", if you know what I mean. How could I do that? First I tought I would do it with onClientRender, so it will update the getElementPosition(), but it would play the sound over and over again...
  7. Maaan! I love you! Thanks And what about using a variable in buttons? Like showing the real time in a GUI button? Is that possible? Or do I have to make a script like ' if time == 13:20 then guiSetText... '?
  8. Thanks for the quick reply guys! I just made a mistake there, I meant the getPedOccupiedVehicleSeat, because, I want the GUI to be used by the vehicle drivers.
  9. Hi guys, I'm making a GPS system, but I just can't make the script show a variable in the guiCreateButton... Is there any way to do that? I tried with the guiSetText, no success. The thing I want to do is, to show the real time in a GUI button. Also, I will bind the GPS to a specified button, and if the client is in a vehicle and is driver he will be able to open the GUI, othwerwise the GUI wont show up. But, the problem is that getPedOccupiedVehicle is server function and the GUI is client. Any idea how can I get this done? Any help would be highly appreciated!
×
×
  • Create New...