Skip to content

Commit

Permalink
Multi-Seat Vehicles (#856)
Browse files Browse the repository at this point in the history
* Multi-Seat Vehicles

* Range

* HITBOXES

* God

* E

* No Void

* o

* e

* Hmm

* Custom Cars
  • Loading branch information
Batfoxkid authored Feb 11, 2025
1 parent d24fdb0 commit 760607d
Show file tree
Hide file tree
Showing 24 changed files with 2,473 additions and 117 deletions.
98 changes: 97 additions & 1 deletion addons/sourcemod/configs/zombie_riot/downloads.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
{
"base" ""
"zombieriot" ""
"rogue" ""
//"rogue" ""
//"construction" ""
"panzer" ""
"sawrunner" ""
"l4dtank" ""
Expand Down Expand Up @@ -849,5 +850,100 @@
"materials/models/zombie_riot/hl2/mini_skin_exponent.vtf" ""
"materials/models/zombie_riot/hl2/mini_skin_normal.vtf" ""
}
"construction"
{
"models/vehicles/ambulance.dx80.vtx" ""
"models/vehicles/ambulance.dx90.vtx" ""
"models/vehicles/ambulance.mdl" ""
"models/vehicles/ambulance.phy" ""
"models/vehicles/ambulance.vvd" ""
"models/vehicles/bus001.dx80.vtx" ""
"models/vehicles/bus001.dx90.vtx" ""
"models/vehicles/bus001.mdl" ""
"models/vehicles/bus001.phy" ""
"models/vehicles/bus001.vvd" ""
"models/vehicles/camper.dx80.vtx" ""
"models/vehicles/camper.dx90.vtx" ""
"models/vehicles/camper.mdl" ""
"models/vehicles/camper.phy" ""
"models/vehicles/camper.vvd" ""
"models/vehicles/dumptruck.dx80.vtx" ""
"models/vehicles/dumptruck.dx90.vtx" ""
"models/vehicles/dumptruck.mdl" ""
"models/vehicles/dumptruck.phy" ""
"models/vehicles/dumptruck.vvd" ""
"models/vehicles/dumptruck_empty_v2.dx80.vtx" ""
"models/vehicles/dumptruck_empty_v2.dx90.vtx" ""
"models/vehicles/dumptruck_empty_v2.mdl" ""
"models/vehicles/dumptruck_empty_v2.phy" ""
"models/vehicles/dumptruck_empty_v2.vvd" ""
"models/vehicles/landrover.dx80.vtx" ""
"models/vehicles/landrover.dx90.vtx" ""
"models/vehicles/landrover.mdl" ""
"models/vehicles/landrover.phy" ""
"models/vehicles/landrover.vvd" ""
"models/vehicles/pickup03.dx80.vtx" ""
"models/vehicles/pickup03.dx90.vtx" ""
"models/vehicles/pickup03.mdl" ""
"models/vehicles/pickup03.phy" ""
"models/vehicles/pickup03.vvd" ""
"materials/models/vehicles/amb_blu.vmt" ""
"materials/models/vehicles/amb_blu.vtf" ""
"materials/models/vehicles/amb_red.vmt" ""
"materials/models/vehicles/amb_red.vtf" ""
"materials/models/vehicles/amb_spec.vtf" ""
"materials/models/vehicles/body.vmt" ""
"materials/models/vehicles/body.vtf" ""
"materials/models/vehicles/body_exp.vtf" ""
"materials/models/vehicles/body_height.vtf" ""
"materials/models/vehicles/body_normal.vtf" ""
"materials/models/vehicles/bus_skin1.vmt" ""
"materials/models/vehicles/bus_skin1.vtf" ""
"materials/models/vehicles/bus_skin2.vmt" ""
"materials/models/vehicles/bus_skin2.vtf" ""
"materials/models/vehicles/camper.vmt" ""
"materials/models/vehicles/camper.vtf" ""
"materials/models/vehicles/camper_exp.vtf" ""
"materials/models/vehicles/camper_normal.vtf" ""
"materials/models/vehicles/citizen_body.vmt" ""
"materials/models/vehicles/citizen_body.vtf" ""
"materials/models/vehicles/citizen_head.vmt" ""
"materials/models/vehicles/citizen_head.vtf" ""
"materials/models/vehicles/details.vmt" ""
"materials/models/vehicles/details.vtf" ""
"materials/models/vehicles/dumptruck.vmt" ""
"materials/models/vehicles/dumptruck.vtf" ""
"materials/models/vehicles/dumptruck_normal.vtf" ""
"materials/models/vehicles/hand_lightwarp.vtf" ""
"materials/models/vehicles/interior.vmt" ""
"materials/models/vehicles/interior.vtf" ""
"materials/models/vehicles/interior_exp.vtf" ""
"materials/models/vehicles/interior_normal.vtf" ""
"materials/models/vehicles/landrover.vmt" ""
"materials/models/vehicles/landrover.vtf" ""
"materials/models/vehicles/landrover_normal.vtf" ""
"materials/models/vehicles/landrover2.vmt" ""
"materials/models/vehicles/landrover2.vtf" ""
"materials/models/vehicles/landrover3.vmt" ""
"materials/models/vehicles/landrover3.vtf" ""
"materials/models/vehicles/pickup_lightwarp.vtf" ""
"materials/models/vehicles/pickup03.vmt" ""
"materials/models/vehicles/pickup03.vtf" ""
"materials/models/vehicles/pickup04.vmt" ""
"materials/models/vehicles/pickup04.vtf" ""
"materials/models/vehicles/rear_sticker.vmt" ""
"materials/models/vehicles/rear_sticker.vtf" ""
"materials/models/vehicles/w_sniperrifle_normal.vtf" ""
"materials/models/vehicles/w_sniperrifle01.vmt" ""
"materials/models/vehicles/w_sniperrifle01.vtf" ""
"materials/models/vehicles/weapon_lightwarp.vtf" ""
"materials/models/vehicles/wheels.vmt" ""
"materials/models/vehicles/wheels.vtf" ""
"materials/models/vehicles/wheels_exp.vtf" ""
"materials/models/vehicles/wheels_normal.vtf" ""
"materials/models/vehicles/windshield.vmt" ""
"materials/models/vehicles/windshield.vtf" ""
"materials/models/vehicles/windshield_normal.vtf" ""
}
}
}
11 changes: 4 additions & 7 deletions addons/sourcemod/scripting/shared/core.sp
Original file line number Diff line number Diff line change
Expand Up @@ -1146,6 +1146,7 @@ public void OnMapEnd()
OnRoundEnd(null, NULL_STRING, false);
Waves_MapEnd();
Spawns_MapEnd();
Vehicle_MapEnd();
#endif

