Jump to content

Ace_Gambit

Members
  • Posts

    569
  • Joined

  • Last visited

Everything posted by Ace_Gambit

  1. The script above is actually written by Vercetti1010 and not by me . I am kind of busy creating something. But I'll have a look at it when I'm done.
  2. There's a "window" command.
  3. There's a "window" command.
  4. Calm down man. It's not like all samp players suddenly move to mta or something. Most of them probably don't even know a mod like this exists.
  5. Calm down man. It's not like all samp players suddenly move to mta or something. Most of them probably don't even know a mod like this exists.
  6. And we have a lot of skilled people amongst the community. I am sure someone will be able to recreate the gta3 handling.
  7. And we have a lot of skilled people amongst the community. I am sure someone will be able to recreate the gta3 handling.
  8. The problem with rockets is that you can not make them go slower than the minimum travel speed. You will have to come up with something more sophisticated to make them less "smart". The heat seeking rocket for example can track objects as well. What I did in my POW game mode (Surface-to-Surface-Missile) is push the rockets up a little bit by adding force over the z-axis making it travel with a curve. It also does not target the player but an object that is created at the player's current position. This way the player has better change of survival because the rocket will not chase him down but remains to have enough speed to cause damage on impact. EDIT: Correction. What I said about minimum travel speed isn't entirely right. You can make a heat seeking rocket travel at a lower speed by not setting a target. This of course will result in the rocket going from A to B in a straight line (unless you add velocity over the x, y or z-axis). EDIT: Here's a simple example of mounting weapons. It attaches a mini-gun to the passenger side of the car and shoots projectiles. You can attach the gun with "/attachmod" and change projectile type with "/guntype [weaponType]". Like I said it is really basic and all it does is shoot a projectile with velocity over x and y-axis. You will have to make it work for the z-axis as well. In this example the projectiles go in a straight line even when the car's position is slightly tilted. server local guns = { [470] = { ["xPosOffset"] = 1.0, ["yPosOffset"] = 0, ["zPosOffset"] = 0 } } function attachMod(playerSource, commandName) local vehicle = getPlayerOccupiedVehicle(playerSource) local gun = false if (vehicle) then gun = guns[getVehicleID(vehicle)] or false if (gun) then attachElementToElement(createObject(2985, 0, 0, -100, 0, 0, 0), vehicle, gun.xPosOffset, gun.yPosOffset, gun.zPosOffset, 0, 0, 90) setElementData(vehicle, "toggleVehicleWeapon", true) end end end function detachMod(playerSource, commandName) local vehicle = getPlayerOccupiedVehicle(playerSource) if (vehicle) then for _, element in ipairs(getAttachedElements(vehicle)) do destroyElement(element) end setElementData(vehicle, "toggleVehicleWeapon", false) end end addCommandHandler("/attachmod", attachMod, false) addCommandHandler("/detachmod", detachMod, false) client local root = getRootElement() local player = getLocalPlayer() local toggleVehicleWeapon = false local previousTick = getTickCount() local projectileType = 21 function updateVehicleWeapon(source, dataName) if (getElementType(source) == "vehicle" and dataName == "toggleVehicleWeapon") then toggleVehicleWeapon = (getElementData(source, dataName) and isPlayerInVehicle(player)) end end function callbackDataChange(dataName) updateVehicleWeapon(source, dataName) end function callbackVehicleEnter(thePlayer, seat) updateVehicleWeapon(source, "toggleVehicleWeapon") end function callbackRender() if (getControlState("vehicle_fire") and toggleVehicleWeapon) then if (getTickCount() > (previousTick + 150) and previousTick > 0) then fireProjectile() end end end function fireProjectile() local vehicle = getPlayerOccupiedVehicle(player) local gun = false local gX, gY, gZ = 0, 0, 0 local gRotX, gRotY, gRotZ = 0, 0, 0 local pX, pY, pZ = 0, 0, 0 local vX, vY, vZ = 0, 0, 0 local currentLoSOffset = 3.5 local zPosOffset = 1.1 local thrust = 2.0 previousTick = 0 if (vehicle) then if (#getAttachedElements(vehicle) > 0) then gun = getAttachedElements(vehicle)[1] if (gun) then gX, gY, gZ = getElementPosition(gun) gRotX, gRotY, gRotZ = getObjectRotation(gun) pX = gX - math.sin(-math.rad(gRotZ + 90)) * currentLoSOffset pY = gY + math.cos(-math.rad(gRotZ + 90)) * currentLoSOffset pZ = gZ + zPosOffset vX = math.sin (math.rad((gRotZ + 90))) * thrust vY = math.cos(math.rad((gRotZ + 90))) * thrust vZ = 0 createExplosion(pX, pY, pZ, 5, true, -1.0, false) createProjectile(player, projectileType, pX, pY, pZ, 0, nil, 0, 0, 0, vX, vY, vZ) end end end previousTick = getTickCount() end function changeProjectileType(commandName, arg) projectileType = tonumber(arg) or 21 end addEventHandler("onClientElementDataChange", root, callbackDataChange, true) addEventHandler("onClientVehicleEnter", root, callbackVehicleEnter, true) addEventHandler("onClientRender", root, callbackRender, true) addCommandHandler("/guntype", changeProjectileType)
  9. The problem with rockets is that you can not make them go slower than the minimum travel speed. You will have to come up with something more sophisticated to make them less "smart". The heat seeking rocket for example can track objects as well. What I did in my POW game mode (Surface-to-Surface-Missile) is push the rockets up a little bit by adding force over the z-axis making it travel with a curve. It also does not target the player but an object that is created at the player's current position. This way the player has better change of survival because the rocket will not chase him down but remains to have enough speed to cause damage on impact. EDIT: Correction. What I said about minimum travel speed isn't entirely right. You can make a heat seeking rocket travel at a lower speed by not setting a target. This of course will result in the rocket going from A to B in a straight line (unless you add velocity over the x, y or z-axis). EDIT: Here's a simple example of mounting weapons. It attaches a mini-gun to the passenger side of the car and shoots projectiles. You can attach the gun with "/attachmod" and change projectile type with "/guntype [weaponType]". Like I said it is really basic and all it does is shoot a projectile with velocity over x and y-axis. You will have to make it work for the z-axis as well. In this example the projectiles go in a straight line even when the car's position is slightly tilted. server local guns = { [470] = { ["xPosOffset"] = 1.0, ["yPosOffset"] = 0, ["zPosOffset"] = 0 } } function attachMod(playerSource, commandName) local vehicle = getPlayerOccupiedVehicle(playerSource) local gun = false if (vehicle) then gun = guns[getVehicleID(vehicle)] or false if (gun) then attachElementToElement(createObject(2985, 0, 0, -100, 0, 0, 0), vehicle, gun.xPosOffset, gun.yPosOffset, gun.zPosOffset, 0, 0, 90) setElementData(vehicle, "toggleVehicleWeapon", true) end endend function detachMod(playerSource, commandName) local vehicle = getPlayerOccupiedVehicle(playerSource) if (vehicle) then for _, element in ipairs(getAttachedElements(vehicle)) do destroyElement(element) end setElementData(vehicle, "toggleVehicleWeapon", false) endend addCommandHandler("/attachmod", attachMod, false)addCommandHandler("/detachmod", detachMod, false) client local root = getRootElement()local player = getLocalPlayer() local toggleVehicleWeapon = falselocal previousTick = getTickCount()local projectileType = 21 function updateVehicleWeapon(source, dataName) if (getElementType(source) == "vehicle" and dataName == "toggleVehicleWeapon") then toggleVehicleWeapon = (getElementData(source, dataName) and isPlayerInVehicle(player)) endend function callbackDataChange(dataName) updateVehicleWeapon(source, dataName)end function callbackVehicleEnter(thePlayer, seat) updateVehicleWeapon(source, "toggleVehicleWeapon")end function callbackRender() if (getControlState("vehicle_fire") and toggleVehicleWeapon) then if (getTickCount() > (previousTick + 150) and previousTick > 0) then fireProjectile() end endend function fireProjectile() local vehicle = getPlayerOccupiedVehicle(player) local gun = false local gX, gY, gZ = 0, 0, 0 local gRotX, gRotY, gRotZ = 0, 0, 0 local pX, pY, pZ = 0, 0, 0 local vX, vY, vZ = 0, 0, 0 local currentLoSOffset = 3.5 local zPosOffset = 1.1 local thrust = 2.0 previousTick = 0 if (vehicle) then if (#getAttachedElements(vehicle) > 0) then gun = getAttachedElements(vehicle)[1] if (gun) then gX, gY, gZ = getElementPosition(gun) gRotX, gRotY, gRotZ = getObjectRotation(gun) pX = gX - math.sin(-math.rad(gRotZ + 90)) * currentLoSOffset pY = gY + math.cos(-math.rad(gRotZ + 90)) * currentLoSOffset pZ = gZ + zPosOffset vX = math.sin (math.rad((gRotZ + 90))) * thrust vY = math.cos(math.rad((gRotZ + 90))) * thrust vZ = 0 createExplosion(pX, pY, pZ, 5, true, -1.0, false) createProjectile(player, projectileType, pX, pY, pZ, 0, nil, 0, 0, 0, vX, vY, vZ) end end end previousTick = getTickCount()end function changeProjectileType(commandName, arg) projectileType = tonumber(arg) or 21end addEventHandler("onClientElementDataChange", root, callbackDataChange, true)addEventHandler("onClientVehicleEnter", root, callbackVehicleEnter, true)addEventHandler("onClientRender", root, callbackRender, true) addCommandHandler("/guntype", changeProjectileType)
  10. You can't. You can however change the texture or even replace the entire model with an invisible or transparent one.
  11. You can't. You can however change the texture or even replace the entire model with an invisible or transparent one.
  12. Like 50p said object movement doesn't add up. You will have to script some sort of loop control.
  13. Like 50p said object movement doesn't add up. You will have to script some sort of loop control.
  14. Sorry for bumping, but you might find this interesting. It is pretty much the same idea but without the cost of +5MB and unlike the East bay Carrier this does include interior objects. Beta Carrier 1.0 https://community.multitheftauto.com/index.php?p= ... ils&id=134
  15. It is a known bug. There is nothing much you can do.
  16. I don't think you can spawn an attached trailer because both elements are seperate vehicles. You will have to script the attaching part using something like this: http://development.mtasa.com/index.php? ... rToVehicle.
  17. The short answer is yes, you need the original GTA SA in order to play MTA SA.
  18. If you want to shoot at a player while he is in the death sphere simply toggle the sphere on and off (moving it from -9999 to XYZ back and forth) every x seconds. Since your script detects hit events the sam will fire every time the player is still in the death sphere area.
  19. Hi, this game mode is not completed and may contain lots of instabilities. I am aware of the issues mentioned but I'm not planning to fix it. When DP3 comes out (whenever that is) I will re-script the entire mode to be more suitable to play on public servers. The falling through the floor seems to be arbitrary and is probably caused because objects are not streamed in fast enough. The other issue could possible be solved by pressing ENTER. All players are locked to the spawnpoint when they respawn. This is to protect them against spawn killers. You should be able to unlock yourself by pressing enter. I hope this reply was useful to you.
  20. What is the broph resource? And it is very easy to set it up. All you have to do is include the resource in your game mode, create some markers and register the markers as reloading spots. The Bomber resource will automatically attach the necessary event handling. You basically do not have to worry about how bomber markers work. The resource should do the dirty job for you. If you are still unsure how to make this work look at the demo game mode provided with this resource (it is in the samples folder of the bomber.zip archive). Copy demo.zip and bomber.zip to your resource folder and run it right out of the box. Long story short. You will have to do some basic scripting in order to make this work.
  21. I have no idea. I don't have a remote server and I can only test scripts on my own computer.
  22. That must be an MTA bug because nothing extraordinary happens when you hit a marker.
  23. Yes, that's basically what happens. But this has to do with the fact that server side object creation is buggy. I tried to script it server side but the script doesn't work like it should (bomb remaining static, objects not being destroyed etc.). This is not my fault. You can fake it by telling all clients to create "their" version of the bomb though. But this still wouldn't be synchronized because the bomb is not following a static trajectory. One client for example may see it bounce off to the right while another one sees it as going to the left. There's nothing more I can do than to wait and hope that DP3 supports velocity changes on objects.
  24. Bomber script 1.0 (Resource) Ace_Gambit This resource allows you to attach bombs to any vehicle. Please take note that you can not run this resource as a stand alone script. You will have to incorporate it in a game mode. Also be aware of the fact that the bombs are not synchronized. In other words, only you can see the bombs falling! The explosions on the other hand are synchronized for all players. Download url: https://community.multitheftauto.com/index.php?p= ... ils&id=129 Features: - realistic bomb dropping with real GTA world physics - configurable bomb models - velocity triggered bombs - depth bombs Controls: - LSHIFT drop bomb - MOUSE2 switch off depth camera Usage (The "samples" folder includes a demo game mode that you can use as a sandbox): 1) Copy archive to resource folder and include resource in your script. 2) Register markers using one of the following export functions. 2a) Register all markers as bomb reloading spots call(getResourceFromName("bomber"), "regBombMarkers", getElementsByType("marker", getRootElement())) 2b) Register marker as bomb reloading spot call(getResourceFromName("bomber"), "regBombMarker", marker) 2c) Unregister marker as bomb reloading spot * call(getResourceFromName("bomber"), "unregBombMarker", marker) 2d) Unregister all markers as bomb reloading spots * call(getResourceFromName("bomber"), "unregBombMarkers", getElementsByType("marker", getRootElement())) 3) Play! Settings: Setting names **: - andromada - at400 - beagle - cargobob - cropduster - dodo - hunter - hydra - leviathan - maverick - nevada - newschopper - policemaverick - raindance - rustler - seasparrow - shamal - skimmer - sparrow - stuntplane - coastguard - dinghy - jetmax - launch - marquis - predator - reefer - speeder - squalo - tropic - fbirancher - patriot - policecar - policeranger - rhino * Markers are automatically unregistered when the resource is stopped ** Setting names are just predefined tags. You can use any vehicle id in combination with a setting tag. This is more or less a design flaw since I am just starting to learn how to use the settings system. Credits to the MTA team
  25. I don't mind at all. You can change it by replacing the inRustler function with something that checks if the player is in an airplane. Depending on the airplane you should also adjust the z offset value of the attached bomb in order to make appear correctly. I know I said earlier that I wasn't going to make this a resource. But maybe I will script a resource that accepts all kind of airplanes and upload it to the community base (maybe even today).
×
×
  • Create New...