| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526 |
- // Weapon-Config by Slice.
- // Modified for NG:RP's script by Jingles.
- enum E_SHOT_INFO {
- acl_Tick,
- acl_Weapon,
- acl_HitType,
- acl_HitId,
- acl_Hits,
- Float:acl_fPos[3],
- Float:acl_fTargetPos[3],
- Float:acl_fOrigin[3],
- Float:acl_fHitPos[3],
- Float:acl_fDistance,
- bool:acl_Valid,
- }
- static ac_LagCompMode;
- static ac_LastUpdate[MAX_PLAYERS] = {-1, ...};
- static ac_RejectedHitsIdx[MAX_PLAYERS];
- static ac_iCBugFreeze[MAX_PLAYERS];
- static ac_MaxShootRateSamples = 5;
- //static ac_MaxHitRateSamples = 5;
- static arrLastBulletData[MAX_PLAYERS][E_SHOT_INFO];
- static ac_LastBulletIdx[MAX_PLAYERS];
- static ac_LastBulletTicks[MAX_PLAYERS][10];
- static ac_LastBulletWeapons[MAX_PLAYERS][10];
- static ac_LastExplosive[MAX_PLAYERS];
- static ac_LastHitTicks[MAX_PLAYERS][10];
- static ac_LastHitWeapons[MAX_PLAYERS][10];
- static ac_LastHitIdx[MAX_PLAYERS];
- static Float:ac_PlayerMaxHealth[MAX_PLAYERS] = {100.0, ...};
- //static Float:ac_PlayerMaxArmour[MAX_PLAYERS] = {100.0, ...};
- //static ac_LastSentHealth[MAX_PLAYERS];
- //static ac_LastSentArmour[MAX_PLAYERS];
- //static bool:ac_DamageArmourToggle[2] = {false, ...};
- //static Float:ac_DamageDoneHealth[MAX_PLAYERS];
- //static Float:ac_DamageDoneArmour[MAX_PLAYERS];
- // The fastest possible gap between weapon shots in milliseconds
- static ac_MaxWeaponShootRate[] = {
- 250, // 0 - Fist
- 250, // 1 - Brass knuckles
- 250, // 2 - Golf club
- 250, // 3 - Nitestick
- 250, // 4 - Knife
- 250, // 5 - Bat
- 250, // 6 - Shovel
- 250, // 7 - Pool cue
- 250, // 8 - Katana
- 30, // 9 - Chainsaw
- 250, // 10 - Dildo
- 250, // 11 - Dildo 2
- 250, // 12 - Vibrator
- 250, // 13 - Vibrator 2
- 250, // 14 - Flowers
- 250, // 15 - Cane
- 0, // 16 - Grenade
- 0, // 17 - Teargas
- 0, // 18 - Molotov
- 20, // 19 - Vehicle M4 (custom)
- 20, // 20 - Vehicle minigun (custom)
- 0, // 21
- 160, // 22 - Colt 45
- 120, // 23 - Silenced
- 120, // 24 - Deagle
- 800, // 25 - Shotgun
- 120, // 26 - Sawed-off
- 120, // 27 - Spas
- 50, // 28 - UZI
- 90, // 29 - MP5
- 90, // 30 - AK47
- 90, // 31 - M4
- 70, // 32 - Tec9
- 800, // 33 - Cuntgun
- 900, // 34 - Sniper
- 0, // 35 - Rocket launcher
- 0, // 36 - Heatseeker
- 0, // 37 - Flamethrower
- 20, // 38 - Minigun
- 0, // 39 - Satchel
- 0, // 40 - Detonator
- 10, // 41 - Spraycan
- 10, // 42 - Fire extinguisher
- 0, // 43 - Camera
- 0, // 44 - Night vision
- 0, // 45 - Infrared
- 0, // 46 - Parachute
- 0, // 47 - Fake pistol
- 400 // 48 - Pistol whip (custom)
- };
- // Max continuous shots.
- static ac_MaxWeaponContShots[] = {
- 0, // 0 - Fist
- 0, // 1 - Brass knuckles
- 0, // 2 - Golf club
- 0, // 3 - Nitestick
- 0, // 4 - Knife
- 0, // 5 - Bat
- 0, // 6 - Shovel
- 0, // 7 - Pool cue
- 0, // 8 - Katana
- 0, // 9 - Chainsaw
- 0, // 10 - Dildo
- 0, // 11 - Dildo 2
- 0, // 12 - Vibrator
- 0, // 13 - Vibrator 2
- 0, // 14 - Flowers
- 0, // 15 - Cane
- 0, // 16 - Grenade
- 0, // 17 - Teargas
- 0, // 18 - Molotov
- 0, // 19 - Vehicle M4 (custom)
- 0, // 20 - Vehicle minigun (custom)
- 0, // 21
- 10, // 22 - Colt 45
- 10, // 23 - Silenced
- 10, // 24 - Deagle
- 10, // 25 - Shotgun
- 20, // 26 - Sawed-off
- 20, // 27 - Spas
- 30, // 28 - UZI
- 30, // 29 - MP5
- 30, // 30 - AK47
- 30, // 31 - M4
- 30, // 32 - Tec9
- 10, // 33 - Cuntgun
- 10, // 34 - Sniper
- 0, // 35 - Rocket launcher
- 0, // 36 - Heatseeker
- 0, // 37 - Flamethrower
- 400, // 38 - Minigun
- 0, // 39 - Satchel
- 0, // 40 - Detonator
- 0, // 41 - Spraycan
- 0, // 42 - Fire extinguisher
- 0, // 43 - Camera
- 0, // 44 - Night vision
- 0, // 45 - Infrared
- 0, // 46 - Parachute
- 0, // 47 - Fake pistol
- 0 // 48 - Pistol whip (custom)
- };
- // Whether the damage is applied directly to health (1) or is distributed between health and armour (0), and whether this rule applies only to the torso (1) or not (0)
- /*
- static ac_DamageArmour[][2] = {
- {0, 0}, // 0 - Fist
- {0, 0}, // 1 - Brass knuckles
- {0, 0}, // 2 - Golf club
- {0, 0}, // 3 - Nitestick
- {0, 0}, // 4 - Knife
- {0, 0}, // 5 - Bat
- {0, 0}, // 6 - Shovel
- {0, 0}, // 7 - Pool cue
- {0, 0}, // 8 - Katana
- {0, 0}, // 9 - Chainsaw
- {0, 0}, // 10 - Dildo
- {0, 0}, // 11 - Dildo 2
- {0, 0}, // 12 - Vibrator
- {0, 0}, // 13 - Vibrator 2
- {0, 0}, // 14 - Flowers
- {0, 0}, // 15 - Cane
- {0, 0}, // 16 - Grenade
- {0, 0}, // 17 - Teargas
- {0, 0}, // 18 - Molotov
- {1, 1}, // 19 - Vehicle M4 (custom)
- {1, 1}, // 20 - Vehicle minigun (custom)
- {1, 0}, // 21
- {1, 1}, // 22 - Colt 45
- {1, 1}, // 23 - Silenced
- {1, 1}, // 24 - Deagle
- {1, 1}, // 25 - Shotgun
- {1, 1}, // 26 - Sawed-off
- {1, 1}, // 27 - Spas
- {1, 1}, // 28 - UZI
- {1, 1}, // 29 - MP5
- {1, 1}, // 30 - AK47
- {1, 1}, // 31 - M4
- {1, 1}, // 32 - Tec9
- {1, 1}, // 33 - Cuntgun
- {1, 1}, // 34 - Sniper
- {0, 0}, // 35 - Rocket launcher
- {0, 0}, // 36 - Heatseeker
- {0, 0}, // 37 - Flamethrower
- {1, 1}, // 38 - Minigun
- {0, 0}, // 39 - Satchel
- {0, 0}, // 40 - Detonator
- {0, 0}, // 41 - Spraycan
- {0, 0}, // 42 - Fire extinguisher
- {1, 0}, // 43 - Camera
- {1, 0}, // 44 - Night vision
- {1, 0}, // 45 - Infrared
- {1, 0}, // 46 - Parachute
- {1, 0}, // 47 - Fake pistol
- {0, 0}, // 48 - Pistol whip (custom)
- {0, 0}, // 49 - Vehicle
- {0, 1}, // 50 - Helicopter blades
- {0, 0}, // 51 - Explosion
- {0, 0}, // 52 - Car park
- {0, 0}, // 53 - Drowning
- {0, 0} // 54 - Splat
- };
- */
- // Weapons allowed in OnPlayerGiveDamage
- static const ac_ValidDamageGiven[] = {
- 1, // 0 - Fist
- 1, // 1 - Brass knuckles
- 1, // 2 - Golf club
- 1, // 3 - Nitestick
- 1, // 4 - Knife
- 1, // 5 - Bat
- 1, // 6 - Shovel
- 1, // 7 - Pool cue
- 1, // 8 - Katana
- 1, // 9 - Chainsaw
- 1, // 10 - Dildo
- 1, // 11 - Dildo 2
- 1, // 12 - Vibrator
- 1, // 13 - Vibrator 2
- 1, // 14 - Flowers
- 1, // 15 - Cane
- 0, // 16 - Grenade
- 0, // 17 - Teargas
- 0, // 18 - Molotov
- 0, // 19 - Vehicle M4 (custom)
- 0, // 20 - Vehicle minigun
- 0, // 21
- 1, // 22 - Colt 45
- 1, // 23 - Silenced
- 1, // 24 - Deagle
- 1, // 25 - Shotgun
- 1, // 26 - Sawed-off
- 1, // 27 - Spas
- 1, // 28 - UZI
- 1, // 29 - MP5
- 1, // 30 - AK47
- 1, // 31 - M4
- 1, // 32 - Tec9
- 1, // 33 - Cuntgun
- 1, // 34 - Sniper
- 0, // 35 - Rocket launcher
- 0, // 36 - Heatseeker
- 0, // 37 - Flamethrower
- 1, // 38 - Minigun
- 0, // 39 - Satchel
- 0, // 40 - Detonator
- 1, // 41 - Spraycan
- 1, // 42 - Fire extinguisher
- 0, // 43 - Camera
- 0, // 44 - Night vision
- 0, // 45 - Infrared
- 1 // 46 - Parachute
- };
- // Weapons allowed in OnPlayerTakeDamage
- // 2 = valid in both OnPlayerGiveDamage and OnPlayerTakeDamage
- static const ac_ValidDamageTaken[] = {
- 1, // 0 - Fist
- 1, // 1 - Brass knuckles
- 1, // 2 - Golf club
- 1, // 3 - Nitestick
- 1, // 4 - Knife
- 1, // 5 - Bat
- 1, // 6 - Shovel
- 1, // 7 - Pool cue
- 1, // 8 - Katana
- 1, // 9 - Chainsaw
- 1, // 10 - Dildo
- 1, // 11 - Dildo 2
- 1, // 12 - Vibrator
- 1, // 13 - Vibrator 2
- 1, // 14 - Flowers
- 1, // 15 - Cane
- 0, // 16 - Grenade
- 0, // 17 - Teargas
- 0, // 18 - Molotov
- 0, // 19 - Vehicle M4 (custom)
- 0, // 20 - Vehicle minigun (custom)
- 0, // 21
- 1, // 22 - Colt 45
- 1, // 23 - Silenced
- 1, // 24 - Deagle
- 1, // 25 - Shotgun
- 1, // 26 - Sawed-off
- 1, // 27 - Spas
- 1, // 28 - UZI
- 1, // 29 - MP5
- 1, // 30 - AK47
- 1, // 31 - M4
- 1, // 32 - Tec9
- 1, // 33 - Cuntgun
- 1, // 34 - Sniper
- 0, // 35 - Rocket launcher
- 0, // 36 - Heatseeker
- 2, // 37 - Flamethrower
- 1, // 38 - Minigun
- 0, // 39 - Satchel
- 0, // 40 - Detonator
- 1, // 41 - Spraycan
- 1, // 42 - Fire extinguisher
- 0, // 43 - Camera
- 0, // 44 - Night vision
- 0, // 45 - Infrared
- 1, // 46 - Parachute
- 0, // 47 - Fake pistol
- 0, // 48 - Pistol whip (custom)
- 2, // 49 - Vehicle
- 2, // 50 - Helicopter blades
- 2, // 51 - Explosion
- 0, // 52 - Car park (custom)
- 2, // 53 - Drowning
- 2 // 54 - Splat
- };
- //#assert DAMAGE_TYPE_MULTIPLIER == 0
- //#assert DAMAGE_TYPE_STATIC == 1
- // Whether the damage is multiplied by the given/taken value (0) or always the same value (1)
- /*
- static ac_DamageType[] = {
- 0, // 0 - Fist
- 0, // 1 - Brass knuckles
- 0, // 2 - Golf club
- 0, // 3 - Nitestick
- 0, // 4 - Knife
- 0, // 5 - Bat
- 0, // 6 - Shovel
- 0, // 7 - Pool cue
- 0, // 8 - Katana
- 0, // 9 - Chainsaw
- 0, // 10 - Dildo
- 0, // 11 - Dildo 2
- 0, // 12 - Vibrator
- 0, // 13 - Vibrator 2
- 0, // 14 - Flowers
- 0, // 15 - Cane
- 0, // 16 - Grenade
- 1, // 17 - Teargas
- 0, // 18 - Molotov
- 1, // 19 - Vehicle M4 (custom)
- 1, // 20 - Vehicle minigun (custom)
- 0, // 21
- 1, // 22 - Colt 45
- 1, // 23 - Silenced
- 1, // 24 - Deagle
- 1, // 25 - Shotgun
- 1, // 26 - Sawed-off
- 1, // 27 - Spas
- 1, // 28 - UZI
- 1, // 29 - MP5
- 1, // 30 - AK47
- 1, // 31 - M4
- 1, // 32 - Tec9
- 1, // 33 - Cuntgun
- 1, // 34 - Sniper
- 0, // 35 - Rocket launcher
- 0, // 36 - Heatseeker
- 0, // 37 - Flamethrower
- 1, // 38 - Minigun
- 0, // 39 - Satchel
- 0, // 40 - Detonator
- 1, // 41 - Spraycan
- 1, // 42 - Fire extinguisher
- 0, // 43 - Camera
- 0, // 44 - Night vision
- 0, // 45 - Infrared
- 0, // 46 - Parachute
- 0, // 47 - Fake pistol
- 1, // 48 - Pistol whip (custom)
- 1, // 49 - Vehicle
- 1, // 50 - Helicopter blades
- 0, // 51 - Explosion
- 0, // 52 - Car park
- 0, // 53 - Drowning
- 0 // 54 - Splat
- };
- */
- // The default weapon range (from weapon.dat)
- // Note that due to various bugs, these can be exceeded, but
- // this include blocks out-of-range values.
- static Float:ac_WeaponRange[] = {
- 0.0, // 0 - Fist
- 0.0, // 1 - Brass knuckles
- 0.0, // 2 - Golf club
- 0.0, // 3 - Nitestick
- 0.0, // 4 - Knife
- 0.0, // 5 - Bat
- 0.0, // 6 - Shovel
- 0.0, // 7 - Pool cue
- 0.0, // 8 - Katana
- 0.0, // 9 - Chainsaw
- 0.0, // 10 - Dildo
- 0.0, // 11 - Dildo 2
- 0.0, // 12 - Vibrator
- 0.0, // 13 - Vibrator 2
- 0.0, // 14 - Flowers
- 0.0, // 15 - Cane
- 0.0, // 16 - Grenade
- 0.0, // 17 - Teargas
- 0.0, // 18 - Molotov
- 90.0, // 19 - Vehicle M4 (custom)
- 75.0, // 20 - Vehicle minigun (custom)
- 0.0, // 21
- 35.0, // 22 - Colt 45
- 35.0, // 23 - Silenced
- 35.0, // 24 - Deagle
- 40.0, // 25 - Shotgun
- 35.0, // 26 - Sawed-off
- 40.0, // 27 - Spas
- 35.0, // 28 - UZI
- 45.0, // 29 - MP5
- 70.0, // 30 - AK47
- 90.0, // 31 - M4
- 35.0, // 32 - Tec9
- 100.0, // 33 - Cuntgun
- 320.0, // 34 - Sniper
- 0.0, // 35 - Rocket launcher
- 0.0, // 36 - Heatseeker
- 0.0, // 37 - Flamethrower
- 75.0 // 38 - Minigun
- };
- /*
- enum {
- AC_NO_ERROR,
- AC_NO_ISSUER,
- AC_NO_DAMAGED,
- AC_INVALID_DAMAGE,
- AC_INVALID_DISTANCE
- }
- */
- /*
- enum {
- DAMAGE_TYPE_MULTIPLIER,
- DAMAGE_TYPE_STATIC,
- DAMAGE_TYPE_RANGE_MULTIPLIER,
- DAMAGE_TYPE_RANGE
- }
- */
- enum {
- HIT_NO_DAMAGEDID,
- HIT_INVALID_WEAPON,
- HIT_LAST_SHOT_INVALID,
- HIT_MULTIPLE_PLAYERS,
- HIT_MULTIPLE_PLAYERS_SHOTGUN,
- HIT_DYING_PLAYER,
- HIT_SAME_TEAM,
- HIT_UNSTREAMED,
- HIT_INVALID_HITTYPE,
- HIT_BEING_RESYNCED,
- HIT_NOT_SPAWNED,
- HIT_OUT_OF_RANGE,
- HIT_TOO_FAR_FROM_SHOT,
- SHOOTING_RATE_TOO_FAST,
- SHOOTING_RATE_TOO_FAST_MULTIPLE,
- HIT_RATE_TOO_FAST,
- HIT_RATE_TOO_FAST_MULTIPLE,
- HIT_KNIFE_FAILED,
- HIT_TOO_FAR_FROM_ORIGIN,
- HIT_INVALID_DAMAGE,
- HIT_SAME_VEHICLE,
- HIT_OWN_VEHICLE,
- HIT_INVALID_VEHICLE,
- HIT_DISCONNECTED
- }
- // Must be in sync with the enum above
- // Used in debug messages and GetRejectedHit
- stock const g_HitRejectReasons[][] = {
- "None or invalid player shot",
- "Invalid weapon",
- "Last shot invalid",
- "One bullet hit %d players",
- "Hit too many players with shotgun: %d",
- "Hit a dying player",
- "Hit a teammate",
- "Hit someone that can't see you (not streamed in)",
- "Invalid hit type: %d",
- "Hit while being resynced",
- "Hit when not spawned or dying",
- "Hit out of range (%f > %f)",
- "Hit player too far from hit position (dist %f)",
- "Shooting rate too fast: %d (%d samples, max %d)",
- "Shooting rate too fast: %d (%d samples, multiple weapons)",
- "Hit rate too fast: %d (%d samples, max %d)",
- "Hit rate too fast: %d (%d samples, multiple weapons)",
- "The knife kill did not sync",
- "Damage inflicted too far from current position (dist %f)",
- "Invalid weapon damage (%.4f)",
- "Hit a player in the same vehicle",
- "Hit the vehicle you're in",
- "Hit invalid vehicle: %d",
- "Hit a disconnected player ID: %d"
- };
- stock const g_WeaponName[57][59] = {
- {"Fist" }, {"Brass knuckles"}, {"Golf club" },
- {"Nightstick" }, {"Knife" }, {"Bat" },
- {"Shovel" }, {"Pool cue" }, {"Katana" },
- {"Chainsaw" }, {"Purple dildo" }, {"Dildo" },
- {"Vibrator" }, {"Vibrator" }, {"Flowers" },
- {"Cane" }, {"Grenade" }, {"Tear gas" },
- {"Molotov" }, {"Vehicle gun" }, {"Vehicle gun" },
- {"" }, {"Colt 45" }, {"Silenced pistol" },
- {"Deagle" }, {"Shotgun" }, {"Sawn-off shotgun" },
- {"Combat shotgun" }, {"Mac-10" }, {"MP5" },
- {"AK-47" }, {"M4" }, {"Tec-9" },
- {"Cuntgun" }, {"Sniper" }, {"Rocket launcher" },
- {"Heat seeking RPG" }, {"Flamethrower" }, {"Minigun" },
- {"Satchel" }, {"Detonator" }, {"Spraycan" },
- {"Fire extinguisher"}, {"Camera" }, {"Night vision goggles"},
- {"Infrared goggles" }, {"Parachute" }, {"Fake pistol" },
- {"Pistol whip" }, {"Vehicle" }, {"Helicopter blades" },
- {"Explosion" }, {"Car parking" }, {"Drowning" },
- {"Collision" }, {"Splat" }, {"Unknown" }
- };
|