diff --git a/[insanity]/insanity-animdisabler/CAR_dead_RHS.ifp b/[insanity]/insanity-animdisabler/CAR_dead_RHS.ifp
new file mode 100644
index 0000000..b0ce842
Binary files /dev/null and b/[insanity]/insanity-animdisabler/CAR_dead_RHS.ifp differ
diff --git a/[insanity]/insanity-animdisabler/client.lua b/[insanity]/insanity-animdisabler/client.lua
new file mode 100644
index 0000000..ffb46d3
--- /dev/null
+++ b/[insanity]/insanity-animdisabler/client.lua
@@ -0,0 +1,37 @@
+local disableAnims = {
+ {"ped","CLIMB_Stand_finish"},
+ {"ped","FALL_land"},
+ {"ped","Fight2Idle"},
+ {"ped","JUMP_land"},
+ {"ped","Player_Sneak_walkstart"},
+ {"ped","Run_stop"},
+ {"ped","Run_stopR"},
+ {"ped","WALK_start"},
+ {"ped","WALK_start_armed"},
+ {"ped","WALK_start_csaw"},
+ {"ped","WALK_start_rocket"},
+ {"ped","JUMP_launch"},
+ {"ped","JUMP_launch_R"}
+}
+
+local ifp = engineLoadIFP("CAR_dead_RHS.ifp","insanity.animdisabler")
+
+function applyAnims(ped)
+ for _,anim in pairs(disableAnims) do
+ engineReplaceAnimation(ped,anim[1],anim[2],"insanity.animdisabler","CAR_dead_RHS")
+ end
+end
+
+addEventHandler("onClientPlayerSpawn",root,function()
+ applyAnims(source)
+end)
+
+for _,player in pairs(getElementsByType("player")) do
+ applyAnims(player)
+end
+
+addEventHandler("onClientPreRender",root,function()
+ for _,player in pairs(getElementsByType("player")) do
+ setPedAnimationSpeed(player,"CAR_dead_RHS",10)
+ end
+end)
\ No newline at end of file
diff --git a/[insanity]/insanity-animdisabler/meta.xml b/[insanity]/insanity-animdisabler/meta.xml
new file mode 100644
index 0000000..21b0bde
--- /dev/null
+++ b/[insanity]/insanity-animdisabler/meta.xml
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/[insanity]/insanity-animspeed/client.lua b/[insanity]/insanity-animspeed/client.lua
new file mode 100644
index 0000000..9b9d481
--- /dev/null
+++ b/[insanity]/insanity-animspeed/client.lua
@@ -0,0 +1,14 @@
+local animSpeeds = {
+ {"CLIMB_jump",1.5},
+ {"CLIMB_jump_B",1.5},
+ {"CLIMB_Pull",1.5},
+ {"CLIMB_Stand",1.5}
+}
+
+addEventHandler("onClientPreRender",root,function()
+ for _,player in pairs(getElementsByType("player")) do
+ for _,anim in pairs(animSpeeds) do
+ setPedAnimationSpeed(player,anim[1],anim[2])
+ end
+ end
+end)
\ No newline at end of file
diff --git a/[insanity]/insanity-animspeed/meta.xml b/[insanity]/insanity-animspeed/meta.xml
new file mode 100644
index 0000000..0a7eb2a
--- /dev/null
+++ b/[insanity]/insanity-animspeed/meta.xml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/[insanity]/insanity-dualwieldpickup/meta.xml b/[insanity]/insanity-dualwieldpickup/meta.xml
new file mode 100644
index 0000000..03e89a3
--- /dev/null
+++ b/[insanity]/insanity-dualwieldpickup/meta.xml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/[insanity]/insanity-dualwieldpickup/server.lua b/[insanity]/insanity-dualwieldpickup/server.lua
new file mode 100644
index 0000000..7b7c28d
--- /dev/null
+++ b/[insanity]/insanity-dualwieldpickup/server.lua
@@ -0,0 +1,46 @@
+local weaponSlots = {0,1,2,3,4,5,6,7,8,9,10,11,12}
+local skillMap = {}
+skillMap[22] = 69
+skillMap[23] = 70
+skillMap[24] = 71
+skillMap[25] = 72
+skillMap[26] = 73
+skillMap[27] = 74
+skillMap[28] = 75
+skillMap[29] = 76
+skillMap[32] = 75
+skillMap[30] = 77
+skillMap[31] = 78
+skillMap[33] = 79
+skillMap[34] = 79
+
+function setBaseSkill(player)
+ for _,sID in pairs(skillMap) do
+ setPedStat(player,sID,998)
+ end
+end
+
+addEventHandler("onPlayerSpawn",root,function()
+ setBaseSkill(source)
+end)
+
+addEventHandler("onPickupUse",root,function(player)
+ local wep = getPickupWeapon(source)
+ if wep == false then return end
+ for _,slot in ipairs(weaponSlots) do
+ if getPedWeapon(player,slot) == wep then
+ if skillMap[wep] ~= nil then
+ setPedStat(player,skillMap[wep],1000)
+ end
+ return
+ end
+ end
+
+ if skillMap[wep] ~= nil then
+ setPedStat(player,skillMap[wep],998)
+ end
+end)
+
+for _,player in ipairs(getElementsByType("player")) do
+ setBaseSkill(player)
+end
\ No newline at end of file
diff --git a/[insanity]/insanity-falldamage/client.lua b/[insanity]/insanity-falldamage/client.lua
new file mode 100644
index 0000000..456bf86
--- /dev/null
+++ b/[insanity]/insanity-falldamage/client.lua
@@ -0,0 +1,6 @@
+addEventHandler("onClientPlayerDamage",root,function(attacker,cause,bodypart,damage)
+ if source ~= localPlayer then return end
+ if cause ~= 54 then return end
+ if damage > 15 then return end
+ cancelEvent()
+end)
\ No newline at end of file
diff --git a/[insanity]/insanity-falldamage/meta.xml b/[insanity]/insanity-falldamage/meta.xml
new file mode 100644
index 0000000..0a7eb2a
--- /dev/null
+++ b/[insanity]/insanity-falldamage/meta.xml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/[insanity]/insanity-glitches/meta.xml b/[insanity]/insanity-glitches/meta.xml
new file mode 100644
index 0000000..03e89a3
--- /dev/null
+++ b/[insanity]/insanity-glitches/meta.xml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/[insanity]/insanity-glitches/server.lua b/[insanity]/insanity-glitches/server.lua
new file mode 100644
index 0000000..26f6ba2
--- /dev/null
+++ b/[insanity]/insanity-glitches/server.lua
@@ -0,0 +1,7 @@
+local glitches = {"quickreload", "fastmove", "fastfire", "crouchbug", "highcloserangedamage", "fastsprint", "quickstand"}
+
+addEventHandler("onResourceStart", resourceRoot, function()
+ for _, glitch in ipairs(glitches) do
+ setGlitchEnabled(glitch, true)
+ end
+end)
\ No newline at end of file
diff --git a/[insanity]/insanity-gravity/meta.xml b/[insanity]/insanity-gravity/meta.xml
new file mode 100644
index 0000000..58d664a
--- /dev/null
+++ b/[insanity]/insanity-gravity/meta.xml
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/[insanity]/insanity-gravity/server.lua b/[insanity]/insanity-gravity/server.lua
new file mode 100644
index 0000000..90ae0d3
--- /dev/null
+++ b/[insanity]/insanity-gravity/server.lua
@@ -0,0 +1,8 @@
+local grav = 0.006
+function enforceGravity()
+ if getGravity() ~= grav then
+ setGravity(grav)
+ end
+end
+
+setTimer(enforceGravity,1000,0)
\ No newline at end of file
diff --git a/[insanity]/insanity-movement/GunMove_BWD.ifp b/[insanity]/insanity-movement/GunMove_BWD.ifp
new file mode 100644
index 0000000..069b092
Binary files /dev/null and b/[insanity]/insanity-movement/GunMove_BWD.ifp differ
diff --git a/[insanity]/insanity-movement/client.lua b/[insanity]/insanity-movement/client.lua
new file mode 100644
index 0000000..baa3b52
--- /dev/null
+++ b/[insanity]/insanity-movement/client.lua
@@ -0,0 +1,179 @@
+local ifp = engineLoadIFP("GunMove_BWD.ifp","insanity.movement")
+local rotSpeed = 0 -- 0 is instant - early and broken, do not use
+local frametime = 33.3333
+local aimOnly = false
+
+function setResourceElementData(element,key,value,share)
+ if share == nil then share = true end
+ return setElementData(element,getResourceName(resource).. "." ..key,value,share)
+end
+
+function getResourceElementData(element,key)
+ return getElementData(element,getResourceName(resource).. "." ..key)
+end
+
+local weaponToSkillMap = {}
+weaponToSkillMap[22] = 69
+weaponToSkillMap[23] = 70
+weaponToSkillMap[24] = 71
+weaponToSkillMap[25] = 72
+weaponToSkillMap[26] = 73
+weaponToSkillMap[27] = 74
+weaponToSkillMap[28] = 75
+weaponToSkillMap[29] = 76
+weaponToSkillMap[32] = 75
+weaponToSkillMap[30] = 77
+weaponToSkillMap[31] = 78
+weaponToSkillMap[33] = 79
+weaponToSkillMap[34] = 79
+
+local weaponGangsterSkillLevels = {}
+weaponGangsterSkillLevels[69] = 40
+weaponGangsterSkillLevels[70] = 500
+weaponGangsterSkillLevels[75] = 50
+weaponGangsterSkillLevels[76] = 250
+weaponGangsterSkillLevels[79] = 300
+
+function getPedSkillLevel(ped,weapon)
+ local sID = weaponToSkillMap[weapon]
+ if sID == nil then return "pro" end
+ local skill = getPedStat(ped,sID)
+ if skill >= 999 then return "pro" end
+ local gangsterSkill = weaponGangsterSkillLevels[sID] or 200
+ if skill < gangsterSkill then return "poor" end
+ return "std"
+end
+
+function getPedDesiredRotation(ped,alwaysForward)
+ local crz = 360 - getPedCameraRotation(ped)
+ local right = getPedAnalogControlState(ped,"right") - getPedAnalogControlState(ped,"left")
+ local forward = getPedAnalogControlState(ped,"forwards") - getPedAnalogControlState(ped,"backwards")
+ local posRight = right
+ if posRight < 0 then posRight = 0 - posRight end
+ local posForward = forward
+ if posForward < 0 then posForward = 0 - posForward end
+ local div = posRight + posForward
+ if div == 0 then div = 1 end
+
+ if forward < 0 then
+ right = 0 - right
+ if not alwaysForward then
+ crz = crz + 180
+ end
+ end
+
+ if crz > 360 then
+ crz = crz - 360
+ end
+
+ return crz + ((right * -90) / div)
+end
+
+function updateWeaponBackward(ped,st)
+ if st == getResourceElementData(ped,"weapon_backward") then return false end
+ if st then
+ engineReplaceAnimation(ped,"ped","run_player","insanity.movement","GunMove_BWD")
+ setResourceElementData(ped,"weapon_backward",true,false)
+ else
+ setPedAnimationSpeed(ped,"GunMove_BWD",1.0)
+ engineRestoreAnimation(ped,"ped","run_player")
+ setResourceElementData(ped,"weapon_backward",false,false)
+ end
+ return true
+end
+
+function handlePed(ped)
+ local moveState = getPedMoveState(ped)
+ setPedAnimationSpeed(ped,"GunMove_BWD",2.0)
+ setPedAnimationSpeed(ped,"GunMove_FWD",2.0)
+ setPedAnimationSpeed(ped,"GunMove_L",2.0)
+ setPedAnimationSpeed(ped,"GunMove_R",2.0)
+
+ local task = getPedTask(ped,"primary",3)
+ if task == "TASK_COMPLEX_ENTER_CAR_AS_DRIVER" or task == "TASK_COMPLEX_ENTER_CAR_AS_PASSENGER" then return end
+
+ if
+ isPedDead(ped) or
+ moveState == "climb" or
+ isPedWearingJetpack(ped) or
+ getPedOccupiedVehicle(ped) or
+ (getPedControlState(ped,"aim_weapon") and ((
+ moveState == "crouch" or
+ moveState == "crawl"
+ ) or (
+ (not getWeaponProperty(getPedWeapon(ped),getPedSkillLevel(ped,getPedWeapon(ped)),"flag_aim_arm")) or
+ getWeaponProperty(getPedWeapon(ped),getPedSkillLevel(ped,getPedWeapon(ped)),"flag_type_heavy")
+ ))) or
+ getElementData(ped,"parachuting") or
+ getElementData(ped,"entering_vehicle")
+ then
+ updateWeaponBackward(ped,false)
+ return
+ end
+
+ local forward = getPedAnalogControlState(ped,"forwards") - getPedAnalogControlState(ped,"backwards")
+ local turnInstantly = false
+
+ local rot = 0
+ local weaponBackward = false
+ local aiming = false
+ if getPedControlState(ped,"aim_weapon") and (
+ moveState == "stand" or
+ moveState == "walk" or
+ moveState == "powerwalk" or
+ moveState == "jog" or
+ moveState == "fall"
+ ) then
+ aiming = true
+ if forward < 0 then
+ weaponBackward = true
+ turnInstantly = true
+ else
+ weaponBackward = false
+ end
+ else
+ weaponBackward = false
+ end
+ rot = getPedDesiredRotation(ped,weaponBackward)
+ local updated = updateWeaponBackward(ped,weaponBackward)
+
+ if aimOnly == true and aiming == false then
+ return
+ end
+
+ local prx,pry,prz = getElementRotation(ped)
+ if turnInstantly or rotSpeed == 0 then
+ prz = rot
+ else
+ local direction = 1
+ local diff = prz - rot
+ if diff < -1 then diff = 0 - diff end
+ if prz > rot then
+ direction = -1
+ end
+ if diff > 180 then
+ direction = direction * -1
+ end
+
+ prz = prz + ((rotSpeed * direction) * frametime)
+ --if prz < 0 then prz = prz + 360 end
+ --if prz > 360 then prz = prz - 360 end
+ if direction < 0 then
+ if prz < rot then
+ prz = rot
+ end
+ else
+ if prz > rot then
+ prz = rot
+ end
+ end
+ end
+ setElementRotation(ped,prx,pry,prz,"default",true)
+end
+
+addEventHandler("onClientPreRender",root,function(slice)
+ frametime = slice
+ for _,ped in ipairs(getElementsByType("player")) do
+ handlePed(ped)
+ end
+end)
\ No newline at end of file
diff --git a/[insanity]/insanity-movement/meta.xml b/[insanity]/insanity-movement/meta.xml
new file mode 100644
index 0000000..6014bff
--- /dev/null
+++ b/[insanity]/insanity-movement/meta.xml
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/[insanity]/insanity-roll/VRolling.ifp b/[insanity]/insanity-roll/VRolling.ifp
new file mode 100644
index 0000000..19ef2c5
Binary files /dev/null and b/[insanity]/insanity-roll/VRolling.ifp differ
diff --git a/[insanity]/insanity-roll/client.lua b/[insanity]/insanity-roll/client.lua
new file mode 100644
index 0000000..c524301
--- /dev/null
+++ b/[insanity]/insanity-roll/client.lua
@@ -0,0 +1,88 @@
+local alwaysRoll = true
+local ifp = engineLoadIFP("VRolling.ifp","insanity.roll")
+local falling = 0
+local fallingThreshold = 2000
+
+function replaceAnims(ped)
+ engineReplaceAnimation(ped,"ped","FALL_collapse","insanity.roll","VRolling_Front")
+end
+
+function restoreAnims(ped)
+ engineRestoreAnimation(ped,"ped","FALL_collapse")
+end
+
+addEventHandler("onClientPlayerJoin",root,function()
+ replaceAnims(source)
+end)
+
+addEventHandler("onClientPlayerSpawn",root,function()
+ replaceAnims(source)
+end)
+
+addEventHandler("onClientElementStreamIn",root,function()
+ if getElementType(source) == "ped" then
+ replaceAnims(source)
+ end
+end)
+
+addEventHandler("onClientResourceStart",resourceRoot,function()
+ for _,ped in ipairs(getElementsByType("ped")) do
+ replaceAnims(ped)
+ end
+
+ for _,ped in ipairs(getElementsByType("player")) do
+ replaceAnims(ped)
+ end
+end)
+
+
+addEventHandler("onClientResourceStop",resourceRoot,function()
+ for _,ped in ipairs(getElementsByType("ped")) do
+ restoreAnims(ped)
+ end
+
+ for _,ped in ipairs(getElementsByType("player")) do
+ restoreAnims(ped)
+ end
+end)
+
+if alwaysRoll then
+ addEventHandler("onClientPlayerDamage",root,function(attacker,damageType)
+ if damageType ~= 54 then return end
+ setPedAnimation(source,"insanity.roll","VRolling_Front",-1,false,true,false,false,0,true)
+ falling = 0
+ end)
+
+ addEventHandler("onClientPreRender",root,function(slice)
+ for _,ped in ipairs(getElementsByType("player")) do
+ setPedAnimationSpeed(localPlayer,"VRolling_Front",1.4)
+ if isPedWearingJetpack(localPlayer) then
+ falling = 0
+ return
+ end
+
+ if isPedDead(localPlayer) then
+ falling = 0
+ return
+ end
+
+ if isElementInWater(localPlayer) then
+ falling = 0
+ return
+ end
+
+ if getPedMoveState(localPlayer) == "fall" then
+ falling = falling + slice
+ return
+ end
+
+ if getPedMoveState(localPlayer) ~= "climb" then
+ if falling > fallingThreshold then
+ setPedAnimation(localPlayer,"insanity.roll","VRolling_Front",-1,false,true,false,false,0,true)
+ end
+ end
+
+ falling = 0
+ end
+ end)
+end
\ No newline at end of file
diff --git a/[insanity]/insanity-roll/meta.xml b/[insanity]/insanity-roll/meta.xml
new file mode 100644
index 0000000..4ffc51b
--- /dev/null
+++ b/[insanity]/insanity-roll/meta.xml
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/[insanity]/insanity-walkstyle/meta.xml b/[insanity]/insanity-walkstyle/meta.xml
new file mode 100644
index 0000000..03e89a3
--- /dev/null
+++ b/[insanity]/insanity-walkstyle/meta.xml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/[insanity]/insanity-walkstyle/server.lua b/[insanity]/insanity-walkstyle/server.lua
new file mode 100644
index 0000000..0467b76
--- /dev/null
+++ b/[insanity]/insanity-walkstyle/server.lua
@@ -0,0 +1,7 @@
+for _,player in ipairs(getElementsByType("player")) do
+ setPedWalkingStyle(player,69)
+end
+
+addEventHandler("onPlayerJoin",root,function()
+ setPedWalkingStyle(source,69)
+end)
\ No newline at end of file
diff --git a/[insanity]/insanity-weapons/meta.xml b/[insanity]/insanity-weapons/meta.xml
new file mode 100644
index 0000000..5b2eeec
--- /dev/null
+++ b/[insanity]/insanity-weapons/meta.xml
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/[insanity]/insanity-weapons/server.lua b/[insanity]/insanity-weapons/server.lua
new file mode 100644
index 0000000..5422a42
--- /dev/null
+++ b/[insanity]/insanity-weapons/server.lua
@@ -0,0 +1,71 @@
+local weaponBlacklist = {"grenade","teargas","molotov","sniper","rocket launcher","rocket launcher hs","flamethrower","satchel","bomb","spraycan","fire extinguisher","camera"}
+local weaponBlacklistDualWield = {"minigun","rifle"}
+
+local weapons = {"grenade","teargas","molotov","colt 45","silenced","deagle","shotgun","sawed-off","combat shotgun","uzi","mp5","ak-47","m4","tec-9","rifle","sniper","rocket launcher","rocket launcher hs","flamethrower","minigun","satchel","bomb","spraycan","fire extinguisher","camera"}
+local weaponDefaultDualWield = {"colt 45","sawed-off","uzi","tec-9"}
+local weaponSkills = {"poor","std","pro"}
+local weaponProperties = {"weapon_range","target_range","accuracy","damage","maximum_clip_ammo","move_speed","anim_loop_start","anim_loop_stop","anim_loop_bullet_fire","anim2_loop_start","anim2_loop_stop","anim2_loop_bullet_fire","anim_breakout_time","flag_aim_no_auto","flag_aim_arm","flag_aim_1st_person","flag_aim_free","flag_move_and_aim","flag_move_and_shoot","flag_type_throw","flag_type_heavy","flag_type_constant","flag_type_dual","flag_anim_reload","flag_anim_crouch","flag_anim_reload_loop","flag_anim_reload_long","flag_shot_slows","flag_shot_rand_speed","flag_shot_anim_abrupt","flag_shot_expands"}
+
+function isInList(haystack,needle)
+ for _,i in ipairs(haystack) do
+ if i == needle then return true end
+ end
+ return false
+end
+
+for _,weapon in ipairs(weapons) do
+ if not isInList(weaponBlacklist,weapon) then
+ setJetpackWeaponEnabled(weapon,true)
+ for _,property in ipairs(weaponProperties) do
+ for _,skill in ipairs(weaponSkills) do
+ setWeaponProperty(weapon,skill,property,getOriginalWeaponProperty(weapon,"pro",property))
+ end
+ end
+
+ for _,skill in ipairs(weaponSkills) do
+ setWeaponProperty(weapon,skill,"flag_aim_arm",true)
+ end
+
+ if not isInList(weaponBlacklistDualWield,weapon) then
+ setWeaponProperty(weapon,"pro","flag_type_dual",true)
+ setWeaponProperty(weapon,"pro","accuracy",getOriginalWeaponProperty(
+weapon,"pro","accuracy") * 1.5)
+ setWeaponProperty(weapon,"pro","maximum_clip_ammo",getOriginalWeaponProperty(
+weapon,"pro","maximum_clip_ammo") * 2)
+ end
+ end
+ for _,skill in ipairs(weaponSkills) do
+ setWeaponProperty(weapon,skill,"flag_move_and_aim",true)
+ setWeaponProperty(weapon,skill,"flag_move_and_shoot",true)
+ setWeaponProperty(weapon,skill,"flag_type_heavy",false)
+ end
+end
+
+for _,skill in ipairs(weaponSkills) do
+ setWeaponProperty("sniper",skill,"flag_type_heavy",true)
+ setWeaponProperty("rocket launcher",skill,"flag_type_heavy",true)
+ setWeaponProperty("rocket launcher hs",skill,"flag_type_heavy",true)
+end
+
+for _,weapon in ipairs(weaponDefaultDualWield) do
+ setWeaponProperty(weapon,"poor","flag_type_dual",false)
+ setWeaponProperty(weapon,"std","flag_type_dual",false)
+ setWeaponProperty(weapon,"poor","maximum_clip_ammo",getOriginalWeaponProperty(
+weapon,"std","maximum_clip_ammo"))
+ setWeaponProperty(weapon,"std","maximum_clip_ammo",getOriginalWeaponProperty(
+weapon,"std","maximum_clip_ammo"))
+ setWeaponProperty(weapon,"pro","maximum_clip_ammo",getOriginalWeaponProperty(
+weapon,"pro","maximum_clip_ammo"))
+end
+
+addEventHandler("onResourceStop",resourceRoot,function()
+ for _,weapon in ipairs(weapons) do
+ if not isInList(weaponBlacklist,weapon) then
+ for _,property in ipairs(weaponProperties) do
+ for _,skill in ipairs(weaponSkills) do
+ setWeaponProperty(weapon,skill,property,getOriginalWeaponProperty(weapon,skill,property))
+ end
+ end
+ end
+ end
+end)
\ No newline at end of file
diff --git a/[vehicles]/avelocity/client.lua b/[vehicles]/avelocity/client.lua
new file mode 100644
index 0000000..a164e43
--- /dev/null
+++ b/[vehicles]/avelocity/client.lua
@@ -0,0 +1,95 @@
+local responses = {}
+responses[0] = {
+ 0.5,0.5,0.8,
+ -0.2,-0.2,0.8
+}
+
+responses[80] = {
+ 0.5,0.8,0.6,
+ 0.0,0.0,0.5
+}
+
+responses[120] = {
+ 0.5,0.9,0.5,
+ 0.0,0.0,0.6
+}
+
+--[[responses[200] = {
+ 0.2,0.2,0.5,
+ 0.2,0.2,0.5
+}]]--
+
+function getRatioWithin(v,st,ed)
+ if ed - st == 0 then return 1.0 end
+ return (v - st) / (ed - st)
+end
+
+function handleVehicle(veh)
+ local rvx,rvy,rvz = getVehicleTurnVelocity(veh)
+ if not getElementData(veh,"lastRvx") then
+ setElementData(veh,"lastRvx",rvx,false)
+ setElementData(veh,"lastRvy",rvy,false)
+ setElementData(veh,"lastRvz",rvz,false)
+ end
+ local lrvx = getElementData(veh,"lastRvx")
+ local lrvy = getElementData(veh,"lastRvy")
+ local lrvz = getElementData(veh,"lastRvz")
+ local offsetIndexX = 0
+ local offsetIndexY = 0
+ local offsetIndexZ = 0
+ if lrvx < 0 and rvx > lrvx then offsetIndexX = 3 end
+ if lrvx > 0 and rvx < lrvx then offsetIndexX = 3 end
+ if lrvy < 0 and rvy > lrvy then offsetIndexY = 3 end
+ if lrvy > 0 and rvy < lrvy then offsetIndexY = 3 end
+ if lrvz < 0 and rvz > lrvz then offsetIndexZ = 3 end
+ if lrvz > 0 and rvz < lrvz then offsetIndexZ = 3 end
+
+ local startProfile = false
+ local endProfile = false
+ local speed = getElementSpeed(veh,"km/h")
+ for targetSpeed,_ in pairs(responses) do
+ if startProfile == false then
+ if speed >= targetSpeed then startProfile = targetSpeed end
+ else
+ endProfile = targetSpeed
+ break
+ end
+ end
+ if startProfile == false then startProfile = 0 end
+ if endProfile == false then endProfile = startProfile end
+
+ local ratio = getRatioWithin(speed,startProfile,endProfile)
+ if ratio > 1 then ratio = 1 end
+ local mvx = responses[startProfile][1 + offsetIndexX] + ((responses[endProfile][1 + offsetIndexX] - responses[startProfile][1 + offsetIndexX])*ratio)
+ local mvy = responses[startProfile][2 + offsetIndexY] + ((responses[endProfile][2 + offsetIndexY] - responses[startProfile][2 + offsetIndexY])*ratio)
+ local mvz = responses[startProfile][3 + offsetIndexZ] + ((responses[endProfile][3 + offsetIndexZ] - responses[startProfile][3 + offsetIndexZ])*ratio)
+
+ rvx = rvx + ((lrvx - rvx) * mvx)
+ rvy = rvy + ((lrvy - rvy) * mvy)
+ rvz = rvz + ((lrvz - rvz) * mvz)
+ setVehicleTurnVelocity(veh,rvx,rvy,rvz)
+ setElementData(veh,"lastRvx",rvx,false)
+ setElementData(veh,"lastRvy",rvy,false)
+ setElementData(veh,"lastRvz",rvz,false)
+end
+
+function loop(ts)
+ for _,veh in ipairs(getElementsByType("vehicle")) do
+ handleVehicle(veh)
+ end
+end
+addEventHandler("onClientPreRender",root,loop)
+
+function getElementSpeed(theElement, unit)
+ -- Check arguments for errors
+ assert(isElement(theElement), "Bad argument 1 @ getElementSpeed (element expected, got " .. type(theElement) .. ")")
+ local elementType = getElementType(theElement)
+ assert(elementType == "player" or elementType == "ped" or elementType == "object" or elementType == "vehicle" or elementType == "projectile", "Invalid element type @ getElementSpeed (player/ped/object/vehicle/projectile expected, got " .. elementType .. ")")
+ assert((unit == nil or type(unit) == "string" or type(unit) == "number") and (unit == nil or (tonumber(unit) and (tonumber(unit) == 0 or tonumber(unit) == 1 or tonumber(unit) == 2)) or unit == "m/s" or unit == "km/h" or unit == "mph"), "Bad argument 2 @ getElementSpeed (invalid speed unit)")
+ -- Default to m/s if no unit specified and 'ignore' argument type if the string contains a number
+ unit = unit == nil and 0 or ((not tonumber(unit)) and unit or tonumber(unit))
+ -- Setup our multiplier to convert the velocity to the specified unit
+ local mult = (unit == 0 or unit == "m/s") and 50 or ((unit == 1 or unit == "km/h") and 180 or 111.84681456)
+ -- Return the speed by calculating the length of the velocity vector, after converting the velocity to the specified unit
+ return (Vector3(getElementVelocity(theElement)) * mult).length
+end
\ No newline at end of file
diff --git a/[vehicles]/avelocity/meta.xml b/[vehicles]/avelocity/meta.xml
new file mode 100644
index 0000000..602d40c
--- /dev/null
+++ b/[vehicles]/avelocity/meta.xml
@@ -0,0 +1,3 @@
+
+
+
diff --git a/[vehicles]/camshake/client.lua b/[vehicles]/camshake/client.lua
new file mode 100644
index 0000000..5aaa13f
--- /dev/null
+++ b/[vehicles]/camshake/client.lua
@@ -0,0 +1,34 @@
+local sx,sy = guiGetScreenSize()
+local ss = dxCreateScreenSource(sx,sy)
+function loop(ts)
+ if getPedOccupiedVehicle(localPlayer) then
+ dxUpdateScreenSource(ss)
+ local veh = getPedOccupiedVehicle(localPlayer)
+ local speed = getElementSpeed(veh)
+ local offsetX = math.round((math.random() - 1.5) * ((speed / 80) * (sx/1280)))
+ local offsetY = math.round((math.random() - 1.5) * ((speed / 80) * (sx/1280)))
+ dxDrawImage(offsetX,offsetY,sx,sy,ss)
+ end
+end
+addEventHandler("onClientPreRender",root,loop)
+
+function getElementSpeed(theElement, unit)
+ -- Check arguments for errors
+ assert(isElement(theElement), "Bad argument 1 @ getElementSpeed (element expected, got " .. type(theElement) .. ")")
+ local elementType = getElementType(theElement)
+ assert(elementType == "player" or elementType == "ped" or elementType == "object" or elementType == "vehicle" or elementType == "projectile", "Invalid element type @ getElementSpeed (player/ped/object/vehicle/projectile expected, got " .. elementType .. ")")
+ assert((unit == nil or type(unit) == "string" or type(unit) == "number") and (unit == nil or (tonumber(unit) and (tonumber(unit) == 0 or tonumber(unit) == 1 or tonumber(unit) == 2)) or unit == "m/s" or unit == "km/h" or unit == "mph"), "Bad argument 2 @ getElementSpeed (invalid speed unit)")
+ -- Default to m/s if no unit specified and 'ignore' argument type if the string contains a number
+ unit = unit == nil and 0 or ((not tonumber(unit)) and unit or tonumber(unit))
+ -- Setup our multiplier to convert the velocity to the specified unit
+ local mult = (unit == 0 or unit == "m/s") and 50 or ((unit == 1 or unit == "km/h") and 180 or 111.84681456)
+ -- Return the speed by calculating the length of the velocity vector, after converting the velocity to the specified unit
+ return (Vector3(getElementVelocity(theElement)) * mult).length
+end
+
+function math.round(num, decimals)
+ decimals = math.pow(10, decimals or 0)
+ num = num * decimals
+ if num >= 0 then num = math.floor(num + 0.5) else num = math.ceil(num - 0.5) end
+ return num / decimals
+end
\ No newline at end of file
diff --git a/[vehicles]/camshake/meta.xml b/[vehicles]/camshake/meta.xml
new file mode 100644
index 0000000..602d40c
--- /dev/null
+++ b/[vehicles]/camshake/meta.xml
@@ -0,0 +1,3 @@
+
+
+