#if defined RPG
Expand Down Expand Up @@ -2193,11 +2194,7 @@ public void OnEntityCreated(int entity, const char[] classname)
StatusEffectReset(entity);
f_InBattleDelay[entity] = 0.0;
b_AllowCollideWithSelfTeam[entity] = false;
func_NPCDeath[entity] = INVALID_FUNCTION;
func_NPCOnTakeDamage[entity] = INVALID_FUNCTION;
func_NPCThink[entity] = INVALID_FUNCTION;
func_NPCDeathForward[entity] = INVALID_FUNCTION;
func_NPCFuncWin[entity] = INVALID_FUNCTION;
NPCStats_SetFuncsToZero(entity);
f3_VecTeleportBackSave_OutOfBounds[entity][0] = 0.0;
f3_VecTeleportBackSave_OutOfBounds[entity][1] = 0.0;
f3_VecTeleportBackSave_OutOfBounds[entity][2] = 0.0;
Expand Down Expand Up @@ -3070,7 +3067,7 @@ stock bool InteractKey(int client, int weapon, bool Is_Reload_Button = false)
#endif

#if defined ZR
if(Vehicle_Interact(client, entity))
if(Vehicle_Interact(client, weapon, entity))
return true;

static char buffer[64];
Expand Down Expand Up @@ -3133,7 +3130,7 @@ stock bool InteractKey(int client, int weapon, bool Is_Reload_Button = false)
{

#if defined ZR
if(GetEntityMoveType(client) == MOVETYPE_NONE && Vehicle_Interact(client, entity))
if(GetEntityMoveType(client) == MOVETYPE_NONE && Vehicle_Interact(client, weapon, entity))
return true;
#endif

Expand Down
15 changes: 15 additions & 0 deletions addons/sourcemod/scripting/shared/damage.sp
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,21 @@ stock bool Damage_PlayerVictim(int victim, int &attacker, int &inflictor, float
damage *= percentage;
}
}

{
int vehicle = Vehicle_Driver(victim);
if(vehicle != -1)
{
// Driver
damage *= 0.5;

if(!(damagetype & DMG_TRUEDAMAGE) && Vehicle_Driver(vehicle) != victim)
{
// Passenger
damage *= 0.2;
}
}
}
#endif // ZR

