Jump to content

arezu

Members
  • Posts

    446
  • Joined

  • Last visited

Everything posted by arezu

  1. This gets vehicleID, position and rotation of all vehicle in the .map file: local spawnpoint = getElementsByType("spawnpoint") for i = 1, #spawnpoint do local spawn = spawnpoint[i] local vehicleID = getElementData(spawn, "vehicle") local posX = getElementData(spawn, "posX") local posY = getElementData(spawn, "posY") local posZ = getElementData(spawn, "posZ") local rotX = getElementData(spawn, "rotX") local rotY = getElementData(spawn, "rotY") local rotZ = getElementData(spawn, "rotZ") end
  2. getDistanceBetweenPoints3D or getDistanceBetweenPoints2D
  3. FPS - Frames per second, meaning 1 second. And you want FPS counter to update 20 times a second, but show how many frames per 1 second a player has? I tried doing that just now, however the fps jumps too much, which i think is because of time lag somewhere.
  4. all the events, and function except onResourceRestart, which can be made by making a custom command to restart resources, or by checking the time difference between onResourceStop and onResourceStart. local oldZone = "" local oldCity = "" addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() addEventHandler("onClientRender", getRootElement(), checkZone) end) function checkZone() local posX, posY, posZ = getElementPosition(getLocalPlayer()) local zone = getZoneName(posX, posY, posZ, false) local city = getZoneName(posX, posY, posZ, true) if(zone ~= oldZone)then if(oldZone ~= "" and oldCity ~= "")then triggerEvent("onZoneLeave", getLocalPlayer(), oldZone, oldCity) end oldZone = zone oldCity = city triggerEvent("onZoneEnter", getLocalPlayer(), zone, city) end end function isPlayerLogged(player) local account = getPlayerAccount(player) if(account == false)then return false end return (not isGuestAccount(account)) end
  5. isVehicleOnGround doesn't work correctly anyways...
  6. arezu

    help ASCII..

    use one of these. function isASCII(text) for i = 1, #text do local byte = text:byte(i) if(byte < 33 or byte > 126)then return false end end return true end function isASCII(text) -- used "\" before '"' as an escape char, otherwise it wont work. local asciiTable = "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~" for i = 1, #text do if not string.find(text, asciiTable[i], 1, true) then return false end end return true end
  7. thats the problem, dont use bauss toolbox. Use somebody else's mapping tools.
  8. or, use another toolbox that works correctly..
  9. How did you get your camera that far from the vehicle? mod?
  10. "This video has been removed by the user. Sorry about that."
  11. search for onPlayerReachCheckpoint in race folder
  12. maybe this: http://www.multiupload.com/ZSQLI9NM4L ?
  13. /debugscript 3 shows client sided errors, serverlog does not. Also, isn't mysql_connect only server sided?
  14. RCG. search for it and you will find it.
  15. You forgot function() here: addEventHandler ( "onClientRender", root, local x1, y1 = AbsoluteToRelativ2( 959,246 ) local x2, y2 = AbsoluteToRelativ2( 956,243 ) local x3, y3 = AbsoluteToRelativ2( 943,217 ) local x4, y4 = AbsoluteToRelativ2( 939,213 ) dxDrawText( "textQuit", x1, y1, 1224, 264, tocolor(0,0,0,255),0.6,"bankgothic","left","top",false,false,false) dxDrawText( "textQuit", x2, y2, 1224, 261, tocolor(255,0,0,255),0.6,"bankgothic","left","top",false,false,false) dxDrawText( "textJoin", x3, y3, 1211.0, 235.0,tocolor(0,0,0,255),0.6,"bankgothic","left","top",false,false,false) dxDrawText( "textJoin", x4, y4, 1207.0,231.0,tocolor(0,255,0,255),0.6,"bankgothic","left","top",false,false,false) end) so write function() after root, .. like this: addEventHandler ( "onClientRender", root, function() local x1, y1 = AbsoluteToRelativ2( 959,246 ) local x2, y2 = AbsoluteToRelativ2( 956,243 ) local x3, y3 = AbsoluteToRelativ2( 943,217 ) local x4, y4 = AbsoluteToRelativ2( 939,213 ) dxDrawText( "textQuit", x1, y1, 1224, 264, tocolor(0,0,0,255),0.6,"bankgothic","left","top",false,false,false) dxDrawText( "textQuit", x2, y2, 1224, 261, tocolor(255,0,0,255),0.6,"bankgothic","left","top",false,false,false) dxDrawText( "textJoin", x3, y3, 1211.0, 235.0,tocolor(0,0,0,255),0.6,"bankgothic","left","top",false,false,false) dxDrawText( "textJoin", x4, y4, 1207.0,231.0,tocolor(0,255,0,255),0.6,"bankgothic","left","top",false,false,false) end)
  16. Thats how the script i wrote to you is working.. or is it not?
  17. it does work client sided.. type in meta i think its like that, and then you can use it client sided.
  18. they are created with a tool called "Bauss' toolbox".
  19. I dont understand what you mean. Do you mean that for example if on your screen your text is in the middle of the screen, and you also want it to be in the middle of the screen for all resolutions? if not, draw a picture or something of an example.
  20. What about if there are 2 vehicles close to the hit player and the one that didn't hit is closer to the one that did hit? As you probably know by now, vehicle's position is the pivot position of the vehicle (most of the cars have it in the middle). So, distance between vehicle hitting from the front is longer than vehicle hitting from the side. Also, remember, vehicle size varies. Yes, but its still pretty accurate because if the vehicle that was closer did not hit the vehicle, then its unlikely that it got damaged, which would mean that the vehicle that was further away and hit the "mouse" would be counted as the one that hit it. And still, using getElementBoundingBox is and calculating distance with rotation in 3d would still not be accurate because the vehicles are not rectangles, so the way i used is probably the best way without destroying ones brain.
  21. did you see my other post? i put a download link to my script that works the same way. Download it and use it... In my script i check which players gets damaged between each 50ms' and compare distances between the players that got damaged to the length of both vehicles being compared.
  22. since its server sided, getPlayerSerial needs the player element... so: getPlayerSerial(source) instead of getPlayerSerial()
  23. 10-50$ for a map related script, which usually takes like a few mins(If its a DM/Race map).. totally worth it.
  24. The player doesn't get damaged when crashing with vehicle.
×
×
  • Create New...