Jump to content

draobrehtom

Members
  • Posts

    98
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by draobrehtom

  1. @Simple01 you can switch forum theme at the bottom forum, near the block Contact Us.
  2. for _, vehicle in ipairs ( getElementsByType ( "vehicle" ) ) do -- For every vehicle do the following... if isEmpty( vehicle ) then -- Getting standart handlings local tempVehicle = createVehicle(getElementModel(vehicle), 0, 0, -3) local tempHandling = getVehicleHandling(tempVehicle) for prop,value in pairs(tempHandling) do setVehicleHandling(vehicle, prop, value) end destroyElement(tempVehicle) resetVehicleIdleTime ( vehicle ) -- Reset the vehicle's idle time respawnVehicle ( vehicle ) end end outputDebugString("Cars Respawned") outputChatBox("#ADFF2F[PDB Allert]#FFFFFF All vehicles have been re-spawned" , root, 0, 255, 0, true) end,respawn*1000,1)
  3. Use /debugscript 3 to find errors and test your code. I gave you right algorithm, maybe problem in indexing tempHandling table - I not test it. for prop,value in pairs(tempHanding) do setVehicleHandling(vehicle, prop, value) end
  4. for _, vehicle in ipairs ( getElementsByType ( "vehicle" ) ) do -- For every vehicle do the following... if isEmpty( vehicle ) then -- Getting standart handlings local tempVehicle = createVehicle(getElementModel(vehicle), 0, 0, -3) local tempHandling = getVehicleHandling(tempVehicle) for _, property in ipairs(tempHanding) do setVehicleHandling(vehicle, property, tempHandling[property]) end destroyElement(tempVehicle) resetVehicleIdleTime ( vehicle ) -- Reset the vehicle's idle time respawnVehicle ( vehicle ) end end outputDebugString("Cars Respawned") outputChatBox("#ADFF2F[PDB Allert]#FFFFFF All vehicles have been re-spawned" , root, 0, 255, 0, true) end,respawn*1000,1)
  5. Hi guys. One year ago I was start developing "Police radio hotkey system" based on original police radio sound from gta. In GTA:SA it's based on parts of different sound packs, relative to player situation (state). Now, I will found my resource and don't want do develop it (have no time), but You can. Usage. For example, I ride on black Bravura vehicle form East Los Santos and shoot to people - POLICE RADIO: "37 in" + "dark" + "four door" + " + "suspect last seen" + "east Los Santos". And so on. As you understood, you can use this sound to make custom radio message for other cops on your server by binding buttons or making some Radial System, Idk. This code not so clear, but you can understand him. Fork project, develop him and do what you want. Script is very easy, but I spent some time to found this police sounds. List of sounds. Full code on Github: https://github.com/draobrehtom/mta-police-radio
  6. duplicate. please remove this topic
  7. And you can get position of the dummy's light. It's will be more easy to get custom coordinates for every vehicle. getVehicleComponentPosition taillights2headlights2 taillightsheadlights
  8. Чувак, гугл или поиск в папке гта используй. И в следующий раз используй содержательное название для темы. "Помогите!!!" - никуда не годится.
  9. Or replace your corrupted file http://www.mediafire.com/download/0ye28f02395gj80/timecyc.dat
  10. http://www.mediafire.com/download/0ye28f02395gj80/timecyc.dat Замени неисправный файл.
  11. Thank's for the helping answer (misc elements). I was did that by this way: local mis_x, mis_y, mis_z = getVehicleComponentPosition(occupiedVehicle, "misc_c", "world") local miss_x, miss_y, miss_z = getVehicleComponentPosition(occupiedVehicle, "misc_b", "world") mis_x,mis_y,mis_z = mis_x - miss_x, mis_y - miss_y, mis_z - miss_z local matrix = getElementMatrix(occupiedVehicle) x = 0 * matrix[1][1] + 0 * matrix[2][1] + 4 * matrix[3][1] + 1 * matrix[4][1] y = 0 * matrix[1][2] + 0 * matrix[2][2] + 4 * matrix[3][2] + 1 * matrix[4][2] z = 0 * matrix[1][3] + 0 * matrix[2][3] + 4 * matrix[3][3] + 1 * matrix[4][3] createProjectile(g_P, 19, x, y, z, 200, nil, 0, 0, 0, mis_x, mis_y, mis_z) Thank you guys, I hope our discussion and this code will help other people.
  12. "velocity" in projectile it is a vector direction flying of rocket and I need this direction from turret direction. I think it work's in such way (projectile).
  13. Ok, and which will be "up/down" in my vector velocity createprojectile, uh?
  14. No, because you have a two axis Eulers in 3D World in Turret. We need to convert it to 3 axis, but how? I will try to find formula.
  15. File Explorer - View - Filename Extensions - Check.
  16. How to get difference (x,y,z - vehicle rotation) and (x,y - turret rotation)?
  17. local lrotX, lrotY = getVehicleTurretPosition(occupiedVehicle) -- Compute local 3D vector from bearing and elevation math local tVx,tVy,tVz = math.cos(lrotX) * math.cos(lrotY), math.sin(lrotX) * math.cos(lrotY), math.sin(lrotY) -- Compute global 3D vector from above -- Create projectile (for vehicle, with x, y, z start position, xr, yr, zr for rotation vector, xvel, yvel, zvel for velocity vector) I need send rocket from turret of S.W.A.T vehicle. For that I need xvel, yvel, zvel.
  18. Maybe it's will be better, if I told you, that I need this vector for setting velocity of createProjectile. Have you any ideas?
  19. I don't know why you are want separate resource. Did you know, that all clients scripts runs manually on each client. It's like you have a many of copies clients scripts on each pc players (which runs when client connect to server) and one server script on a your server?
  20. You can do it locally in one rerource. I think you want something like this. If player connect, check is it a new player, then start function (or trigger event, like in example above), which teleport your player into a villa, set them a random world dimension not equals to 0 for all elements (heli, ped) including a player. Then you can warp ped into a heli and set event onClientVehicleEnter, in handler function check if it this heli for this player and so on.
  21. 3laa33, man, I told you about it in the beginning. God..
  22. Can you post all code with the part getResourceFromName and also give a names of your two resources? Maybe it's a typo error, you know.
×
×
  • Create New...