#if defined RPG
Expand Down
10 changes: 9 additions & 1 deletion addons/sourcemod/scripting/shared/npc_stats.sp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ Function func_NPCFuncWin[MAXENTITIES];
Function func_NPCAnimEvent[MAXENTITIES];
Function func_NPCActorEmoted[MAXENTITIES];
Function func_NPCInteract[MAXENTITIES];
Function FuncShowInteractHud[MAXENTITIES];

#define PARTICLE_ROCKET_MODEL "models/weapons/w_models/w_drg_ball.mdl" //This will accept particles and also hide itself.

Expand Down Expand Up @@ -2520,6 +2521,12 @@ methodmap CClotBody < CBaseCombatCharacter
}
}

if(i_IsVehicle[target])
{
// Vehicle hitboxes
return this.DoAimbotTrace(trace, target, vecSwingMaxs, vecSwingMins, vecSwingStartOffset);
}

float eyePitch[3];
GetEntPropVector(this.index, Prop_Data, "m_angRotation", eyePitch);

Expand All @@ -2528,7 +2535,7 @@ methodmap CClotBody < CBaseCombatCharacter
WorldSpaceCenter(target, vecTarget);
if(target <= MaxClients)
vecTarget[2] += 10.0; //abit extra as they will most likely always shoot upwards more then downwards

WorldSpaceCenter(this.index, vecForward);
MakeVectorFromPoints(vecForward, vecTarget, vecForward);
GetVectorAngles(vecForward, vecForward);
Expand Down Expand Up @@ -8386,6 +8393,7 @@ public void NPCStats_SetFuncsToZero(int entity)
func_NPCAnimEvent[entity] = INVALID_FUNCTION;
func_NPCActorEmoted[entity] = INVALID_FUNCTION;
func_NPCInteract[entity] = INVALID_FUNCTION;
FuncShowInteractHud[entity] = INVALID_FUNCTION;
}
public void SetDefaultValuesToZeroNPC(int entity)
{
Expand Down
49 changes: 0 additions & 49 deletions addons/sourcemod/scripting/shared/vehicles/vehicle_fulljeep.sp

This file was deleted.

21 changes: 5 additions & 16 deletions addons/sourcemod/scripting/shared/vehicles/vehicle_hl2.sp
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,7 @@ static void ClotPrecache()
{
PrecacheModel("models/buggy.mdl");
PrecacheModel("models/airboat.mdl");

if(LibraryExists("LoadSoundscript"))
{
char soundname[256];
SoundScript soundscript = LoadSoundScript("scripts/game_sounds_vehicles.txt");
for(int i = 0; i < soundscript.Count; i++)
{
SoundEntry entry = soundscript.GetSound(i);
entry.GetName(soundname, sizeof(soundname));
PrecacheScriptSound(soundname);
}
}
Vehicle_PrecacheSounds();
}

static any ClotSummonJeep(int client, float vecPos[3], float vecAng[3])
Expand All @@ -46,9 +35,9 @@ methodmap VehicleJeep < VehicleGeneric
{
public VehicleJeep(const float vecPos[3], const float vecAng[3])
{
VehicleJeep npc = view_as<VehicleJeep>(VehicleGeneric(vecPos, vecAng, VEHICLE_TYPE_CAR_WHEELS, "models/buggy.mdl", "scripts/vehicles/jeep_test.txt"));
VehicleJeep obj = view_as<VehicleJeep>(VehicleGeneric(vecPos, vecAng, VEHICLE_TYPE_CAR_WHEELS, "models/buggy.mdl", "scripts/vehicles/jeep_test.txt"));

return npc;
return obj;
}
}

Expand All @@ -61,8 +50,8 @@ methodmap VehicleAirboat < VehicleGeneric
{
public VehicleAirboat(const float vecPos[3], const float vecAng[3])
{
VehicleAirboat npc = view_as<VehicleAirboat>(VehicleGeneric(vecPos, vecAng, VEHICLE_TYPE_AIRBOAT_RAYCAST, "models/airboat.mdl", "scripts/vehicles/airboat.txt"));
VehicleAirboat obj = view_as<VehicleAirboat>(VehicleGeneric(vecPos, vecAng, VEHICLE_TYPE_AIRBOAT_RAYCAST, "models/airboat.mdl", "scripts/vehicles/airboat.txt"));

return npc;
return obj;
}
}
Loading

0 comments on commit 760607d

Please sign in to comment.