Jump to content

j3sus86

Members
  • Posts

    25
  • Joined

  • Last visited

Details

  • Gang
    DRuG

j3sus86's Achievements

Advanced Member

Advanced Member (8/54)

0

Reputation

  1. yet you all complain that they come here to use mta's map editor. should think of it as an opportunity for them to see mta's potential.
  2. thank you it works! I've had this script for ages that only half worked. I actually have a few other scripts that i have similar problems with hopefully i can figure it out based on this. I really appreciate both of your efforts and time. function setVelocityRelativeToVehicle(vehicle, direction, increaseFactor) local M = getElementMatrix( vehicle ) local velx,vely,velz = getElementVelocity(vehicle) local X,Y,Z = 0,0,0 if direction == "front" then Y = increaseFactor elseif direction == "rear" then Y = -increaseFactor elseif direction == "left" then X = -increaseFactor elseif direction == "right" then X = increaseFactor else outputDebugString("unknown direction: " .. tostring(direction)) end setElementVelocity( vehicle, velx + X * M[1][1] + Y * M[2][1] + Z * M[3][1], vely + X * M[1][2] + Y * M[2][2] + Z * M[3][2], velz + X * M[1][3] + Y * M[2][3] + Z * M[3][3] ) end
  3. correct, and it works if the vehicle is right side up, using only on the z rotation. But x and y rotations need to be taken into account and I'm not sure of the math to do so.
  4. need help with some math if anyone is good at it. The solution is probably simple, but I'm not good at it. -- need to check rotX and rotY to see if the vehicle is upside down to get the correct velocity to move the vehicle front, rear, left, right.. -- when the vehicle is upside down /tilted, the wrong velocities are returned function getVelocityRelativeToVehicle(vehicle, direction, increaseFactor) local velocityX,velocityY,velocityZ = getElementVelocity(vehicle) local rotX,rotY,rotZ = getVehicleRotation(vehicle) if direction == "front" then rotZ = rotZ elseif direction == "rear" then rotZ = rotZ + 180 elseif direction == "left" then rotZ = rotZ + 90 elseif direction == "right" then rotZ = rotZ - 90 else outputDebugString("unknown direction: " .. tostring(direction)) end -- need to check rotX and rotY to see if the vehicle is upside down to get the correct velocity to move the vehicle front, rear, left, right.. -- when the vehicle is upside down /tilted, the wrong velocities are returned rotZ = math.rad(rotZ) velocityX = (math.sin(rotZ) * -increaseFactor) + velocityX velocityY = (math.cos(rotZ) * increaseFactor) + velocityY return velocityX, velocityY, velocityZ end
  5. that doesn't really help much, i need help with the math to calculate the offset to use with attachElementToElement(). thx for trying though.
  6. that doesn't really help much, i need help with the math to calculate the offset to use with attachElementToElement(). thx for trying though.
  7. I'm trying to make paintballs, that attach to a vehicle or player at the point where the bullet hit. I'm not so good at math, but i tried to base it off the glue resource, using his method of attaching at the correct offsets. I don't understand the math involved and it not working correctly. All the paintballs seem to stick to the center area of the vehicle. Any help would be much appreciated. http://mta.pastebin.com/d2f62213c
  8. I'm trying to make paintballs, that attach to a vehicle or player at the point where the bullet hit. I'm not so good at math, but i tried to base it off the glue resource, using his method of attaching at the correct offsets. I don't understand the math involved and it not working correctly. All the paintballs seem to stick to the center area of the vehicle. Any help would be much appreciated. http://mta.pastebin.com/d2f62213c
  9. Auto-Complete player name and Vehicle Name from a sub string Well I'm new to lua but i made these and i figured they might be useful to someone.. Sorry in advance if its coded poorly but i tried. -- Completes Player Name From A Sub String -- returns for the last match found: player, theName, and number of matches found function complete_PlayerName ( sub ) local players = getElementsByType ( "player" ) sub = string.lower(sub) local success, target local numfound = 0 for theKey, theFind in ipairs(players) do success = string.find(string.lower(getClientName ( theFind ) ), sub ) if success then target = theFind numfound = numfound + 1 end end return target, getClientName(target), numfound end -- Completes Vehicle Name From A Sub String -- returns the last match found: Name of Vehicle, number of matches, modelid function complete_VehicleName ( sub ) local success, target, model local numfound = 0 sub = string.lower(sub) for i = 1, 211 do if ( getVehicleNameFromID ( 400 + i ) ~= "" ) then success = string.find(string.lower(getVehicleNameFromID ( 400 + i ) ), sub ) if success then target = getVehicleNameFromID ( 400 + i ) numfound = numfound + 1 model = 400 + i end end end return target, numfound, model end -- Example of how its used function Cmd_Vname( thePlayer, command, sub ) local theVehicleName, numfound, modelid = complete_VehicleName ( sub ) if not theVehicleName then outputChatBox ( "no matches found: (" .. sub .. ").", thePlayer ) else if numfound > 1 then outputChatBox ( "multiple matches found (" .. numfound .. "). Please be more specific", thePlayer ) else outputChatBox ( "Vehicle Found: " .. theVehicleName .. " (" .. modelid .. ").", thePlayer ) end end end addCommandHandler("vname", Cmd_Vname) Edit - added weapon name autocomplete -- Completes Weapon Name From A Sub String -- returns for the last match found: name, weaponid, number of matches function complete_WeaponName ( sub ) local success, target, weaponid local numfound = 0 sub = string.lower(sub) for i = 1, 46 do if ( getWeaponNameFromID ( i ) ~= false )then success = string.find(string.lower(getWeaponNameFromID ( i ) ), sub ) if success then target = getWeaponNameFromID ( i ) numfound = numfound + 1 weaponid = i end end end return target, weaponid, numfound end
  10. i agree!! been mentioned and i think aeron is workin on it : ) so hopefully we'll see it soon.
  11. hmm well i was workin on a cops and robber map and was wondering if there is anyway to specify which spawnpoints will respawn first? for example making it where spawnpoints for a robber would respawn first to make sure there is always a robber instead of running into the problem of all cops. Is it decided by which spawn points come first in the .map file? closest spawn point to where a player dies? any info would be much appreciated. sry if it has already been mentioned, i searched with no sucess. *edit* (only saw some info about initial spawn points not respawning) thx another question is about the pickups & icons such as bodyarmor(1242) and parachute(1310) and cj_m16 (2035). will these be the pickups used once dm is finished? was working on a map and had a cool idea for dm, just was wonderin if thats what would be used to know if i should bother workin on it or not. thx again : )
  12. j3sus86

    M!C PipeDream Video

    cool map cool video
  13. being able to group objects in map maker would be good also, dunno if it has been mentioned, sry if it has.
×
×
  • Create New...