diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cairtank.txt b/gamedata/common.games/entities.games/cstrike/offsets-cairtank.txt new file mode 100644 index 00000000..31ccf016 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cairtank.txt @@ -0,0 +1,32 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CAirtank" + { + "Offsets" + { + "m_state" // int + { + "windows" "480" + "linux" "500" + "mac" "500" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cambientgeneric.txt b/gamedata/common.games/entities.games/cstrike/offsets-cambientgeneric.txt new file mode 100644 index 00000000..87291643 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cambientgeneric.txt @@ -0,0 +1,53 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CAmbientGeneric" + { + "Offsets" + { + "m_flAttenuation" // float + { + "windows" "136" + "linux" "152" + "mac" "152" + } + + "m_dpv" // dynpitchvol_t + { + "windows" "140" + "linux" "156" + "mac" "156" + } + + "m_fActive" // BOOL + { + "windows" "240" + "linux" "256" + "mac" "256" + } + + "m_fLooping" // BOOL + { + "windows" "244" + "linux" "260" + "mac" "260" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-carmoury.txt b/gamedata/common.games/entities.games/cstrike/offsets-carmoury.txt new file mode 100644 index 00000000..528b8790 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-carmoury.txt @@ -0,0 +1,53 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CArmoury" + { + "Offsets" + { + "m_iItem" // int + { + "windows" "136" + "linux" "152" + "mac" "152" + } + + "m_iCount" // int + { + "windows" "140" + "linux" "156" + "mac" "156" + } + + "m_iInitialCount" // int + { + "windows" "144" + "linux" "160" + "mac" "160" + } + + "m_bAlreadyCounted" // bool + { + "windows" "148" + "linux" "164" + "mac" "164" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-caug.txt b/gamedata/common.games/entities.games/cstrike/offsets-caug.txt new file mode 100644 index 00000000..11b1d4bd --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-caug.txt @@ -0,0 +1,46 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CAUG" + { + "Offsets" + { + "m_iShell" // int + { + "windows" "320" + "linux" "336" + "mac" "336" + } + + "iShellOn" // int + { + "windows" "324" + "linux" "340" + "mac" "340" + } + + "m_usFireAug" // short unsigned int + { + "windows" "328" + "linux" "344" + "mac" "344" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cawp.txt b/gamedata/common.games/entities.games/cstrike/offsets-cawp.txt new file mode 100644 index 00000000..d2904428 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cawp.txt @@ -0,0 +1,39 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CAWP" + { + "Offsets" + { + "m_iShell" // int + { + "windows" "320" + "linux" "336" + "mac" "336" + } + + "m_usFireAWP" // short unsigned int + { + "windows" "324" + "linux" "340" + "mac" "340" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cbaseanimating.txt b/gamedata/common.games/entities.games/cstrike/offsets-cbaseanimating.txt new file mode 100644 index 00000000..303e60e4 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cbaseanimating.txt @@ -0,0 +1,60 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CBaseAnimating" + { + "Offsets" + { + "m_flFrameRate" // float + { + "windows" "144" + "linux" "160" + "mac" "160" + } + + "m_flGroundSpeed" // float + { + "windows" "148" + "linux" "164" + "mac" "164" + } + + "m_flLastEventCheck" // float + { + "windows" "152" + "linux" "168" + "mac" "168" + } + + "m_fSequenceFinished" // BOOL + { + "windows" "156" + "linux" "172" + "mac" "172" + } + + "m_fSequenceLoops" // BOOL + { + "windows" "160" + "linux" "176" + "mac" "176" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cbasebutton.txt b/gamedata/common.games/entities.games/cstrike/offsets-cbasebutton.txt new file mode 100644 index 00000000..82586355 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cbasebutton.txt @@ -0,0 +1,88 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CBaseButton" + { + "Offsets" + { + "m_fStayPushed" // BOOL + { + "windows" "292" + "linux" "312" + "mac" "312" + } + + "m_fRotating" // BOOL + { + "windows" "296" + "linux" "316" + "mac" "316" + } + + "m_strChangeTarget" // string_t + { + "windows" "300" + "linux" "320" + "mac" "320" + } + + "m_ls" // locksound_t + { + "windows" "304" + "linux" "324" + "mac" "324" + } + + "m_bLockedSound" // BYTE + { + "windows" "340" + "linux" "360" + "mac" "360" + } + + "m_bLockedSentence" // BYTE + { + "windows" "341" + "linux" "361" + "mac" "361" + } + + "m_bUnlockedSound" // BYTE + { + "windows" "342" + "linux" "362" + "mac" "362" + } + + "m_bUnlockedSentence" // BYTE + { + "windows" "343" + "linux" "363" + "mac" "363" + } + + "m_sounds" // int + { + "windows" "344" + "linux" "364" + "mac" "364" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cbasedelay.txt b/gamedata/common.games/entities.games/cstrike/offsets-cbasedelay.txt new file mode 100644 index 00000000..855f86ce --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cbasedelay.txt @@ -0,0 +1,39 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CBaseDelay" + { + "Offsets" + { + "m_flDelay" // float + { + "windows" "136" + "linux" "152" + "mac" "152" + } + + "m_iszKillTarget" // int + { + "windows" "140" + "linux" "156" + "mac" "156" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cbasedoor.txt b/gamedata/common.games/entities.games/cstrike/offsets-cbasedoor.txt new file mode 100644 index 00000000..44dd41a6 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cbasedoor.txt @@ -0,0 +1,88 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CBaseDoor" + { + "Offsets" + { + "m_bHealthValue" // BYTE + { + "windows" "292" + "linux" "312" + "mac" "312" + } + + "m_bMoveSnd" // BYTE + { + "windows" "293" + "linux" "313" + "mac" "313" + } + + "m_bStopSnd" // BYTE + { + "windows" "294" + "linux" "314" + "mac" "314" + } + + "m_ls" // locksound_t + { + "windows" "296" + "linux" "316" + "mac" "316" + } + + "m_bLockedSound" // BYTE + { + "windows" "332" + "linux" "352" + "mac" "352" + } + + "m_bLockedSentence" // BYTE + { + "windows" "333" + "linux" "353" + "mac" "353" + } + + "m_bUnlockedSound" // BYTE + { + "windows" "334" + "linux" "354" + "mac" "354" + } + + "m_bUnlockedSentence" // BYTE + { + "windows" "335" + "linux" "355" + "mac" "355" + } + + "m_lastBlockedTimestamp" // float + { + "windows" "336" + "linux" "356" + "mac" "356" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cbaseentity.txt b/gamedata/common.games/entities.games/cstrike/offsets-cbaseentity.txt new file mode 100644 index 00000000..48db4806 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cbaseentity.txt @@ -0,0 +1,256 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CBaseEntity" + { + "Offsets" + { + "pev" // entvars_t* + { + "windows" "4" + "linux" "4" + "mac" "4" + } + + "m_pGoalEnt" // CBaseEntity* + { + "windows" "8" + "linux" "8" + "mac" "8" + } + + "m_pLink" // CBaseEntity* + { + "windows" "12" + "linux" "12" + "mac" "12" + } + + "m_pfnThink" // void* + { + "windows" "16" + "linux" "16" + "mac" "16" + } + + "m_pfnTouch" // void* + { + "windows" "20" + "linux" "24" + "mac" "24" + } + + "m_pfnUse" // void* + { + "windows" "24" + "linux" "32" + "mac" "32" + } + + "m_pfnBlocked" // void* + { + "windows" "28" + "linux" "40" + "mac" "40" + } + + "current_ammo" // int* + { + "windows" "32" + "linux" "48" + "mac" "48" + } + + "currentammo" // float + { + "windows" "36" + "linux" "52" + "mac" "52" + } + + "maxammo_buckshot" // int + { + "windows" "40" + "linux" "56" + "mac" "56" + } + + "ammo_buckshot" // int + { + "windows" "44" + "linux" "60" + "mac" "60" + } + + "maxammo_9mm" // int + { + "windows" "48" + "linux" "64" + "mac" "64" + } + + "ammo_9mm" // int + { + "windows" "52" + "linux" "68" + "mac" "68" + } + + "maxammo_556nato" // int + { + "windows" "56" + "linux" "72" + "mac" "72" + } + + "ammo_556nato" // int + { + "windows" "60" + "linux" "76" + "mac" "76" + } + + "maxammo_556natobox" // int + { + "windows" "64" + "linux" "80" + "mac" "80" + } + + "ammo_556natobox" // int + { + "windows" "68" + "linux" "84" + "mac" "84" + } + + "maxammo_762nato" // int + { + "windows" "72" + "linux" "88" + "mac" "88" + } + + "ammo_762nato" // int + { + "windows" "76" + "linux" "92" + "mac" "92" + } + + "maxammo_45acp" // int + { + "windows" "80" + "linux" "96" + "mac" "96" + } + + "ammo_45acp" // int + { + "windows" "84" + "linux" "100" + "mac" "100" + } + + "maxammo_50ae" // int + { + "windows" "88" + "linux" "104" + "mac" "104" + } + + "ammo_50ae" // int + { + "windows" "92" + "linux" "108" + "mac" "108" + } + + "maxammo_338mag" // int + { + "windows" "96" + "linux" "112" + "mac" "112" + } + + "ammo_338mag" // int + { + "windows" "100" + "linux" "116" + "mac" "116" + } + + "maxammo_57mm" // int + { + "windows" "104" + "linux" "120" + "mac" "120" + } + + "ammo_57mm" // int + { + "windows" "108" + "linux" "124" + "mac" "124" + } + + "maxammo_357sig" // int + { + "windows" "112" + "linux" "128" + "mac" "128" + } + + "ammo_357sig" // int + { + "windows" "116" + "linux" "132" + "mac" "132" + } + + "m_flStartThrow" // float + { + "windows" "120" + "linux" "136" + "mac" "136" + } + + "m_flReleaseThrow" // float + { + "windows" "124" + "linux" "140" + "mac" "140" + } + + "m_iSwing" // int + { + "windows" "128" + "linux" "144" + "mac" "144" + } + + "has_disconnected" // bool + { + "windows" "132" + "linux" "148" + "mac" "148" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cbasegrencatch.txt b/gamedata/common.games/entities.games/cstrike/offsets-cbasegrencatch.txt new file mode 100644 index 00000000..fdafd514 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cbasegrencatch.txt @@ -0,0 +1,60 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CBaseGrenCatch" + { + "Offsets" + { + "m_NeedGrenadeType" // int + { + "windows" "136" + "linux" "152" + "mac" "152" + } + + "sTriggerOnGrenade" // string_t + { + "windows" "140" + "linux" "156" + "mac" "156" + } + + "sDisableOnGrenade" // string_t + { + "windows" "144" + "linux" "160" + "mac" "160" + } + + "m_fSmokeTouching" // bool + { + "windows" "148" + "linux" "164" + "mac" "164" + } + + "m_fFlashTouched" // bool + { + "windows" "149" + "linux" "165" + "mac" "165" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cbasemonster.txt b/gamedata/common.games/entities.games/cstrike/offsets-cbasemonster.txt new file mode 100644 index 00000000..c055f3b2 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cbasemonster.txt @@ -0,0 +1,137 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CBaseMonster" + { + "Offsets" + { + "m_Activity" // Activity + { + "windows" "292" + "linux" "312" + "mac" "312" + } + + "m_IdealActivity" // Activity + { + "windows" "296" + "linux" "316" + "mac" "316" + } + + "m_LastHitGroup" // int + { + "windows" "300" + "linux" "320" + "mac" "320" + } + + "m_bitsDamageType" // int + { + "windows" "304" + "linux" "324" + "mac" "324" + } + + "m_rgbTimeBasedDamage" // unsigned char[8] + { + "windows" "308" + "linux" "328" + "mac" "328" + } + + "m_MonsterState" // MONSTERSTATE + { + "windows" "316" + "linux" "336" + "mac" "336" + } + + "m_IdealMonsterState" // MONSTERSTATE + { + "windows" "320" + "linux" "340" + "mac" "340" + } + + "m_afConditions" // int + { + "windows" "324" + "linux" "344" + "mac" "344" + } + + "m_afMemory" // int + { + "windows" "328" + "linux" "348" + "mac" "348" + } + + "m_flNextAttack" // float + { + "windows" "332" + "linux" "352" + "mac" "352" + } + + "m_hEnemy" // EHANDLE + { + "windows" "336" + "linux" "356" + "mac" "356" + } + + "m_hTargetEnt" // EHANDLE + { + "windows" "344" + "linux" "364" + "mac" "364" + } + + "m_flFieldOfView" // float + { + "windows" "352" + "linux" "372" + "mac" "372" + } + + "m_bloodColor" // int + { + "windows" "356" + "linux" "376" + "mac" "376" + } + + "m_HackedGunPos" // Vector + { + "windows" "360" + "linux" "380" + "mac" "380" + } + + "m_vecEnemyLKP" // Vector + { + "windows" "372" + "linux" "392" + "mac" "392" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cbaseplattrain.txt b/gamedata/common.games/entities.games/cstrike/offsets-cbaseplattrain.txt new file mode 100644 index 00000000..e2dcacc6 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cbaseplattrain.txt @@ -0,0 +1,46 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CBasePlatTrain" + { + "Offsets" + { + "m_bMoveSnd" // BYTE + { + "windows" "292" + "linux" "312" + "mac" "312" + } + + "m_bStopSnd" // BYTE + { + "windows" "293" + "linux" "313" + "mac" "313" + } + + "m_volume" // float + { + "windows" "296" + "linux" "316" + "mac" "316" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cbaseplayer.txt b/gamedata/common.games/entities.games/cstrike/offsets-cbaseplayer.txt new file mode 100644 index 00000000..a103a382 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cbaseplayer.txt @@ -0,0 +1,1341 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CBasePlayer" + { + "Offsets" + { + "random_seed" // int + { + "windows" "384" + "linux" "404" + "mac" "404" + } + + "m_usPlayerBleed" // short unsigned int + { + "windows" "388" + "linux" "408" + "mac" "408" + } + + "m_hObserverTarget" // EHANDLE + { + "windows" "392" + "linux" "412" + "mac" "412" + } + + "m_flNextObserverInput" // float + { + "windows" "400" + "linux" "420" + "mac" "420" + } + + "m_iObserverWeapon" // int + { + "windows" "404" + "linux" "424" + "mac" "424" + } + + "m_iObserverC4State" // int + { + "windows" "408" + "linux" "428" + "mac" "428" + } + + "m_bObserverHasDefuser" // bool + { + "windows" "412" + "linux" "432" + "mac" "432" + } + + "m_iObserverLastMode" // int + { + "windows" "416" + "linux" "436" + "mac" "436" + } + + "m_flFlinchTime" // float + { + "windows" "420" + "linux" "440" + "mac" "440" + } + + "m_flAnimTime" // float + { + "windows" "424" + "linux" "444" + "mac" "444" + } + + "m_bHighDamage" // bool + { + "windows" "428" + "linux" "448" + "mac" "448" + } + + "m_flVelocityModifier" // float + { + "windows" "432" + "linux" "452" + "mac" "452" + } + + "m_iLastZoom" // int + { + "windows" "436" + "linux" "456" + "mac" "456" + } + + "m_bResumeZoom" // bool + { + "windows" "440" + "linux" "460" + "mac" "460" + } + + "m_flEjectBrass" // float + { + "windows" "444" + "linux" "464" + "mac" "464" + } + + "m_iKevlar" // int + { + "windows" "448" + "linux" "468" + "mac" "468" + } + + "m_bNotKilled" // bool + { + "windows" "452" + "linux" "472" + "mac" "472" + } + + "m_iTeam" // enum TeamName + { + "windows" "456" + "linux" "476" + "mac" "476" + } + + "m_iAccount" // int + { + "windows" "460" + "linux" "480" + "mac" "480" + } + + "m_bHasPrimary" // bool + { + "windows" "464" + "linux" "484" + "mac" "484" + } + + "m_flDeathThrowTime" // float + { + "windows" "468" + "linux" "488" + "mac" "488" + } + + "m_iThrowDirection" // int + { + "windows" "472" + "linux" "492" + "mac" "492" + } + + "m_flLastTalk" // float + { + "windows" "476" + "linux" "496" + "mac" "496" + } + + "m_bJustConnected" // bool + { + "windows" "480" + "linux" "500" + "mac" "500" + } + + "m_bContextHelp" // bool + { + "windows" "481" + "linux" "501" + "mac" "501" + } + + "m_iJoiningState" // enum JoinState + { + "windows" "484" + "linux" "504" + "mac" "504" + } + + "m_pIntroCamera" // CBaseEntity* + { + "windows" "488" + "linux" "508" + "mac" "508" + } + + "m_fIntroCamTime" // float + { + "windows" "492" + "linux" "512" + "mac" "512" + } + + "m_fLastMovement" // float + { + "windows" "496" + "linux" "516" + "mac" "516" + } + + "m_bMissionBriefing" // bool + { + "windows" "500" + "linux" "520" + "mac" "520" + } + + "m_bTeamChanged" // bool + { + "windows" "501" + "linux" "521" + "mac" "521" + } + + "m_iModelName" // enum ModelName + { + "windows" "504" + "linux" "524" + "mac" "524" + } + + "m_iTeamKills" // int + { + "windows" "508" + "linux" "528" + "mac" "528" + } + + "m_iIgnoreGlobalChat" // int + { + "windows" "512" + "linux" "532" + "mac" "532" + } + + "m_bHasNightVision" // bool + { + "windows" "516" + "linux" "536" + "mac" "536" + } + + "m_bNightVisionOn" // bool + { + "windows" "517" + "linux" "537" + "mac" "537" + } + + "m_vRecentPath" // Vector[20] + { + "windows" "520" + "linux" "540" + "mac" "540" + } + + "m_flIdleCheckTime" // float + { + "windows" "760" + "linux" "780" + "mac" "780" + } + + "m_flRadioTime" // float + { + "windows" "764" + "linux" "784" + "mac" "784" + } + + "m_iRadioMessages" // int + { + "windows" "768" + "linux" "788" + "mac" "788" + } + + "m_bIgnoreRadio" // bool + { + "windows" "772" + "linux" "792" + "mac" "792" + } + + "m_bHasC4" // bool + { + "windows" "773" + "linux" "793" + "mac" "793" + } + + "m_bHasDefuser" // bool + { + "windows" "774" + "linux" "794" + "mac" "794" + } + + "m_bKilledByBomb" // bool + { + "windows" "775" + "linux" "795" + "mac" "795" + } + + "m_vBlastVector" // Vector + { + "windows" "776" + "linux" "796" + "mac" "796" + } + + "m_bKilledByGrenade" // bool + { + "windows" "788" + "linux" "808" + "mac" "808" + } + + "m_hintMessageQueue" // CHintMessageQueue + { + "windows" "792" + "linux" "812" + "mac" "812" + } + + "m_flDisplayHistory" // int32 + { + "windows" "816" + "linux" "836" + "mac" "836" + } + + "m_iMenu" // enum _Menu + { + "windows" "820" + "linux" "840" + "mac" "840" + } + + "m_iChaseTarget" // int + { + "windows" "824" + "linux" "844" + "mac" "844" + } + + "m_pChaseTarget" // CBaseEntity* + { + "windows" "828" + "linux" "848" + "mac" "848" + } + + "m_fCamSwitch" // float + { + "windows" "832" + "linux" "852" + "mac" "852" + } + + "m_bEscaped" // bool + { + "windows" "836" + "linux" "856" + "mac" "856" + } + + "m_bIsVIP" // bool + { + "windows" "837" + "linux" "857" + "mac" "857" + } + + "m_tmNextRadarUpdate" // float + { + "windows" "840" + "linux" "860" + "mac" "860" + } + + "m_vLastOrigin" // Vector + { + "windows" "844" + "linux" "864" + "mac" "864" + } + + "m_iCurrentKickVote" // int + { + "windows" "856" + "linux" "876" + "mac" "876" + } + + "m_flNextVoteTime" // float + { + "windows" "860" + "linux" "880" + "mac" "880" + } + + "m_bJustKilledTeammate" // bool + { + "windows" "864" + "linux" "884" + "mac" "884" + } + + "m_iHostagesKilled" // int + { + "windows" "868" + "linux" "888" + "mac" "888" + } + + "m_iMapVote" // int + { + "windows" "872" + "linux" "892" + "mac" "892" + } + + "m_bCanShoot" // bool + { + "windows" "876" + "linux" "896" + "mac" "896" + } + + "m_flLastFired" // float + { + "windows" "880" + "linux" "900" + "mac" "900" + } + + "m_flLastAttackedTeammate" // float + { + "windows" "884" + "linux" "904" + "mac" "904" + } + + "m_bHeadshotKilled" // bool + { + "windows" "888" + "linux" "908" + "mac" "908" + } + + "m_bPunishedForTK" // bool + { + "windows" "889" + "linux" "909" + "mac" "909" + } + + "m_bReceivesNoMoneyNextRound" // bool + { + "windows" "890" + "linux" "910" + "mac" "910" + } + + "m_iTimeCheckAllowed" // int + { + "windows" "892" + "linux" "912" + "mac" "912" + } + + "m_bHasChangedName" // bool + { + "windows" "896" + "linux" "916" + "mac" "916" + } + + "m_szNewName" // char[32] + { + "windows" "897" + "linux" "917" + "mac" "917" + } + + "m_bIsDefusing" // bool + { + "windows" "929" + "linux" "949" + "mac" "949" + } + + "m_tmHandleSignals" // float + { + "windows" "932" + "linux" "952" + "mac" "952" + } + + "m_signals" // CUnifiedSignals + { + "windows" "936" + "linux" "956" + "mac" "956" + } + + "m_pentCurBombTarget" // edict_t* + { + "windows" "944" + "linux" "964" + "mac" "964" + } + + "m_iPlayerSound" // int + { + "windows" "948" + "linux" "968" + "mac" "968" + } + + "m_iTargetVolume" // int + { + "windows" "952" + "linux" "972" + "mac" "972" + } + + "m_iWeaponVolume" // int + { + "windows" "956" + "linux" "976" + "mac" "976" + } + + "m_iExtraSoundTypes" // int + { + "windows" "960" + "linux" "980" + "mac" "980" + } + + "m_iWeaponFlash" // int + { + "windows" "964" + "linux" "984" + "mac" "984" + } + + "m_flStopExtraSoundTime" // float + { + "windows" "968" + "linux" "988" + "mac" "988" + } + + "m_flFlashLightTime" // float + { + "windows" "972" + "linux" "992" + "mac" "992" + } + + "m_iFlashBattery" // int + { + "windows" "976" + "linux" "996" + "mac" "996" + } + + "m_afButtonLast" // int + { + "windows" "980" + "linux" "1000" + "mac" "1000" + } + + "m_afButtonPressed" // int + { + "windows" "984" + "linux" "1004" + "mac" "1004" + } + + "m_afButtonReleased" // int + { + "windows" "988" + "linux" "1008" + "mac" "1008" + } + + "m_pentSndLast" // edict_t* + { + "windows" "992" + "linux" "1012" + "mac" "1012" + } + + "m_flSndRoomtype" // float + { + "windows" "996" + "linux" "1016" + "mac" "1016" + } + + "m_flSndRange" // float + { + "windows" "1000" + "linux" "1020" + "mac" "1020" + } + + "m_flFallVelocity" // float + { + "windows" "1004" + "linux" "1024" + "mac" "1024" + } + + "m_rgItems" // int[4] + { + "windows" "1008" + "linux" "1028" + "mac" "1028" + } + + "m_fNewAmmo" // int + { + "windows" "1024" + "linux" "1044" + "mac" "1044" + } + + "m_afPhysicsFlags" // unsigned int + { + "windows" "1028" + "linux" "1048" + "mac" "1048" + } + + "m_fNextSuicideTime" // float + { + "windows" "1032" + "linux" "1052" + "mac" "1052" + } + + "m_flTimeStepSound" // float + { + "windows" "1036" + "linux" "1056" + "mac" "1056" + } + + "m_flTimeWeaponIdle" // float + { + "windows" "1040" + "linux" "1060" + "mac" "1060" + } + + "m_flSwimTime" // float + { + "windows" "1044" + "linux" "1064" + "mac" "1064" + } + + "m_flDuckTime" // float + { + "windows" "1048" + "linux" "1068" + "mac" "1068" + } + + "m_flWallJumpTime" // float + { + "windows" "1052" + "linux" "1072" + "mac" "1072" + } + + "m_flSuitUpdate" // float + { + "windows" "1056" + "linux" "1076" + "mac" "1076" + } + + "m_rgSuitPlayList" // int[4] + { + "windows" "1060" + "linux" "1080" + "mac" "1080" + } + + "m_iSuitPlayNext" // int + { + "windows" "1076" + "linux" "1096" + "mac" "1096" + } + + "m_rgiSuitNoRepeat" // int[32] + { + "windows" "1080" + "linux" "1100" + "mac" "1100" + } + + "m_rgflSuitNoRepeatTime" // float[32] + { + "windows" "1208" + "linux" "1228" + "mac" "1228" + } + + "m_lastDamageAmount" // int + { + "windows" "1336" + "linux" "1356" + "mac" "1356" + } + + "m_tbdPrev" // float + { + "windows" "1340" + "linux" "1360" + "mac" "1360" + } + + "m_flgeigerRange" // float + { + "windows" "1344" + "linux" "1364" + "mac" "1364" + } + + "m_flgeigerDelay" // float + { + "windows" "1348" + "linux" "1368" + "mac" "1368" + } + + "m_igeigerRangePrev" // int + { + "windows" "1352" + "linux" "1372" + "mac" "1372" + } + + "m_iStepLeft" // int + { + "windows" "1356" + "linux" "1376" + "mac" "1376" + } + + "m_szTextureName" // char[17] + { + "windows" "1360" + "linux" "1380" + "mac" "1380" + } + + "m_chTextureType" // char + { + "windows" "1377" + "linux" "1397" + "mac" "1397" + } + + "m_idrowndmg" // int + { + "windows" "1380" + "linux" "1400" + "mac" "1400" + } + + "m_idrownrestored" // int + { + "windows" "1384" + "linux" "1404" + "mac" "1404" + } + + "m_bitsHUDDamage" // int + { + "windows" "1388" + "linux" "1408" + "mac" "1408" + } + + "m_fInitHUD" // BOOL + { + "windows" "1392" + "linux" "1412" + "mac" "1412" + } + + "m_fGameHUDInitialized" // BOOL + { + "windows" "1396" + "linux" "1416" + "mac" "1416" + } + + "m_iTrain" // int + { + "windows" "1400" + "linux" "1420" + "mac" "1420" + } + + "m_fWeapon" // BOOL + { + "windows" "1404" + "linux" "1424" + "mac" "1424" + } + + "m_pTank" // EHANDLE + { + "windows" "1408" + "linux" "1428" + "mac" "1428" + } + + "m_fDeadTime" // float + { + "windows" "1416" + "linux" "1436" + "mac" "1436" + } + + "m_fNoPlayerSound" // BOOL + { + "windows" "1420" + "linux" "1440" + "mac" "1440" + } + + "m_fLongJump" // BOOL + { + "windows" "1424" + "linux" "1444" + "mac" "1444" + } + + "m_tSneaking" // float + { + "windows" "1428" + "linux" "1448" + "mac" "1448" + } + + "m_iUpdateTime" // int + { + "windows" "1432" + "linux" "1452" + "mac" "1452" + } + + "m_iClientHealth" // int + { + "windows" "1436" + "linux" "1456" + "mac" "1456" + } + + "m_iClientBattery" // int + { + "windows" "1440" + "linux" "1460" + "mac" "1460" + } + + "m_iHideHUD" // int + { + "windows" "1444" + "linux" "1464" + "mac" "1464" + } + + "m_iClientHideHUD" // int + { + "windows" "1448" + "linux" "1468" + "mac" "1468" + } + + "m_iFOV" // int + { + "windows" "1452" + "linux" "1472" + "mac" "1472" + } + + "m_iClientFOV" // int + { + "windows" "1456" + "linux" "1476" + "mac" "1476" + } + + "m_iNumSpawns" // int + { + "windows" "1460" + "linux" "1480" + "mac" "1480" + } + + "m_pObserver" // CBaseEntity* + { + "windows" "1464" + "linux" "1484" + "mac" "1484" + } + + "m_rgpPlayerItems" // CBasePlayerItem*[6] + { + "windows" "1468" + "linux" "1488" + "mac" "1488" + } + + "m_pActiveItem" // CBasePlayerItem* + { + "windows" "1492" + "linux" "1512" + "mac" "1512" + } + + "m_pClientActiveItem" // CBasePlayerItem* + { + "windows" "1496" + "linux" "1516" + "mac" "1516" + } + + "m_pLastItem" // CBasePlayerItem* + { + "windows" "1500" + "linux" "1520" + "mac" "1520" + } + + "m_rgAmmo" // int[32] + { + "windows" "1504" + "linux" "1524" + "mac" "1524" + } + + "m_rgAmmoLast" // int[32] + { + "windows" "1632" + "linux" "1652" + "mac" "1652" + } + + "m_vecAutoAim" // Vector + { + "windows" "1760" + "linux" "1780" + "mac" "1780" + } + + "m_fOnTarget" // BOOL + { + "windows" "1772" + "linux" "1792" + "mac" "1792" + } + + "m_iDeaths" // int + { + "windows" "1776" + "linux" "1796" + "mac" "1796" + } + + "m_izSBarState" // int[4] + { + "windows" "1780" + "linux" "1800" + "mac" "1800" + } + + "m_flNextSBarUpdateTime" // float + { + "windows" "1796" + "linux" "1816" + "mac" "1816" + } + + "m_flStatusBarDisappearDelay" // float + { + "windows" "1800" + "linux" "1820" + "mac" "1820" + } + + "m_SbarString0" // char[128] + { + "windows" "1804" + "linux" "1824" + "mac" "1824" + } + + "m_lastx" // int + { + "windows" "1932" + "linux" "1952" + "mac" "1952" + } + + "m_lasty" // int + { + "windows" "1936" + "linux" "1956" + "mac" "1956" + } + + "m_nCustomSprayFrames" // int + { + "windows" "1940" + "linux" "1960" + "mac" "1960" + } + + "m_flNextDecalTime" // float + { + "windows" "1944" + "linux" "1964" + "mac" "1964" + } + + "m_szTeamName" // char[16] + { + "windows" "1948" + "linux" "1968" + "mac" "1968" + } + + "m_modelIndexPlayer" // int + { + "windows" "1964" + "linux" "1984" + "mac" "1984" + } + + "m_szAnimExtention" // char[32] + { + "windows" "1968" + "linux" "1988" + "mac" "1988" + } + + "m_iGaitsequence" // int + { + "windows" "2000" + "linux" "2020" + "mac" "2020" + } + + "m_flGaitframe" // float + { + "windows" "2004" + "linux" "2024" + "mac" "2024" + } + + "m_flGaityaw" // float + { + "windows" "2008" + "linux" "2028" + "mac" "2028" + } + + "m_prevgaitorigin" // Vector + { + "windows" "2012" + "linux" "2032" + "mac" "2032" + } + + "m_flPitch" // float + { + "windows" "2024" + "linux" "2044" + "mac" "2044" + } + + "m_flYaw" // float + { + "windows" "2028" + "linux" "2048" + "mac" "2048" + } + + "m_flGaitMovement" // float + { + "windows" "2032" + "linux" "2052" + "mac" "2052" + } + + "m_iAutoWepSwitch" // int + { + "windows" "2036" + "linux" "2056" + "mac" "2056" + } + + "m_bVGUIMenus" // bool + { + "windows" "2040" + "linux" "2060" + "mac" "2060" + } + + "m_bShowHints" // bool + { + "windows" "2041" + "linux" "2061" + "mac" "2061" + } + + "m_bShieldDrawn" // bool + { + "windows" "2042" + "linux" "2062" + "mac" "2062" + } + + "m_bOwnsShield" // bool + { + "windows" "2043" + "linux" "2063" + "mac" "2063" + } + + "m_bWasFollowing" // bool + { + "windows" "2044" + "linux" "2064" + "mac" "2064" + } + + "m_flNextFollowTime" // float + { + "windows" "2048" + "linux" "2068" + "mac" "2068" + } + + "m_flYawModifier" // float + { + "windows" "2052" + "linux" "2072" + "mac" "2072" + } + + "m_blindUntilTime" // float + { + "windows" "2056" + "linux" "2076" + "mac" "2076" + } + + "m_blindStartTime" // float + { + "windows" "2060" + "linux" "2080" + "mac" "2080" + } + + "m_blindHoldTime" // float + { + "windows" "2064" + "linux" "2084" + "mac" "2084" + } + + "m_blindFadeTime" // float + { + "windows" "2068" + "linux" "2088" + "mac" "2088" + } + + "m_blindAlpha" // int + { + "windows" "2072" + "linux" "2092" + "mac" "2092" + } + + "m_allowAutoFollowTime" // float + { + "windows" "2076" + "linux" "2096" + "mac" "2096" + } + + "m_autoBuyString" // char[256] + { + "windows" "2080" + "linux" "2100" + "mac" "2100" + } + + "m_rebuyString" // char* + { + "windows" "2336" + "linux" "2356" + "mac" "2356" + } + + "m_rebuyStruct" // struct RebuyStruct + { + "windows" "2340" + "linux" "2360" + "mac" "2360" + } + + "m_bIsInRebuy" // bool + { + "windows" "2380" + "linux" "2400" + "mac" "2400" + } + + "m_flLastUpdateTime" // float + { + "windows" "2384" + "linux" "2404" + "mac" "2404" + } + + "m_lastLocation" // char[32] + { + "windows" "2388" + "linux" "2408" + "mac" "2408" + } + + "m_progressStart" // float + { + "windows" "2420" + "linux" "2440" + "mac" "2440" + } + + "m_progressEnd" // float + { + "windows" "2424" + "linux" "2444" + "mac" "2444" + } + + "m_bObserverAutoDirector" // bool + { + "windows" "2428" + "linux" "2448" + "mac" "2448" + } + + "m_canSwitchObserverModes" // bool + { + "windows" "2429" + "linux" "2449" + "mac" "2449" + } + + "m_heartBeatTime" // float + { + "windows" "2432" + "linux" "2452" + "mac" "2452" + } + + "m_intenseTimestamp" // float + { + "windows" "2436" + "linux" "2456" + "mac" "2456" + } + + "m_silentTimestamp" // float + { + "windows" "2440" + "linux" "2460" + "mac" "2460" + } + + "m_musicState" // enum MusicState + { + "windows" "2444" + "linux" "2464" + "mac" "2464" + } + + "m_flLastCommandTime" // float[8] + { + "windows" "2448" + "linux" "2468" + "mac" "2468" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cbaseplayerammo.txt b/gamedata/common.games/entities.games/cstrike/offsets-cbaseplayerammo.txt new file mode 100644 index 00000000..d4ed6277 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cbaseplayerammo.txt @@ -0,0 +1,25 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CBasePlayerAmmo" + { + "Offsets" + { } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cbaseplayeritem.txt b/gamedata/common.games/entities.games/cstrike/offsets-cbaseplayeritem.txt new file mode 100644 index 00000000..24ffddb1 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cbaseplayeritem.txt @@ -0,0 +1,60 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CBasePlayerItem" + { + "Offsets" + { + "ItemInfoArray" // ItemInfo[32] + { + "windows" "-16" + "linux" "0" + "mac" "0" + } + + "AmmoInfoArray" // AmmoInfo[32] + { + "windows" "-16" + "linux" "0" + "mac" "0" + } + + "m_pPlayer" // CBasePlayer* + { + "windows" "164" + "linux" "180" + "mac" "180" + } + + "m_pNext" // CBasePlayerItem* + { + "windows" "168" + "linux" "184" + "mac" "184" + } + + "m_iId" // int + { + "windows" "172" + "linux" "188" + "mac" "188" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cbaseplayerweapon.txt b/gamedata/common.games/entities.games/cstrike/offsets-cbaseplayerweapon.txt new file mode 100644 index 00000000..486ff8bc --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cbaseplayerweapon.txt @@ -0,0 +1,270 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CBasePlayerWeapon" + { + "Offsets" + { + "m_iPlayEmptySound" // int + { + "windows" "176" + "linux" "192" + "mac" "192" + } + + "m_fFireOnEmpty" // int + { + "windows" "180" + "linux" "196" + "mac" "196" + } + + "m_flNextPrimaryAttack" // float + { + "windows" "184" + "linux" "200" + "mac" "200" + } + + "m_flNextSecondaryAttack" // float + { + "windows" "188" + "linux" "204" + "mac" "204" + } + + "m_flTimeWeaponIdle" // float + { + "windows" "192" + "linux" "208" + "mac" "208" + } + + "m_iPrimaryAmmoType" // int + { + "windows" "196" + "linux" "212" + "mac" "212" + } + + "m_iSecondaryAmmoType" // int + { + "windows" "200" + "linux" "216" + "mac" "216" + } + + "m_iClip" // int + { + "windows" "204" + "linux" "220" + "mac" "220" + } + + "m_iClientClip" // int + { + "windows" "208" + "linux" "224" + "mac" "224" + } + + "m_iClientWeaponState" // int + { + "windows" "212" + "linux" "228" + "mac" "228" + } + + "m_fInReload" // int + { + "windows" "216" + "linux" "232" + "mac" "232" + } + + "m_fInSpecialReload" // int + { + "windows" "220" + "linux" "236" + "mac" "236" + } + + "m_iDefaultAmmo" // int + { + "windows" "224" + "linux" "240" + "mac" "240" + } + + "m_iShellId" // int + { + "windows" "228" + "linux" "244" + "mac" "244" + } + + "m_fMaxSpeed" // float + { + "windows" "232" + "linux" "248" + "mac" "248" + } + + "m_bDelayFire" // bool + { + "windows" "236" + "linux" "252" + "mac" "252" + } + + "m_iDirection" // int + { + "windows" "240" + "linux" "256" + "mac" "256" + } + + "m_bSecondarySilencerOn" // bool + { + "windows" "244" + "linux" "260" + "mac" "260" + } + + "m_flAccuracy" // float + { + "windows" "248" + "linux" "264" + "mac" "264" + } + + "m_flLastFire" // float + { + "windows" "252" + "linux" "268" + "mac" "268" + } + + "m_iShotsFired" // int + { + "windows" "256" + "linux" "272" + "mac" "272" + } + + "m_vVecAiming" // Vector + { + "windows" "260" + "linux" "276" + "mac" "276" + } + + "model_name" // string_t + { + "windows" "272" + "linux" "288" + "mac" "288" + } + + "m_flGlock18Shoot" // float + { + "windows" "276" + "linux" "292" + "mac" "292" + } + + "m_iGlock18ShotsFired" // int + { + "windows" "280" + "linux" "296" + "mac" "296" + } + + "m_flFamasShoot" // float + { + "windows" "284" + "linux" "300" + "mac" "300" + } + + "m_iFamasShotsFired" // int + { + "windows" "288" + "linux" "304" + "mac" "304" + } + + "m_fBurstSpread" // float + { + "windows" "292" + "linux" "308" + "mac" "308" + } + + "m_iWeaponState" // int + { + "windows" "296" + "linux" "312" + "mac" "312" + } + + "m_flNextReload" // float + { + "windows" "300" + "linux" "316" + "mac" "316" + } + + "m_flDecreaseShotsFired" // float + { + "windows" "304" + "linux" "320" + "mac" "320" + } + + "m_usFireGlock18" // short unsigned int + { + "windows" "308" + "linux" "324" + "mac" "324" + } + + "m_usFireFamas" // short unsigned int + { + "windows" "310" + "linux" "326" + "mac" "326" + } + + "m_flPrevPrimaryAttack" // float + { + "windows" "312" + "linux" "328" + "mac" "328" + } + + "m_flLastFireTime" // float + { + "windows" "316" + "linux" "332" + "mac" "332" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cbasetoggle.txt b/gamedata/common.games/entities.games/cstrike/offsets-cbasetoggle.txt new file mode 100644 index 00000000..b000eb8e --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cbasetoggle.txt @@ -0,0 +1,158 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CBaseToggle" + { + "Offsets" + { + "m_toggle_state" // TOGGLE_STATE + { + "windows" "164" + "linux" "180" + "mac" "180" + } + + "m_flActivateFinished" // float + { + "windows" "168" + "linux" "184" + "mac" "184" + } + + "m_flMoveDistance" // float + { + "windows" "172" + "linux" "188" + "mac" "188" + } + + "m_flWait" // float + { + "windows" "176" + "linux" "192" + "mac" "192" + } + + "m_flLip" // float + { + "windows" "180" + "linux" "196" + "mac" "196" + } + + "m_flTWidth" // float + { + "windows" "184" + "linux" "200" + "mac" "200" + } + + "m_flTLength" // float + { + "windows" "188" + "linux" "204" + "mac" "204" + } + + "m_vecPosition1" // Vector + { + "windows" "192" + "linux" "208" + "mac" "208" + } + + "m_vecPosition2" // Vector + { + "windows" "204" + "linux" "220" + "mac" "220" + } + + "m_vecAngle1" // Vector + { + "windows" "216" + "linux" "232" + "mac" "232" + } + + "m_vecAngle2" // Vector + { + "windows" "228" + "linux" "244" + "mac" "244" + } + + "m_cTriggersLeft" // int + { + "windows" "240" + "linux" "256" + "mac" "256" + } + + "m_flHeight" // float + { + "windows" "244" + "linux" "260" + "mac" "260" + } + + "m_hActivator" // EHANDLE + { + "windows" "248" + "linux" "264" + "mac" "264" + } + + "m_pfnCallWhenMoveDone" // void* + { + "windows" "256" + "linux" "272" + "mac" "272" + } + + "m_vecFinalDest" // Vector + { + "windows" "260" + "linux" "280" + "mac" "280" + } + + "m_vecFinalAngle" // Vector + { + "windows" "272" + "linux" "292" + "mac" "292" + } + + "m_bitsDamageInflict" // int + { + "windows" "284" + "linux" "304" + "mac" "304" + } + + "m_sMaster" // string_t + { + "windows" "292" + "linux" "308" + "mac" "308" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cbombglow.txt b/gamedata/common.games/entities.games/cstrike/offsets-cbombglow.txt new file mode 100644 index 00000000..512f2b1d --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cbombglow.txt @@ -0,0 +1,46 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CBombGlow" + { + "Offsets" + { + "m_lastTime" // float + { + "windows" "144" + "linux" "160" + "mac" "160" + } + + "m_tmBeepPeriod" // float + { + "windows" "148" + "linux" "164" + "mac" "164" + } + + "m_bSetModel" // bool + { + "windows" "152" + "linux" "168" + "mac" "168" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cbreakable.txt b/gamedata/common.games/entities.games/cstrike/offsets-cbreakable.txt new file mode 100644 index 00000000..8336e1ce --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cbreakable.txt @@ -0,0 +1,116 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CBreakable" + { + "Offsets" + { + "pSoundsWood" // const char*[3] + { + "windows" "-16" + "linux" "0" + "mac" "0" + } + + "pSoundsFlesh" // const char*[6] + { + "windows" "-16" + "linux" "0" + "mac" "0" + } + + "pSoundsGlass" // const char*[3] + { + "windows" "-16" + "linux" "0" + "mac" "0" + } + + "pSoundsMetal" // const char*[3] + { + "windows" "-16" + "linux" "0" + "mac" "0" + } + + "pSoundsConcrete" // const char*[3] + { + "windows" "-16" + "linux" "0" + "mac" "0" + } + + "pSpawnObjects" // const char*[32] + { + "windows" "-16" + "linux" "0" + "mac" "0" + } + + "m_Material" // Materials + { + "windows" "144" + "linux" "160" + "mac" "160" + } + + "m_Explosion" // Explosions + { + "windows" "148" + "linux" "164" + "mac" "164" + } + + "m_idShard" // int + { + "windows" "152" + "linux" "168" + "mac" "168" + } + + "m_angle" // float + { + "windows" "156" + "linux" "172" + "mac" "172" + } + + "m_iszGibModel" // int + { + "windows" "160" + "linux" "176" + "mac" "176" + } + + "m_iszSpawnObject" // int + { + "windows" "164" + "linux" "180" + "mac" "180" + } + + "m_flHealth" // float + { + "windows" "168" + "linux" "184" + "mac" "184" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cbubbling.txt b/gamedata/common.games/entities.games/cstrike/offsets-cbubbling.txt new file mode 100644 index 00000000..ddeb3c7f --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cbubbling.txt @@ -0,0 +1,53 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CBubbling" + { + "Offsets" + { + "m_density" // int + { + "windows" "136" + "linux" "152" + "mac" "152" + } + + "m_frequency" // int + { + "windows" "140" + "linux" "156" + "mac" "156" + } + + "m_bubbleModel" // int + { + "windows" "144" + "linux" "160" + "mac" "160" + } + + "m_state" // int + { + "windows" "148" + "linux" "164" + "mac" "164" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cchangelevel.txt b/gamedata/common.games/entities.games/cstrike/offsets-cchangelevel.txt new file mode 100644 index 00000000..1e6778b4 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cchangelevel.txt @@ -0,0 +1,53 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CChangeLevel" + { + "Offsets" + { + "m_szMapName" // char[32] + { + "windows" "292" + "linux" "312" + "mac" "312" + } + + "m_szLandmarkName" // char[32] + { + "windows" "324" + "linux" "344" + "mac" "344" + } + + "m_changeTarget" // int + { + "windows" "356" + "linux" "376" + "mac" "376" + } + + "m_changeTargetDelay" // float + { + "windows" "360" + "linux" "380" + "mac" "380" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cclientfog.txt b/gamedata/common.games/entities.games/cstrike/offsets-cclientfog.txt new file mode 100644 index 00000000..ce0e012f --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cclientfog.txt @@ -0,0 +1,46 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CClientFog" + { + "Offsets" + { + "m_iStartDist" // int + { + "windows" "136" + "linux" "152" + "mac" "152" + } + + "m_iEndDist" // int + { + "windows" "140" + "linux" "156" + "mac" "156" + } + + "m_fDensity" // float + { + "windows" "144" + "linux" "160" + "mac" "160" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-ccycler.txt b/gamedata/common.games/entities.games/cstrike/offsets-ccycler.txt new file mode 100644 index 00000000..0ede92e5 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-ccycler.txt @@ -0,0 +1,32 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CCycler" + { + "Offsets" + { + "m_animate" // int + { + "windows" "384" + "linux" "404" + "mac" "404" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-ccyclersprite.txt b/gamedata/common.games/entities.games/cstrike/offsets-ccyclersprite.txt new file mode 100644 index 00000000..69cbc158 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-ccyclersprite.txt @@ -0,0 +1,74 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CCyclerSprite" + { + "Offsets" + { + "m_animate" // int + { + "windows" "136" + "linux" "152" + "mac" "152" + } + + "m_lastTime" // float + { + "windows" "140" + "linux" "156" + "mac" "156" + } + + "m_maxFrame" // float + { + "windows" "144" + "linux" "160" + "mac" "160" + } + + "m_renderfx" // int + { + "windows" "148" + "linux" "164" + "mac" "164" + } + + "m_rendermode" // int + { + "windows" "152" + "linux" "168" + "mac" "168" + } + + "m_renderamt" // float + { + "windows" "156" + "linux" "172" + "mac" "172" + } + + "m_rendercolor" // float[3] + { + "windows" "160" + "linux" "176" + "mac" "176" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cdeadhev.txt b/gamedata/common.games/entities.games/cstrike/offsets-cdeadhev.txt new file mode 100644 index 00000000..5f02c4a0 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cdeadhev.txt @@ -0,0 +1,39 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CDeadHEV" + { + "Offsets" + { + "m_iPose" // int + { + "windows" "384" + "linux" "404" + "mac" "404" + } + + "m_szPoses" // char*[4] + { + "windows" "-20" + "linux" "0" + "mac" "0" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cdeagle.txt b/gamedata/common.games/entities.games/cstrike/offsets-cdeagle.txt new file mode 100644 index 00000000..bd29fd0b --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cdeagle.txt @@ -0,0 +1,39 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CDEAGLE" + { + "Offsets" + { + "m_iShell" // int + { + "windows" "320" + "linux" "336" + "mac" "336" + } + + "m_usFireDeagle" // short unsigned int + { + "windows" "324" + "linux" "340" + "mac" "340" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-celite.txt b/gamedata/common.games/entities.games/cstrike/offsets-celite.txt new file mode 100644 index 00000000..6623d3bd --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-celite.txt @@ -0,0 +1,46 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CELITE" + { + "Offsets" + { + "m_iShell" // int + { + "windows" "320" + "linux" "336" + "mac" "336" + } + + "m_usFireELITE_LEFT" // short unsigned int + { + "windows" "324" + "linux" "340" + "mac" "340" + } + + "m_usFireELITE_RIGHT" // short unsigned int + { + "windows" "326" + "linux" "342" + "mac" "342" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cenvexplosion.txt b/gamedata/common.games/entities.games/cstrike/offsets-cenvexplosion.txt new file mode 100644 index 00000000..b44054d2 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cenvexplosion.txt @@ -0,0 +1,39 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CEnvExplosion" + { + "Offsets" + { + "m_iMagnitude" // int + { + "windows" "384" + "linux" "404" + "mac" "404" + } + + "m_spriteScale" // int + { + "windows" "388" + "linux" "408" + "mac" "408" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cenvfunnel.txt b/gamedata/common.games/entities.games/cstrike/offsets-cenvfunnel.txt new file mode 100644 index 00000000..bde5c91a --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cenvfunnel.txt @@ -0,0 +1,32 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CEnvFunnel" + { + "Offsets" + { + "m_iSprite" // int + { + "windows" "144" + "linux" "160" + "mac" "160" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cenvglobal.txt b/gamedata/common.games/entities.games/cstrike/offsets-cenvglobal.txt new file mode 100644 index 00000000..d44bdb35 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cenvglobal.txt @@ -0,0 +1,46 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CEnvGlobal" + { + "Offsets" + { + "m_globalstate" // string_t + { + "windows" "136" + "linux" "152" + "mac" "152" + } + + "m_triggermode" // int + { + "windows" "140" + "linux" "156" + "mac" "156" + } + + "m_initialstate" // int + { + "windows" "144" + "linux" "160" + "mac" "160" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cenvsound.txt b/gamedata/common.games/entities.games/cstrike/offsets-cenvsound.txt new file mode 100644 index 00000000..b2004182 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cenvsound.txt @@ -0,0 +1,39 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CEnvSound" + { + "Offsets" + { + "m_flRadius" // float + { + "windows" "136" + "linux" "152" + "mac" "152" + } + + "m_flRoomtype" // float + { + "windows" "140" + "linux" "156" + "mac" "156" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cenvspark.txt b/gamedata/common.games/entities.games/cstrike/offsets-cenvspark.txt new file mode 100644 index 00000000..c6793836 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cenvspark.txt @@ -0,0 +1,32 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CEnvSpark" + { + "Offsets" + { + "m_flDelay" // float + { + "windows" "136" + "linux" "152" + "mac" "152" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cfamas.txt b/gamedata/common.games/entities.games/cstrike/offsets-cfamas.txt new file mode 100644 index 00000000..197f9875 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cfamas.txt @@ -0,0 +1,39 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CFamas" + { + "Offsets" + { + "m_iShell" // int + { + "windows" "320" + "linux" "336" + "mac" "336" + } + + "iShellOn" // int + { + "windows" "324" + "linux" "340" + "mac" "340" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cfiveseven.txt b/gamedata/common.games/entities.games/cstrike/offsets-cfiveseven.txt new file mode 100644 index 00000000..f98ba1be --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cfiveseven.txt @@ -0,0 +1,39 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CFiveSeven" + { + "Offsets" + { + "m_iShell" // int + { + "windows" "320" + "linux" "336" + "mac" "336" + } + + "m_usFireFiveSeven" // short unsigned int + { + "windows" "324" + "linux" "340" + "mac" "340" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cflashbang.txt b/gamedata/common.games/entities.games/cstrike/offsets-cflashbang.txt new file mode 100644 index 00000000..4d3d7864 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cflashbang.txt @@ -0,0 +1,25 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CFlashbang" + { + "Offsets" + { } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cfrictionmodifier.txt b/gamedata/common.games/entities.games/cstrike/offsets-cfrictionmodifier.txt new file mode 100644 index 00000000..aae0acf3 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cfrictionmodifier.txt @@ -0,0 +1,32 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CFrictionModifier" + { + "Offsets" + { + "m_frictionFraction" // float + { + "windows" "136" + "linux" "152" + "mac" "152" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cfuncmortarfield.txt b/gamedata/common.games/entities.games/cstrike/offsets-cfuncmortarfield.txt new file mode 100644 index 00000000..d5791799 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cfuncmortarfield.txt @@ -0,0 +1,67 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CFuncMortarField" + { + "Offsets" + { + "m_iszXController" // int + { + "windows" "292" + "linux" "312" + "mac" "312" + } + + "m_iszYController" // int + { + "windows" "296" + "linux" "316" + "mac" "316" + } + + "m_flSpread" // float + { + "windows" "300" + "linux" "320" + "mac" "320" + } + + "m_flDelay" // float + { + "windows" "304" + "linux" "324" + "mac" "324" + } + + "m_iCount" // int + { + "windows" "308" + "linux" "328" + "mac" "328" + } + + "m_fControl" // int + { + "windows" "312" + "linux" "332" + "mac" "332" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cfuncplatrot.txt b/gamedata/common.games/entities.games/cstrike/offsets-cfuncplatrot.txt new file mode 100644 index 00000000..81223171 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cfuncplatrot.txt @@ -0,0 +1,39 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CFuncPlatRot" + { + "Offsets" + { + "m_end" // Vector + { + "windows" "300" + "linux" "320" + "mac" "320" + } + + "m_start" // Vector + { + "windows" "312" + "linux" "332" + "mac" "332" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cfuncrotating.txt b/gamedata/common.games/entities.games/cstrike/offsets-cfuncrotating.txt new file mode 100644 index 00000000..bdcd4a5f --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cfuncrotating.txt @@ -0,0 +1,60 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CFuncRotating" + { + "Offsets" + { + "m_flFanFriction" // float + { + "windows" "136" + "linux" "152" + "mac" "152" + } + + "m_flAttenuation" // float + { + "windows" "140" + "linux" "156" + "mac" "156" + } + + "m_flVolume" // float + { + "windows" "144" + "linux" "160" + "mac" "160" + } + + "m_pitch" // float + { + "windows" "148" + "linux" "164" + "mac" "164" + } + + "m_sounds" // int + { + "windows" "152" + "linux" "168" + "mac" "168" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cfunctank.txt b/gamedata/common.games/entities.games/cstrike/offsets-cfunctank.txt new file mode 100644 index 00000000..4c0bc8e0 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cfunctank.txt @@ -0,0 +1,207 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CFuncTank" + { + "Offsets" + { + "m_pController" // CBasePlayer* + { + "windows" "136" + "linux" "152" + "mac" "152" + } + + "m_flNextAttack" // float + { + "windows" "140" + "linux" "156" + "mac" "156" + } + + "m_vecControllerUsePos" // Vector + { + "windows" "144" + "linux" "160" + "mac" "160" + } + + "m_yawCenter" // float + { + "windows" "156" + "linux" "172" + "mac" "172" + } + + "m_yawRate" // float + { + "windows" "160" + "linux" "176" + "mac" "176" + } + + "m_yawRange" // float + { + "windows" "164" + "linux" "180" + "mac" "180" + } + + "m_yawTolerance" // float + { + "windows" "168" + "linux" "184" + "mac" "184" + } + + "m_pitchCenter" // float + { + "windows" "172" + "linux" "188" + "mac" "188" + } + + "m_pitchRate" // float + { + "windows" "176" + "linux" "192" + "mac" "192" + } + + "m_pitchRange" // float + { + "windows" "180" + "linux" "196" + "mac" "196" + } + + "m_pitchTolerance" // float + { + "windows" "184" + "linux" "200" + "mac" "200" + } + + "m_fireLast" // float + { + "windows" "188" + "linux" "204" + "mac" "204" + } + + "m_fireRate" // float + { + "windows" "192" + "linux" "208" + "mac" "208" + } + + "m_lastSightTime" // float + { + "windows" "196" + "linux" "212" + "mac" "212" + } + + "m_persist" // float + { + "windows" "200" + "linux" "216" + "mac" "216" + } + + "m_minRange" // float + { + "windows" "204" + "linux" "220" + "mac" "220" + } + + "m_maxRange" // float + { + "windows" "208" + "linux" "224" + "mac" "224" + } + + "m_barrelPos" // Vector + { + "windows" "212" + "linux" "228" + "mac" "228" + } + + "m_spriteScale" // float + { + "windows" "224" + "linux" "240" + "mac" "240" + } + + "m_iszSpriteSmoke" // int + { + "windows" "228" + "linux" "244" + "mac" "244" + } + + "m_iszSpriteFlash" // int + { + "windows" "232" + "linux" "248" + "mac" "248" + } + + "m_bulletType" // enum TANKBULLET + { + "windows" "236" + "linux" "252" + "mac" "252" + } + + "m_iBulletDamage" // int + { + "windows" "240" + "linux" "256" + "mac" "256" + } + + "m_sightOrigin" // Vector + { + "windows" "244" + "linux" "260" + "mac" "260" + } + + "m_spread" // int + { + "windows" "256" + "linux" "272" + "mac" "272" + } + + "m_iszMaster" // int + { + "windows" "260" + "linux" "276" + "mac" "276" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cfunctankcontrols.txt b/gamedata/common.games/entities.games/cstrike/offsets-cfunctankcontrols.txt new file mode 100644 index 00000000..0ad32b9d --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cfunctankcontrols.txt @@ -0,0 +1,32 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CFuncTankControls" + { + "Offsets" + { + "m_pTank" // CFuncTank* + { + "windows" "136" + "linux" "152" + "mac" "152" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cfunctanklaser.txt b/gamedata/common.games/entities.games/cstrike/offsets-cfunctanklaser.txt new file mode 100644 index 00000000..72c5f544 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cfunctanklaser.txt @@ -0,0 +1,39 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CFuncTankLaser" + { + "Offsets" + { + "m_pLaser" // CLaser* + { + "windows" "264" + "linux" "280" + "mac" "280" + } + + "m_laserTime" // float + { + "windows" "268" + "linux" "284" + "mac" "284" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cfunctrackchange.txt b/gamedata/common.games/entities.games/cstrike/offsets-cfunctrackchange.txt new file mode 100644 index 00000000..fad53ba6 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cfunctrackchange.txt @@ -0,0 +1,88 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CFuncTrackChange" + { + "Offsets" + { + "m_trackTop" // CPathTrack* + { + "windows" "324" + "linux" "344" + "mac" "344" + } + + "m_trackBottom" // CPathTrack* + { + "windows" "328" + "linux" "348" + "mac" "348" + } + + "m_train" // CFuncTrackTrain* + { + "windows" "332" + "linux" "352" + "mac" "352" + } + + "m_trackTopName" // int + { + "windows" "336" + "linux" "356" + "mac" "356" + } + + "m_trackBottomName" // int + { + "windows" "340" + "linux" "360" + "mac" "360" + } + + "m_trainName" // int + { + "windows" "344" + "linux" "364" + "mac" "364" + } + + "m_code" // TRAIN_CODE + { + "windows" "348" + "linux" "368" + "mac" "368" + } + + "m_targetState" // int + { + "windows" "352" + "linux" "372" + "mac" "372" + } + + "m_use" // int + { + "windows" "356" + "linux" "376" + "mac" "376" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cfunctracktrain.txt b/gamedata/common.games/entities.games/cstrike/offsets-cfunctracktrain.txt new file mode 100644 index 00000000..2d54671f --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cfunctracktrain.txt @@ -0,0 +1,144 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CFuncTrackTrain" + { + "Offsets" + { + "m_ppath" // CPathTrack* + { + "windows" "136" + "linux" "152" + "mac" "152" + } + + "m_length" // float + { + "windows" "140" + "linux" "156" + "mac" "156" + } + + "m_height" // float + { + "windows" "144" + "linux" "160" + "mac" "160" + } + + "m_speed" // float + { + "windows" "148" + "linux" "164" + "mac" "164" + } + + "m_dir" // float + { + "windows" "152" + "linux" "168" + "mac" "168" + } + + "m_startSpeed" // float + { + "windows" "156" + "linux" "172" + "mac" "172" + } + + "m_controlMins" // Vector + { + "windows" "160" + "linux" "176" + "mac" "176" + } + + "m_controlMaxs" // Vector + { + "windows" "172" + "linux" "188" + "mac" "188" + } + + "m_soundPlaying" // int + { + "windows" "184" + "linux" "200" + "mac" "200" + } + + "m_sounds" // int + { + "windows" "188" + "linux" "204" + "mac" "204" + } + + "m_flVolume" // float + { + "windows" "192" + "linux" "208" + "mac" "208" + } + + "m_flBank" // float + { + "windows" "196" + "linux" "212" + "mac" "212" + } + + "m_oldSpeed" // float + { + "windows" "200" + "linux" "216" + "mac" "216" + } + + "m_fTurnAngle" // float + { + "windows" "204" + "linux" "220" + "mac" "220" + } + + "m_flSteeringWheelDecay" // float + { + "windows" "208" + "linux" "224" + "mac" "224" + } + + "m_flAcceleratorDecay" // float + { + "windows" "212" + "linux" "228" + "mac" "228" + } + + "m_usAdjustPitch" // short unsigned int + { + "windows" "216" + "linux" "232" + "mac" "232" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cfunctrain.txt b/gamedata/common.games/entities.games/cstrike/offsets-cfunctrain.txt new file mode 100644 index 00000000..fcb3d36a --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cfunctrain.txt @@ -0,0 +1,60 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CFuncTrain" + { + "Offsets" + { + "m_vStartPosition" // Vector + { + "windows" "300" + "linux" "320" + "mac" "320" + } + + "m_pevFirstTarget" // entvars_t* + { + "windows" "312" + "linux" "332" + "mac" "332" + } + + "m_pevCurrentTarget" // entvars_t* + { + "windows" "316" + "linux" "336" + "mac" "336" + } + + "m_sounds" // int + { + "windows" "320" + "linux" "340" + "mac" "340" + } + + "m_activated" // BOOL + { + "windows" "324" + "linux" "344" + "mac" "344" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cfuncvehicle.txt b/gamedata/common.games/entities.games/cstrike/offsets-cfuncvehicle.txt new file mode 100644 index 00000000..9b46273d --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cfuncvehicle.txt @@ -0,0 +1,256 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CFuncVehicle" + { + "Offsets" + { + "m_ppath" // CPathTrack* + { + "windows" "136" + "linux" "152" + "mac" "152" + } + + "m_length" // float + { + "windows" "140" + "linux" "156" + "mac" "156" + } + + "m_width" // float + { + "windows" "144" + "linux" "160" + "mac" "160" + } + + "m_height" // float + { + "windows" "148" + "linux" "164" + "mac" "164" + } + + "m_speed" // float + { + "windows" "152" + "linux" "168" + "mac" "168" + } + + "m_dir" // float + { + "windows" "156" + "linux" "172" + "mac" "172" + } + + "m_startSpeed" // float + { + "windows" "160" + "linux" "176" + "mac" "176" + } + + "m_controlMins" // Vector + { + "windows" "164" + "linux" "180" + "mac" "180" + } + + "m_controlMaxs" // Vector + { + "windows" "176" + "linux" "192" + "mac" "192" + } + + "m_soundPlaying" // int + { + "windows" "188" + "linux" "204" + "mac" "204" + } + + "m_sounds" // int + { + "windows" "192" + "linux" "208" + "mac" "208" + } + + "m_acceleration" // int + { + "windows" "196" + "linux" "212" + "mac" "212" + } + + "m_flVolume" // float + { + "windows" "200" + "linux" "216" + "mac" "216" + } + + "m_flBank" // float + { + "windows" "204" + "linux" "220" + "mac" "220" + } + + "m_oldSpeed" // float + { + "windows" "208" + "linux" "224" + "mac" "224" + } + + "m_iTurnAngle" // int + { + "windows" "212" + "linux" "228" + "mac" "228" + } + + "m_flSteeringWheelDecay" // float + { + "windows" "216" + "linux" "232" + "mac" "232" + } + + "m_flAcceleratorDecay" // float + { + "windows" "220" + "linux" "236" + "mac" "236" + } + + "m_flTurnStartTime" // float + { + "windows" "224" + "linux" "240" + "mac" "240" + } + + "m_flLaunchTime" // float + { + "windows" "228" + "linux" "244" + "mac" "244" + } + + "m_flLastNormalZ" // float + { + "windows" "232" + "linux" "248" + "mac" "248" + } + + "m_flCanTurnNow" // float + { + "windows" "236" + "linux" "252" + "mac" "252" + } + + "m_flUpdateSound" // float + { + "windows" "240" + "linux" "256" + "mac" "256" + } + + "m_vFrontLeft" // Vector + { + "windows" "244" + "linux" "260" + "mac" "260" + } + + "m_vFront" // Vector + { + "windows" "256" + "linux" "272" + "mac" "272" + } + + "m_vFrontRight" // Vector + { + "windows" "268" + "linux" "284" + "mac" "284" + } + + "m_vBackLeft" // Vector + { + "windows" "280" + "linux" "296" + "mac" "296" + } + + "m_vBack" // Vector + { + "windows" "292" + "linux" "308" + "mac" "308" + } + + "m_vBackRight" // Vector + { + "windows" "304" + "linux" "320" + "mac" "320" + } + + "m_vSurfaceNormal" // Vector + { + "windows" "316" + "linux" "332" + "mac" "332" + } + + "m_vVehicleDirection" // Vector + { + "windows" "328" + "linux" "344" + "mac" "344" + } + + "m_pDriver" // CBasePlayer* + { + "windows" "340" + "linux" "356" + "mac" "356" + } + + "m_usAdjustPitch" // short unsigned int + { + "windows" "344" + "linux" "360" + "mac" "360" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cfuncweaponcheck.txt b/gamedata/common.games/entities.games/cstrike/offsets-cfuncweaponcheck.txt new file mode 100644 index 00000000..e3e8ecb7 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cfuncweaponcheck.txt @@ -0,0 +1,67 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CFuncWeaponCheck" + { + "Offsets" + { + "sTriggerWithItems" // string_t + { + "windows" "136" + "linux" "152" + "mac" "152" + } + + "sTriggerNoItems" // string_t + { + "windows" "140" + "linux" "156" + "mac" "156" + } + + "sMaster" // string_t + { + "windows" "144" + "linux" "160" + "mac" "160" + } + + "sItemName" // unsigned int[32] + { + "windows" "148" + "linux" "164" + "mac" "164" + } + + "iItemCount" // int + { + "windows" "276" + "linux" "292" + "mac" "292" + } + + "iAnyWeapon" // int + { + "windows" "280" + "linux" "296" + "mac" "296" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cg3sg1.txt b/gamedata/common.games/entities.games/cstrike/offsets-cg3sg1.txt new file mode 100644 index 00000000..68532d9a --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cg3sg1.txt @@ -0,0 +1,39 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CG3SG1" + { + "Offsets" + { + "m_iShell" // int + { + "windows" "320" + "linux" "336" + "mac" "336" + } + + "m_usFireG3SG1" // short unsigned int + { + "windows" "324" + "linux" "340" + "mac" "340" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cgalil.txt b/gamedata/common.games/entities.games/cstrike/offsets-cgalil.txt new file mode 100644 index 00000000..fdcc5871 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cgalil.txt @@ -0,0 +1,46 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CGalil" + { + "Offsets" + { + "m_iShell" // int + { + "windows" "320" + "linux" "336" + "mac" "336" + } + + "iShellOn" // int + { + "windows" "324" + "linux" "340" + "mac" "340" + } + + "m_usFireGalil" // short unsigned int + { + "windows" "328" + "linux" "344" + "mac" "344" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cgameplayerequip.txt b/gamedata/common.games/entities.games/cstrike/offsets-cgameplayerequip.txt new file mode 100644 index 00000000..1f69d5b6 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cgameplayerequip.txt @@ -0,0 +1,39 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CGamePlayerEquip" + { + "Offsets" + { + "m_weaponNames" // unsigned int[32] + { + "windows" "140" + "linux" "156" + "mac" "156" + } + + "m_weaponCount" // int[32] + { + "windows" "268" + "linux" "284" + "mac" "284" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cgameplayerzone.txt b/gamedata/common.games/entities.games/cstrike/offsets-cgameplayerzone.txt new file mode 100644 index 00000000..a03414ce --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cgameplayerzone.txt @@ -0,0 +1,53 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CGamePlayerZone" + { + "Offsets" + { + "m_iszInTarget" // string_t + { + "windows" "140" + "linux" "156" + "mac" "156" + } + + "m_iszOutTarget" // string_t + { + "windows" "144" + "linux" "160" + "mac" "160" + } + + "m_iszInCount" // string_t + { + "windows" "148" + "linux" "164" + "mac" "164" + } + + "m_iszOutCount" // string_t + { + "windows" "152" + "linux" "168" + "mac" "168" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cgameteammaster.txt b/gamedata/common.games/entities.games/cstrike/offsets-cgameteammaster.txt new file mode 100644 index 00000000..03a76b1e --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cgameteammaster.txt @@ -0,0 +1,39 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CGameTeamMaster" + { + "Offsets" + { + "m_teamIndex" // int + { + "windows" "140" + "linux" "156" + "mac" "156" + } + + "triggerType" // USE_TYPE + { + "windows" "144" + "linux" "160" + "mac" "160" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cgametext.txt b/gamedata/common.games/entities.games/cstrike/offsets-cgametext.txt new file mode 100644 index 00000000..6b655268 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cgametext.txt @@ -0,0 +1,32 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CGameText" + { + "Offsets" + { + "m_textParms" // hudtextparms_t + { + "windows" "140" + "linux" "156" + "mac" "156" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cgib.txt b/gamedata/common.games/entities.games/cstrike/offsets-cgib.txt new file mode 100644 index 00000000..99a4bc2e --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cgib.txt @@ -0,0 +1,53 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CGib" + { + "Offsets" + { + "m_bloodColor" // int + { + "windows" "136" + "linux" "152" + "mac" "152" + } + + "m_cBloodDecals" // int + { + "windows" "140" + "linux" "156" + "mac" "156" + } + + "m_material" // int + { + "windows" "144" + "linux" "160" + "mac" "160" + } + + "m_lifeTime" // float + { + "windows" "148" + "linux" "164" + "mac" "164" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cgibshooter.txt b/gamedata/common.games/entities.games/cstrike/offsets-cgibshooter.txt new file mode 100644 index 00000000..13778cf1 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cgibshooter.txt @@ -0,0 +1,74 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CGibShooter" + { + "Offsets" + { + "m_iGibs" // int + { + "windows" "144" + "linux" "160" + "mac" "160" + } + + "m_iGibCapacity" // int + { + "windows" "148" + "linux" "164" + "mac" "164" + } + + "m_iGibMaterial" // int + { + "windows" "152" + "linux" "168" + "mac" "168" + } + + "m_iGibModelIndex" // int + { + "windows" "156" + "linux" "172" + "mac" "172" + } + + "m_flGibVelocity" // float + { + "windows" "160" + "linux" "176" + "mac" "176" + } + + "m_flVariance" // float + { + "windows" "164" + "linux" "180" + "mac" "180" + } + + "m_flGibLife" // float + { + "windows" "168" + "linux" "184" + "mac" "184" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cglock18.txt b/gamedata/common.games/entities.games/cstrike/offsets-cglock18.txt new file mode 100644 index 00000000..e63eceb1 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cglock18.txt @@ -0,0 +1,39 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CGLOCK18" + { + "Offsets" + { + "m_iShell" // int + { + "windows" "320" + "linux" "336" + "mac" "336" + } + + "m_bBurstFire" // bool + { + "windows" "324" + "linux" "340" + "mac" "340" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cglow.txt b/gamedata/common.games/entities.games/cstrike/offsets-cglow.txt new file mode 100644 index 00000000..3cbc516d --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cglow.txt @@ -0,0 +1,39 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CGlow" + { + "Offsets" + { + "m_lastTime" // float + { + "windows" "136" + "linux" "152" + "mac" "152" + } + + "m_maxFrame" // float + { + "windows" "140" + "linux" "156" + "mac" "156" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cgrenade.txt b/gamedata/common.games/entities.games/cstrike/offsets-cgrenade.txt new file mode 100644 index 00000000..d30d507e --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cgrenade.txt @@ -0,0 +1,193 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CGrenade" + { + "Offsets" + { + "m_bStartDefuse" // bool + { + "windows" "384" + "linux" "404" + "mac" "404" + } + + "m_bIsC4" // bool + { + "windows" "385" + "linux" "405" + "mac" "405" + } + + "m_pBombDefuser" // EHANDLE + { + "windows" "388" + "linux" "408" + "mac" "408" + } + + "m_flDefuseCountDown" // float + { + "windows" "396" + "linux" "416" + "mac" "416" + } + + "m_flC4Blow" // float + { + "windows" "400" + "linux" "420" + "mac" "420" + } + + "m_flNextFreqInterval" // float + { + "windows" "404" + "linux" "424" + "mac" "424" + } + + "m_flNextBeep" // float + { + "windows" "408" + "linux" "428" + "mac" "428" + } + + "m_flNextFreq" // float + { + "windows" "412" + "linux" "432" + "mac" "432" + } + + "m_sBeepName" // char* + { + "windows" "416" + "linux" "436" + "mac" "436" + } + + "m_fAttenu" // float + { + "windows" "420" + "linux" "440" + "mac" "440" + } + + "m_flNextBlink" // float + { + "windows" "424" + "linux" "444" + "mac" "444" + } + + "m_fNextDefuse" // float + { + "windows" "428" + "linux" "448" + "mac" "448" + } + + "m_bJustBlew" // bool + { + "windows" "432" + "linux" "452" + "mac" "452" + } + + "m_iTeam" // int + { + "windows" "436" + "linux" "456" + "mac" "456" + } + + "m_iCurWave" // int + { + "windows" "440" + "linux" "460" + "mac" "460" + } + + "m_pentCurBombTarget" // edict_t* + { + "windows" "444" + "linux" "464" + "mac" "464" + } + + "m_SGSmoke" // int + { + "windows" "448" + "linux" "468" + "mac" "468" + } + + "m_angle" // int + { + "windows" "452" + "linux" "472" + "mac" "472" + } + + "m_usEvent" // short unsigned int + { + "windows" "456" + "linux" "476" + "mac" "476" + } + + "m_bLightSmoke" // bool + { + "windows" "458" + "linux" "478" + "mac" "478" + } + + "m_bDetonated" // bool + { + "windows" "459" + "linux" "479" + "mac" "479" + } + + "m_vSmokeDetonate" // Vector + { + "windows" "460" + "linux" "480" + "mac" "480" + } + + "m_iBounceCount" // int + { + "windows" "472" + "linux" "492" + "mac" "492" + } + + "m_fRegisteredSound" // BOOL + { + "windows" "476" + "linux" "496" + "mac" "496" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cguntarget.txt b/gamedata/common.games/entities.games/cstrike/offsets-cguntarget.txt new file mode 100644 index 00000000..e0034a19 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cguntarget.txt @@ -0,0 +1,32 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CGunTarget" + { + "Offsets" + { + "m_on" // BOOL + { + "windows" "384" + "linux" "404" + "mac" "404" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-chegrenade.txt b/gamedata/common.games/entities.games/cstrike/offsets-chegrenade.txt new file mode 100644 index 00000000..f1920d21 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-chegrenade.txt @@ -0,0 +1,32 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CHEGrenade" + { + "Offsets" + { + "m_usCreateExplosion" // short unsigned int + { + "windows" "320" + "linux" "336" + "mac" "336" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-chostage.txt b/gamedata/common.games/entities.games/cstrike/offsets-chostage.txt new file mode 100644 index 00000000..f481ccf9 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-chostage.txt @@ -0,0 +1,242 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CHostage" + { + "Offsets" + { + "m_Activity" // int + { + "windows" "384" + "linux" "404" + "mac" "404" + } + + "m_bTouched" // BOOL + { + "windows" "388" + "linux" "408" + "mac" "408" + } + + "m_bRescueMe" // BOOL + { + "windows" "392" + "linux" "412" + "mac" "412" + } + + "m_flFlinchTime" // float + { + "windows" "396" + "linux" "416" + "mac" "416" + } + + "m_flNextChange" // float + { + "windows" "400" + "linux" "420" + "mac" "420" + } + + "m_flMarkPosition" // float + { + "windows" "404" + "linux" "424" + "mac" "424" + } + + "m_iModel" // int + { + "windows" "408" + "linux" "428" + "mac" "428" + } + + "m_iSkin" // int + { + "windows" "412" + "linux" "432" + "mac" "432" + } + + "m_flNextRadarTime" // float + { + "windows" "416" + "linux" "436" + "mac" "436" + } + + "m_State" // enum state + { + "windows" "420" + "linux" "440" + "mac" "440" + } + + "m_vStart" // Vector + { + "windows" "424" + "linux" "444" + "mac" "444" + } + + "m_vStartAngles" // Vector + { + "windows" "436" + "linux" "456" + "mac" "456" + } + + "m_vPathToFollow" // Vector[20] + { + "windows" "448" + "linux" "468" + "mac" "468" + } + + "m_iWaypoint" // int + { + "windows" "688" + "linux" "708" + "mac" "708" + } + + "m_target" // CBasePlayer* + { + "windows" "692" + "linux" "712" + "mac" "712" + } + + "m_LocalNav" // CLocalNav* + { + "windows" "696" + "linux" "716" + "mac" "716" + } + + "nTargetNode" // int + { + "windows" "700" + "linux" "720" + "mac" "720" + } + + "vecNodes" // Vector[100] + { + "windows" "704" + "linux" "724" + "mac" "724" + } + + "m_hStoppedTargetEnt" // EHANDLE + { + "windows" "1904" + "linux" "1924" + "mac" "1924" + } + + "m_flNextFullThink" // float + { + "windows" "1912" + "linux" "1932" + "mac" "1932" + } + + "m_flPathCheckInterval" // float + { + "windows" "1916" + "linux" "1936" + "mac" "1936" + } + + "m_flLastPathCheck" // float + { + "windows" "1920" + "linux" "1940" + "mac" "1940" + } + + "m_nPathNodes" // int + { + "windows" "1924" + "linux" "1944" + "mac" "1944" + } + + "m_fHasPath" // BOOL + { + "windows" "1928" + "linux" "1948" + "mac" "1948" + } + + "m_flPathAcquired" // float + { + "windows" "1932" + "linux" "1952" + "mac" "1952" + } + + "m_vOldPos" // Vector + { + "windows" "1936" + "linux" "1956" + "mac" "1956" + } + + "m_iHostageIndex" // int + { + "windows" "1948" + "linux" "1968" + "mac" "1968" + } + + "m_bStuck" // BOOL + { + "windows" "1952" + "linux" "1972" + "mac" "1972" + } + + "m_flStuckTime" // float + { + "windows" "1956" + "linux" "1976" + "mac" "1976" + } + + "m_improv" // CHostageImprov* + { + "windows" "1960" + "linux" "1980" + "mac" "1980" + } + + "m_whichModel" // enum ModelType + { + "windows" "1964" + "linux" "1984" + "mac" "1984" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-chostageimprov.txt b/gamedata/common.games/entities.games/cstrike/offsets-chostageimprov.txt new file mode 100644 index 00000000..8cbc401e --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-chostageimprov.txt @@ -0,0 +1,508 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CHostageImprov" + { + "Offsets" + { + "m_coughTimer" // CountdownTimer + { + "windows" "4" + "linux" "4" + "mac" "4" + } + + "m_grenadeTimer" // CountdownTimer + { + "windows" "12" + "linux" "12" + "mac" "12" + } + + "m_hostage" // CHostage* + { + "windows" "20" + "linux" "20" + "mac" "20" + } + + "m_lastKnownArea" // CNavArea* + { + "windows" "24" + "linux" "24" + "mac" "24" + } + + "m_centroid" // Vector + { + "windows" "28" + "linux" "28" + "mac" "28" + } + + "m_eye" // Vector + { + "windows" "40" + "linux" "40" + "mac" "40" + } + + "m_behavior" // HostageStateMachine + { + "windows" "52" + "linux" "52" + "mac" "52" + } + + "m_idleState" // HostageIdleState + { + "windows" "68" + "linux" "68" + "mac" "68" + } + + "m_escapeState" // HostageEscapeState + { + "windows" "140" + "linux" "140" + "mac" "140" + } + + "m_retreatState" // HostageRetreatState + { + "windows" "240" + "linux" "240" + "mac" "240" + } + + "m_followState" // HostageFollowState + { + "windows" "252" + "linux" "252" + "mac" "252" + } + + "m_animateState" // HostageAnimateState + { + "windows" "328" + "linux" "328" + "mac" "328" + } + + "m_didFidget" // bool + { + "windows" "460" + "linux" "460" + "mac" "460" + } + + "m_aggression" // float + { + "windows" "464" + "linux" "464" + "mac" "464" + } + + "m_lastSawCT" // IntervalTimer + { + "windows" "468" + "linux" "468" + "mac" "468" + } + + "m_lastSawT" // IntervalTimer + { + "windows" "472" + "linux" "472" + "mac" "472" + } + + "m_checkNearbyTerroristTimer" // CountdownTimer + { + "windows" "476" + "linux" "476" + "mac" "476" + } + + "m_isTerroristNearby" // bool + { + "windows" "484" + "linux" "484" + "mac" "484" + } + + "m_nearbyTerroristTimer" // CountdownTimer + { + "windows" "488" + "linux" "488" + "mac" "488" + } + + "m_scaredTimer" // CountdownTimer + { + "windows" "496" + "linux" "496" + "mac" "496" + } + + "m_scareIntensity" // enum ScareType + { + "windows" "504" + "linux" "504" + "mac" "504" + } + + "m_ignoreTerroristTimer" // CountdownTimer + { + "windows" "508" + "linux" "508" + "mac" "508" + } + + "m_blinkTimer" // CountdownTimer + { + "windows" "516" + "linux" "516" + "mac" "516" + } + + "m_blinkCounter" // char + { + "windows" "524" + "linux" "524" + "mac" "524" + } + + "m_lastInjuryTimer" // IntervalTimer + { + "windows" "528" + "linux" "528" + "mac" "528" + } + + "m_lastNoiseTimer" // IntervalTimer + { + "windows" "532" + "linux" "532" + "mac" "532" + } + + "m_avoidFriendTimer" // CountdownTimer + { + "windows" "536" + "linux" "536" + "mac" "536" + } + + "m_isFriendInTheWay" // bool + { + "windows" "544" + "linux" "544" + "mac" "544" + } + + "m_chatterTimer" // CountdownTimer + { + "windows" "548" + "linux" "548" + "mac" "548" + } + + "m_isDelayedChatterPending" // bool + { + "windows" "556" + "linux" "556" + "mac" "556" + } + + "m_delayedChatterTimer" // CountdownTimer + { + "windows" "560" + "linux" "560" + "mac" "560" + } + + "m_delayedChatterType" // enum HostageChatterType + { + "windows" "568" + "linux" "568" + "mac" "568" + } + + "m_delayedChatterMustSpeak" // bool + { + "windows" "572" + "linux" "572" + "mac" "572" + } + + "m_talkingTimer" // CountdownTimer + { + "windows" "576" + "linux" "576" + "mac" "576" + } + + "m_moveFlags" // unsigned int + { + "windows" "584" + "linux" "584" + "mac" "584" + } + + "m_vel" // Vector2D + { + "windows" "588" + "linux" "588" + "mac" "588" + } + + "m_actualVel" // Vector + { + "windows" "596" + "linux" "596" + "mac" "596" + } + + "m_moveGoal" // Vector + { + "windows" "608" + "linux" "608" + "mac" "608" + } + + "m_knownGoodPos" // Vector + { + "windows" "620" + "linux" "620" + "mac" "620" + } + + "m_hasKnownGoodPos" // bool + { + "windows" "632" + "linux" "632" + "mac" "632" + } + + "m_priorKnownGoodPos" // Vector + { + "windows" "636" + "linux" "636" + "mac" "636" + } + + "m_hasPriorKnownGoodPos" // bool + { + "windows" "648" + "linux" "648" + "mac" "648" + } + + "m_priorKnownGoodPosTimer" // CountdownTimer + { + "windows" "652" + "linux" "652" + "mac" "652" + } + + "m_collisionTimer" // IntervalTimer + { + "windows" "660" + "linux" "660" + "mac" "660" + } + + "m_viewGoal" // Vector + { + "windows" "664" + "linux" "664" + "mac" "664" + } + + "m_isLookingAt" // bool + { + "windows" "676" + "linux" "676" + "mac" "676" + } + + "m_faceGoal" // Vector + { + "windows" "680" + "linux" "680" + "mac" "680" + } + + "m_isFacingTo" // bool + { + "windows" "692" + "linux" "692" + "mac" "692" + } + + "m_path" // CNavPath + { + "windows" "696" + "linux" "696" + "mac" "696" + } + + "m_follower" // CNavPathFollower + { + "windows" "6844" + "linux" "6844" + "mac" "6844" + } + + "m_lastPosition" // Vector + { + "windows" "6940" + "linux" "6940" + "mac" "6940" + } + + "m_moveType" // enum MoveType + { + "windows" "6952" + "linux" "6952" + "mac" "6952" + } + + "m_moveLimit" // enum MoveType + { + "windows" "6956" + "linux" "6956" + "mac" "6956" + } + + "m_isCrouching" // bool + { + "windows" "6960" + "linux" "6960" + "mac" "6960" + } + + "m_minCrouchTimer" // CountdownTimer + { + "windows" "6964" + "linux" "6964" + "mac" "6964" + } + + "m_moveAngle" // float + { + "windows" "6972" + "linux" "6972" + "mac" "6972" + } + + "m_wiggleDirection" // enum NavRelativeDirType + { + "windows" "6976" + "linux" "6976" + "mac" "6976" + } + + "m_wiggleTimer" // CountdownTimer + { + "windows" "6980" + "linux" "6980" + "mac" "6980" + } + + "m_wiggleJumpTimer" // CountdownTimer + { + "windows" "6988" + "linux" "6988" + "mac" "6988" + } + + "m_inhibitObstacleAvoidance" // CountdownTimer + { + "windows" "6996" + "linux" "6996" + "mac" "6996" + } + + "m_jumpTimer" // CountdownTimer + { + "windows" "7004" + "linux" "7004" + "mac" "7004" + } + + "m_hasJumped" // bool + { + "windows" "7012" + "linux" "7012" + "mac" "7012" + } + + "m_hasJumpedIntoAir" // bool + { + "windows" "7013" + "linux" "7013" + "mac" "7013" + } + + "m_jumpTarget" // Vector + { + "windows" "7016" + "linux" "7016" + "mac" "7016" + } + + "m_clearPathTimer" // CountdownTimer + { + "windows" "7028" + "linux" "7028" + "mac" "7028" + } + + "m_traversingLadder" // bool + { + "windows" "7036" + "linux" "7036" + "mac" "7036" + } + + "m_visiblePlayer" // EHANDLE[32] + { + "windows" "7040" + "linux" "7040" + "mac" "7040" + } + + "m_visiblePlayerCount" // int + { + "windows" "7296" + "linux" "7296" + "mac" "7296" + } + + "m_visionTimer" // CountdownTimer + { + "windows" "7300" + "linux" "7300" + "mac" "7300" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-chostagemanager.txt b/gamedata/common.games/entities.games/cstrike/offsets-chostagemanager.txt new file mode 100644 index 00000000..6f3905aa --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-chostagemanager.txt @@ -0,0 +1,46 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CHostageManager" + { + "Offsets" + { + "m_hostage" // CHostage*[12] + { + "windows" "0" + "linux" "0" + "mac" "0" + } + + "m_hostageCount" // int + { + "windows" "48" + "linux" "48" + "mac" "48" + } + + "m_chatter" // SimpleChatter + { + "windows" "52" + "linux" "52" + "mac" "52" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cknife.txt b/gamedata/common.games/entities.games/cstrike/offsets-cknife.txt new file mode 100644 index 00000000..5ce8f349 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cknife.txt @@ -0,0 +1,39 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CKnife" + { + "Offsets" + { + "m_trHit" // TraceResult + { + "windows" "320" + "linux" "336" + "mac" "336" + } + + "m_usKnife" // short unsigned int + { + "windows" "376" + "linux" "392" + "mac" "392" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-claser.txt b/gamedata/common.games/entities.games/cstrike/offsets-claser.txt new file mode 100644 index 00000000..116ee817 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-claser.txt @@ -0,0 +1,46 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CLaser" + { + "Offsets" + { + "m_pSprite" // CSprite* + { + "windows" "136" + "linux" "152" + "mac" "152" + } + + "m_iszSpriteName" // int + { + "windows" "140" + "linux" "156" + "mac" "156" + } + + "m_firePosition" // Vector + { + "windows" "144" + "linux" "160" + "mac" "160" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-clight.txt b/gamedata/common.games/entities.games/cstrike/offsets-clight.txt new file mode 100644 index 00000000..1f03762e --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-clight.txt @@ -0,0 +1,46 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CLight" + { + "Offsets" + { + "m_iStyle" // int + { + "windows" "136" + "linux" "152" + "mac" "152" + } + + "m_iszPattern" // int + { + "windows" "140" + "linux" "156" + "mac" "156" + } + + "m_iStartedOff" // int + { + "windows" "144" + "linux" "160" + "mac" "160" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-clightning.txt b/gamedata/common.games/entities.games/cstrike/offsets-clightning.txt new file mode 100644 index 00000000..ffd15b74 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-clightning.txt @@ -0,0 +1,116 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CLightning" + { + "Offsets" + { + "m_active" // int + { + "windows" "136" + "linux" "152" + "mac" "152" + } + + "m_iszStartEntity" // int + { + "windows" "140" + "linux" "156" + "mac" "156" + } + + "m_iszEndEntity" // int + { + "windows" "144" + "linux" "160" + "mac" "160" + } + + "m_life" // float + { + "windows" "148" + "linux" "164" + "mac" "164" + } + + "m_boltWidth" // int + { + "windows" "152" + "linux" "168" + "mac" "168" + } + + "m_noiseAmplitude" // int + { + "windows" "156" + "linux" "172" + "mac" "172" + } + + "m_brightness" // int + { + "windows" "160" + "linux" "176" + "mac" "176" + } + + "m_speed" // int + { + "windows" "164" + "linux" "180" + "mac" "180" + } + + "m_restrike" // float + { + "windows" "168" + "linux" "184" + "mac" "184" + } + + "m_spriteTexture" // int + { + "windows" "172" + "linux" "188" + "mac" "188" + } + + "m_iszSpriteName" // int + { + "windows" "176" + "linux" "192" + "mac" "192" + } + + "m_frameStart" // int + { + "windows" "180" + "linux" "196" + "mac" "196" + } + + "m_radius" // float + { + "windows" "184" + "linux" "200" + "mac" "200" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cm3.txt b/gamedata/common.games/entities.games/cstrike/offsets-cm3.txt new file mode 100644 index 00000000..6553f624 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cm3.txt @@ -0,0 +1,46 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CM3" + { + "Offsets" + { + "m_iShell" // int + { + "windows" "320" + "linux" "336" + "mac" "336" + } + + "m_flPumpTime" // float + { + "windows" "324" + "linux" "340" + "mac" "340" + } + + "m_usFireM3" // short unsigned int + { + "windows" "328" + "linux" "344" + "mac" "344" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cmac10.txt b/gamedata/common.games/entities.games/cstrike/offsets-cmac10.txt new file mode 100644 index 00000000..99ebd1ac --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cmac10.txt @@ -0,0 +1,46 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CMAC10" + { + "Offsets" + { + "m_iShell" // int + { + "windows" "320" + "linux" "336" + "mac" "336" + } + + "iShellOn" // int + { + "windows" "324" + "linux" "340" + "mac" "340" + } + + "m_usFireMAC10" // short unsigned int + { + "windows" "328" + "linux" "344" + "mac" "344" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cmapinfo.txt b/gamedata/common.games/entities.games/cstrike/offsets-cmapinfo.txt new file mode 100644 index 00000000..4b06d289 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cmapinfo.txt @@ -0,0 +1,39 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CMapInfo" + { + "Offsets" + { + "m_iBuyingStatus" // int + { + "windows" "136" + "linux" "152" + "mac" "152" + } + + "m_flBombRadius" // float + { + "windows" "140" + "linux" "156" + "mac" "156" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cmomentarydoor.txt b/gamedata/common.games/entities.games/cstrike/offsets-cmomentarydoor.txt new file mode 100644 index 00000000..a780e2c3 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cmomentarydoor.txt @@ -0,0 +1,32 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CMomentaryDoor" + { + "Offsets" + { + "m_bMoveSnd" // BYTE + { + "windows" "292" + "linux" "312" + "mac" "312" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cmomentaryrotbutton.txt b/gamedata/common.games/entities.games/cstrike/offsets-cmomentaryrotbutton.txt new file mode 100644 index 00000000..debdd4ea --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cmomentaryrotbutton.txt @@ -0,0 +1,67 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CMomentaryRotButton" + { + "Offsets" + { + "m_lastUsed" // int + { + "windows" "292" + "linux" "312" + "mac" "312" + } + + "m_direction" // int + { + "windows" "296" + "linux" "316" + "mac" "316" + } + + "m_returnSpeed" // float + { + "windows" "300" + "linux" "320" + "mac" "320" + } + + "m_start" // Vector + { + "windows" "304" + "linux" "324" + "mac" "324" + } + + "m_end" // Vector + { + "windows" "316" + "linux" "336" + "mac" "336" + } + + "m_sounds" // int + { + "windows" "328" + "linux" "348" + "mac" "348" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cmortar.txt b/gamedata/common.games/entities.games/cstrike/offsets-cmortar.txt new file mode 100644 index 00000000..39713258 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cmortar.txt @@ -0,0 +1,32 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CMortar" + { + "Offsets" + { + "m_spriteTexture" // int + { + "windows" "480" + "linux" "500" + "mac" "500" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cmultimanager.txt b/gamedata/common.games/entities.games/cstrike/offsets-cmultimanager.txt new file mode 100644 index 00000000..8f736ece --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cmultimanager.txt @@ -0,0 +1,60 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CMultiManager" + { + "Offsets" + { + "m_cTargets" // int + { + "windows" "292" + "linux" "312" + "mac" "312" + } + + "m_index" // int + { + "windows" "296" + "linux" "316" + "mac" "316" + } + + "m_startTime" // float + { + "windows" "300" + "linux" "320" + "mac" "320" + } + + "m_iTargetName" // int[16] + { + "windows" "304" + "linux" "324" + "mac" "324" + } + + "m_flTargetDelay" // float[16] + { + "windows" "368" + "linux" "388" + "mac" "388" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cmultisource.txt b/gamedata/common.games/entities.games/cstrike/offsets-cmultisource.txt new file mode 100644 index 00000000..78974c32 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cmultisource.txt @@ -0,0 +1,53 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CMultiSource" + { + "Offsets" + { + "m_rgEntities" // EHANDLE[32] + { + "windows" "136" + "linux" "152" + "mac" "152" + } + + "m_rgTriggered" // int[32] + { + "windows" "392" + "linux" "408" + "mac" "408" + } + + "m_iTotal" // int + { + "windows" "520" + "linux" "536" + "mac" "536" + } + + "m_globalstate" // string_t + { + "windows" "524" + "linux" "540" + "mac" "540" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cp228.txt b/gamedata/common.games/entities.games/cstrike/offsets-cp228.txt new file mode 100644 index 00000000..6d47fe33 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cp228.txt @@ -0,0 +1,39 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CP228" + { + "Offsets" + { + "m_iShell" // int + { + "windows" "320" + "linux" "336" + "mac" "336" + } + + "m_usFireP228" // short unsigned int + { + "windows" "324" + "linux" "340" + "mac" "340" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cp90.txt b/gamedata/common.games/entities.games/cstrike/offsets-cp90.txt new file mode 100644 index 00000000..56be8a98 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cp90.txt @@ -0,0 +1,46 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CP90" + { + "Offsets" + { + "m_iShell" // int + { + "windows" "320" + "linux" "336" + "mac" "336" + } + + "iShellOn" // int + { + "windows" "324" + "linux" "340" + "mac" "340" + } + + "m_usFireP90" // short unsigned int + { + "windows" "328" + "linux" "344" + "mac" "344" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cpathcorner.txt b/gamedata/common.games/entities.games/cstrike/offsets-cpathcorner.txt new file mode 100644 index 00000000..69c0b6f9 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cpathcorner.txt @@ -0,0 +1,32 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CPathCorner" + { + "Offsets" + { + "m_flWait" // float + { + "windows" "136" + "linux" "152" + "mac" "152" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cpathtrack.txt b/gamedata/common.games/entities.games/cstrike/offsets-cpathtrack.txt new file mode 100644 index 00000000..6b9f7d6a --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cpathtrack.txt @@ -0,0 +1,60 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CPathTrack" + { + "Offsets" + { + "m_length" // float + { + "windows" "136" + "linux" "152" + "mac" "152" + } + + "m_altName" // string_t + { + "windows" "140" + "linux" "156" + "mac" "156" + } + + "m_pnext" // CPathTrack* + { + "windows" "144" + "linux" "160" + "mac" "160" + } + + "m_pprevious" // CPathTrack* + { + "windows" "148" + "linux" "164" + "mac" "164" + } + + "m_paltpath" // CPathTrack* + { + "windows" "152" + "linux" "168" + "mac" "168" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cpendulum.txt b/gamedata/common.games/entities.games/cstrike/offsets-cpendulum.txt new file mode 100644 index 00000000..d48c514d --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cpendulum.txt @@ -0,0 +1,81 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CPendulum" + { + "Offsets" + { + "m_accel" // float + { + "windows" "136" + "linux" "152" + "mac" "152" + } + + "m_distance" // float + { + "windows" "140" + "linux" "156" + "mac" "156" + } + + "m_time" // float + { + "windows" "144" + "linux" "160" + "mac" "160" + } + + "m_damp" // float + { + "windows" "148" + "linux" "164" + "mac" "164" + } + + "m_maxSpeed" // float + { + "windows" "152" + "linux" "168" + "mac" "168" + } + + "m_dampSpeed" // float + { + "windows" "156" + "linux" "172" + "mac" "172" + } + + "m_center" // Vector + { + "windows" "160" + "linux" "176" + "mac" "176" + } + + "m_start" // Vector + { + "windows" "172" + "linux" "188" + "mac" "188" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cplattrigger.txt b/gamedata/common.games/entities.games/cstrike/offsets-cplattrigger.txt new file mode 100644 index 00000000..10f037b2 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cplattrigger.txt @@ -0,0 +1,32 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CPlatTrigger" + { + "Offsets" + { + "m_pPlatform" // CFuncPlat* + { + "windows" "136" + "linux" "152" + "mac" "152" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cpointentity.txt b/gamedata/common.games/entities.games/cstrike/offsets-cpointentity.txt new file mode 100644 index 00000000..46044c59 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cpointentity.txt @@ -0,0 +1,25 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CPointEntity" + { + "Offsets" + { } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cpushable.txt b/gamedata/common.games/entities.games/cstrike/offsets-cpushable.txt new file mode 100644 index 00000000..e74fdce6 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cpushable.txt @@ -0,0 +1,53 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CPushable" + { + "Offsets" + { + "m_soundNames" // char*[3] + { + "windows" "-16" + "linux" "0" + "mac" "0" + } + + "m_lastSound" // int + { + "windows" "172" + "linux" "188" + "mac" "188" + } + + "m_maxSpeed" // float + { + "windows" "176" + "linux" "192" + "mac" "192" + } + + "m_soundTime" // float + { + "windows" "180" + "linux" "196" + "mac" "196" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-crecharge.txt b/gamedata/common.games/entities.games/cstrike/offsets-crecharge.txt new file mode 100644 index 00000000..b75db4e1 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-crecharge.txt @@ -0,0 +1,60 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CRecharge" + { + "Offsets" + { + "m_flNextCharge" // float + { + "windows" "292" + "linux" "312" + "mac" "312" + } + + "m_iReactivate" // int + { + "windows" "296" + "linux" "316" + "mac" "316" + } + + "m_iJuice" // int + { + "windows" "300" + "linux" "320" + "mac" "320" + } + + "m_iOn" // int + { + "windows" "304" + "linux" "324" + "mac" "324" + } + + "m_flSoundTime" // float + { + "windows" "308" + "linux" "328" + "mac" "328" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-crevertsaved.txt b/gamedata/common.games/entities.games/cstrike/offsets-crevertsaved.txt new file mode 100644 index 00000000..91b35d77 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-crevertsaved.txt @@ -0,0 +1,39 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CRevertSaved" + { + "Offsets" + { + "m_messageTime" // float + { + "windows" "136" + "linux" "152" + "mac" "152" + } + + "m_loadTime" // float + { + "windows" "140" + "linux" "156" + "mac" "156" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cruleentity.txt b/gamedata/common.games/entities.games/cstrike/offsets-cruleentity.txt new file mode 100644 index 00000000..72a1e5d0 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cruleentity.txt @@ -0,0 +1,32 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CRuleEntity" + { + "Offsets" + { + "m_iszMaster" // string_t + { + "windows" "136" + "linux" "152" + "mac" "152" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cscout.txt b/gamedata/common.games/entities.games/cstrike/offsets-cscout.txt new file mode 100644 index 00000000..6c1c996b --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cscout.txt @@ -0,0 +1,39 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CSCOUT" + { + "Offsets" + { + "m_iShell" // int + { + "windows" "320" + "linux" "336" + "mac" "336" + } + + "m_usFireScout" // short unsigned int + { + "windows" "324" + "linux" "340" + "mac" "340" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-csmokegrenade.txt b/gamedata/common.games/entities.games/cstrike/offsets-csmokegrenade.txt new file mode 100644 index 00000000..db0c5ae3 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-csmokegrenade.txt @@ -0,0 +1,32 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CSmokeGrenade" + { + "Offsets" + { + "m_usCreateSmoke" // short unsigned int + { + "windows" "320" + "linux" "336" + "mac" "336" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-csound.txt b/gamedata/common.games/entities.games/cstrike/offsets-csound.txt new file mode 100644 index 00000000..53022bae --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-csound.txt @@ -0,0 +1,67 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CSound" + { + "Offsets" + { + "m_vecOrigin" // Vector + { + "windows" "0" + "linux" "0" + "mac" "0" + } + + "m_iType" // int + { + "windows" "12" + "linux" "12" + "mac" "12" + } + + "m_iVolume" // int + { + "windows" "16" + "linux" "16" + "mac" "16" + } + + "m_flExpireTime" // float + { + "windows" "20" + "linux" "20" + "mac" "20" + } + + "m_iNext" // int + { + "windows" "24" + "linux" "24" + "mac" "24" + } + + "m_iNextAudible" // int + { + "windows" "28" + "linux" "28" + "mac" "28" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-csoundent.txt b/gamedata/common.games/entities.games/cstrike/offsets-csoundent.txt new file mode 100644 index 00000000..88a3680b --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-csoundent.txt @@ -0,0 +1,60 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CSoundEnt" + { + "Offsets" + { + "m_iFreeSound" // int + { + "windows" "136" + "linux" "152" + "mac" "152" + } + + "m_iActiveSound" // int + { + "windows" "140" + "linux" "156" + "mac" "156" + } + + "m_cLastActiveSounds" // int + { + "windows" "144" + "linux" "160" + "mac" "160" + } + + "m_fShowReport" // BOOL + { + "windows" "148" + "linux" "164" + "mac" "164" + } + + "m_SoundPool" // CSound[64] + { + "windows" "152" + "linux" "168" + "mac" "168" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cspeaker.txt b/gamedata/common.games/entities.games/cstrike/offsets-cspeaker.txt new file mode 100644 index 00000000..9e89bef1 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cspeaker.txt @@ -0,0 +1,32 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CSpeaker" + { + "Offsets" + { + "m_preset" // int + { + "windows" "136" + "linux" "152" + "mac" "152" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-csprite.txt b/gamedata/common.games/entities.games/cstrike/offsets-csprite.txt new file mode 100644 index 00000000..3826f3c8 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-csprite.txt @@ -0,0 +1,39 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CSprite" + { + "Offsets" + { + "m_lastTime" // float + { + "windows" "136" + "linux" "152" + "mac" "152" + } + + "m_maxFrame" // float + { + "windows" "140" + "linux" "156" + "mac" "156" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-ctesteffect.txt b/gamedata/common.games/entities.games/cstrike/offsets-ctesteffect.txt new file mode 100644 index 00000000..0a0cd76e --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-ctesteffect.txt @@ -0,0 +1,60 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CTestEffect" + { + "Offsets" + { + "m_iLoop" // int + { + "windows" "144" + "linux" "160" + "mac" "160" + } + + "m_iBeam" // int + { + "windows" "148" + "linux" "164" + "mac" "164" + } + + "m_pBeam" // CBeam*[24] + { + "windows" "152" + "linux" "168" + "mac" "168" + } + + "m_flBeamTime" // float[24] + { + "windows" "248" + "linux" "264" + "mac" "264" + } + + "m_flStartTime" // float + { + "windows" "344" + "linux" "360" + "mac" "360" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-ctmp.txt b/gamedata/common.games/entities.games/cstrike/offsets-ctmp.txt new file mode 100644 index 00000000..d7966c02 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-ctmp.txt @@ -0,0 +1,46 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CTMP" + { + "Offsets" + { + "m_iShell" // int + { + "windows" "320" + "linux" "336" + "mac" "336" + } + + "iShellOn" // int + { + "windows" "324" + "linux" "340" + "mac" "340" + } + + "m_usFireTMP" // short unsigned int + { + "windows" "328" + "linux" "344" + "mac" "344" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-ctriggercamera.txt b/gamedata/common.games/entities.games/cstrike/offsets-ctriggercamera.txt new file mode 100644 index 00000000..4cf588f9 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-ctriggercamera.txt @@ -0,0 +1,116 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CTriggerCamera" + { + "Offsets" + { + "m_hPlayer" // EHANDLE + { + "windows" "144" + "linux" "160" + "mac" "160" + } + + "m_hTarget" // EHANDLE + { + "windows" "152" + "linux" "168" + "mac" "168" + } + + "m_pentPath" // CBaseEntity* + { + "windows" "160" + "linux" "176" + "mac" "176" + } + + "m_sPath" // int + { + "windows" "164" + "linux" "180" + "mac" "180" + } + + "m_flWait" // float + { + "windows" "168" + "linux" "184" + "mac" "184" + } + + "m_flReturnTime" // float + { + "windows" "172" + "linux" "188" + "mac" "188" + } + + "m_flStopTime" // float + { + "windows" "176" + "linux" "192" + "mac" "192" + } + + "m_moveDistance" // float + { + "windows" "180" + "linux" "196" + "mac" "196" + } + + "m_targetSpeed" // float + { + "windows" "184" + "linux" "200" + "mac" "200" + } + + "m_initialSpeed" // float + { + "windows" "188" + "linux" "204" + "mac" "204" + } + + "m_acceleration" // float + { + "windows" "192" + "linux" "208" + "mac" "208" + } + + "m_deceleration" // float + { + "windows" "196" + "linux" "212" + "mac" "212" + } + + "m_state" // int + { + "windows" "200" + "linux" "216" + "mac" "216" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-ctriggerchangetarget.txt b/gamedata/common.games/entities.games/cstrike/offsets-ctriggerchangetarget.txt new file mode 100644 index 00000000..2badeb75 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-ctriggerchangetarget.txt @@ -0,0 +1,32 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CTriggerChangeTarget" + { + "Offsets" + { + "m_iszNewTarget" // int + { + "windows" "144" + "linux" "160" + "mac" "160" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-ctriggerendsection.txt b/gamedata/common.games/entities.games/cstrike/offsets-ctriggerendsection.txt new file mode 100644 index 00000000..dc332a4b --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-ctriggerendsection.txt @@ -0,0 +1,25 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CTriggerEndSection" + { + "Offsets" + { } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-ctriggerrelay.txt b/gamedata/common.games/entities.games/cstrike/offsets-ctriggerrelay.txt new file mode 100644 index 00000000..744c3b04 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-ctriggerrelay.txt @@ -0,0 +1,32 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CTriggerRelay" + { + "Offsets" + { + "triggerType" // USE_TYPE + { + "windows" "144" + "linux" "160" + "mac" "160" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cunifiedsignals.txt b/gamedata/common.games/entities.games/cstrike/offsets-cunifiedsignals.txt new file mode 100644 index 00000000..deb1780c --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cunifiedsignals.txt @@ -0,0 +1,39 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CUnifiedSignals" + { + "Offsets" + { + "m_flSignal" // int + { + "windows" "0" + "linux" "0" + "mac" "0" + } + + "m_flState" // int + { + "windows" "4" + "linux" "4" + "mac" "4" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cusp.txt b/gamedata/common.games/entities.games/cstrike/offsets-cusp.txt new file mode 100644 index 00000000..7377e109 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cusp.txt @@ -0,0 +1,39 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CUSP" + { + "Offsets" + { + "m_iShell" // int + { + "windows" "320" + "linux" "336" + "mac" "336" + } + + "m_usFireUSP" // short unsigned int + { + "windows" "324" + "linux" "340" + "mac" "340" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cvoicegamemgr.txt b/gamedata/common.games/entities.games/cstrike/offsets-cvoicegamemgr.txt new file mode 100644 index 00000000..f73f97de --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cvoicegamemgr.txt @@ -0,0 +1,60 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CVoiceGameMgr" + { + "Offsets" + { + "m_msgPlayerVoiceMask" // int + { + "windows" "8" + "linux" "4" + "mac" "4" + } + + "m_msgRequestState" // int + { + "windows" "12" + "linux" "8" + "mac" "8" + } + + "m_pHelper" // IVoiceGameMgrHelper* + { + "windows" "16" + "linux" "12" + "mac" "12" + } + + "m_nMaxPlayers" // int + { + "windows" "20" + "linux" "16" + "mac" "16" + } + + "m_UpdateInterval" // double + { + "windows" "24" + "linux" "20" + "mac" "20" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cwallhealth.txt b/gamedata/common.games/entities.games/cstrike/offsets-cwallhealth.txt new file mode 100644 index 00000000..b4713a25 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cwallhealth.txt @@ -0,0 +1,60 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CWallHealth" + { + "Offsets" + { + "m_flNextCharge" // float + { + "windows" "292" + "linux" "312" + "mac" "312" + } + + "m_iReactivate" // int + { + "windows" "296" + "linux" "316" + "mac" "316" + } + + "m_iJuice" // int + { + "windows" "300" + "linux" "320" + "mac" "320" + } + + "m_iOn" // int + { + "windows" "304" + "linux" "324" + "mac" "324" + } + + "m_flSoundTime" // float + { + "windows" "308" + "linux" "328" + "mac" "328" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cweaponbox.txt b/gamedata/common.games/entities.games/cstrike/offsets-cweaponbox.txt new file mode 100644 index 00000000..a892f9c8 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cweaponbox.txt @@ -0,0 +1,60 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CWeaponBox" + { + "Offsets" + { + "m_rgpPlayerItems" // CBasePlayerItem*[6] + { + "windows" "136" + "linux" "152" + "mac" "152" + } + + "m_rgiszAmmo" // int[32] + { + "windows" "160" + "linux" "176" + "mac" "176" + } + + "m_rgAmmo" // int[32] + { + "windows" "288" + "linux" "304" + "mac" "304" + } + + "m_cAmmoTypes" // int + { + "windows" "416" + "linux" "432" + "mac" "432" + } + + "m_bIsBomb" // bool + { + "windows" "420" + "linux" "436" + "mac" "436" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cweaponcycler.txt b/gamedata/common.games/entities.games/cstrike/offsets-cweaponcycler.txt new file mode 100644 index 00000000..e16d6f81 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cweaponcycler.txt @@ -0,0 +1,39 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CWeaponCycler" + { + "Offsets" + { + "m_iszModel" // int + { + "windows" "320" + "linux" "336" + "mac" "336" + } + + "m_iModel" // int + { + "windows" "324" + "linux" "340" + "mac" "340" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cworlditem.txt b/gamedata/common.games/entities.games/cstrike/offsets-cworlditem.txt new file mode 100644 index 00000000..8ffa0244 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cworlditem.txt @@ -0,0 +1,32 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CWorldItem" + { + "Offsets" + { + "m_iType" // int + { + "windows" "136" + "linux" "152" + "mac" "152" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cwreckage.txt b/gamedata/common.games/entities.games/cstrike/offsets-cwreckage.txt new file mode 100644 index 00000000..aa9bc128 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cwreckage.txt @@ -0,0 +1,32 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CWreckage" + { + "Offsets" + { + "m_flStartTime" // int + { + "windows" "384" + "linux" "404" + "mac" "404" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cwshield.txt b/gamedata/common.games/entities.games/cstrike/offsets-cwshield.txt new file mode 100644 index 00000000..703c7e91 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cwshield.txt @@ -0,0 +1,39 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CWShield" + { + "Offsets" + { + "m_hEntToIgnoreTouchesFrom" // EHANDLE + { + "windows" "136" + "linux" "152" + "mac" "152" + } + + "m_flTimeToIgnoreTouches" // float + { + "windows" "144" + "linux" "160" + "mac" "160" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-cxm1014.txt b/gamedata/common.games/entities.games/cstrike/offsets-cxm1014.txt new file mode 100644 index 00000000..7fa94da3 --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-cxm1014.txt @@ -0,0 +1,46 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "CXM1014" + { + "Offsets" + { + "m_iShell" // int + { + "windows" "320" + "linux" "336" + "mac" "336" + } + + "m_flPumpTime" // float + { + "windows" "324" + "linux" "340" + "mac" "340" + } + + "m_usFireXM1014" // short unsigned int + { + "windows" "328" + "linux" "344" + "mac" "344" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-hostagefollowstate.txt b/gamedata/common.games/entities.games/cstrike/offsets-hostagefollowstate.txt new file mode 100644 index 00000000..c8d9a4ef --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-hostagefollowstate.txt @@ -0,0 +1,88 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "HostageFollowState" + { + "Offsets" + { + "m_leader" // EHANDLE + { + "windows" "12" + "linux" "12" + "mac" "12" + } + + "m_lastLeaderPos" // Vector + { + "windows" "20" + "linux" "20" + "mac" "20" + } + + "m_isWaiting" // bool + { + "windows" "32" + "linux" "32" + "mac" "32" + } + + "m_stopRange" // float + { + "windows" "36" + "linux" "36" + "mac" "36" + } + + "m_makeWayTimer" // CountdownTimer + { + "windows" "40" + "linux" "40" + "mac" "40" + } + + "m_impatientTimer" // CountdownTimer + { + "windows" "48" + "linux" "48" + "mac" "48" + } + + "m_repathTimer" // CountdownTimer + { + "windows" "56" + "linux" "56" + "mac" "56" + } + + "m_isWaitingForFriend" // bool + { + "windows" "64" + "linux" "64" + "mac" "64" + } + + "m_waitForFriendTimer" // CountdownTimer + { + "windows" "68" + "linux" "68" + "mac" "68" + } + } + } + } + } +} diff --git a/gamedata/common.games/entities.games/cstrike/offsets-simplestatemachine.txt b/gamedata/common.games/entities.games/cstrike/offsets-simplestatemachine.txt new file mode 100644 index 00000000..2426d96a --- /dev/null +++ b/gamedata/common.games/entities.games/cstrike/offsets-simplestatemachine.txt @@ -0,0 +1,46 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Classes" + { + "SimpleStateMachine" + { + "Offsets" + { + "m_state" // HostageState* + { + "windows" "0" + "linux" "0" + "mac" "0" + } + + "m_stateTimer" // IntervalTimer + { + "windows" "4" + "linux" "4" + "mac" "4" + } + + "m_userData" // CHostageImprov* + { + "windows" "8" + "linux" "8" + "mac" "8" + } + } + } + } + } +} diff --git a/gamedata/common.games/globalvars.engine.txt b/gamedata/common.games/globalvars.engine.txt new file mode 100644 index 00000000..e0389709 --- /dev/null +++ b/gamedata/common.games/globalvars.engine.txt @@ -0,0 +1,71 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Offsets" + { + "svs" // Used with pfnGetCurrentPlayer base address + { + "windows" "8" + } + } + + "Addresses" + { + "realtime" + { + "windows" + { + "signature" "realtime" + "read" "2" + } + } + + "sv" + { + "windows" + { + "signature" "sv" + "read" "2" + } + } + } + + "Signatures" + { + "svs" // server_static_t svs + { + "library" "engine" + "linux" "@svs" + "mac" "@svs" + } + + "sv" // server_t sv + { + "library" "engine" + "windows" "\x8B\x2A\x2A\x2A\x2A\x2A\x8D\x2A\x2A\x2A\x2A\x2A\x53\x33\x2A\x89" // SVC_PlayerInfo() + "linux" "@sv" + "mac" "@sv" + } + + "realtime" // double realtime + { + "library" "engine" + "windows" "\xDC\x2A\x2A\x2A\x2A\x2A\xA1\x2A\x2A\x2A\x2A\x56" // SV_CheckTimeouts() + "linux" "@realtime" + "mac" "@realtime" + } + } + } +} diff --git a/gamedata/common.games/master.games.txt b/gamedata/common.games/master.games.txt new file mode 100644 index 00000000..bb9497c9 --- /dev/null +++ b/gamedata/common.games/master.games.txt @@ -0,0 +1,685 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Game Master" +{ + "globalvars.engine.txt" + { + "engine" "engine_ds" + "engine" "engine_ls" + } + + "entities.games/cstrike/offsets-cairtank.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cbaseanimating.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cpendulum.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cfuncrotating.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cbasebutton.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cenvspark.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cmomentaryrotbutton.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cmultisource.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cenvglobal.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cbaseentity.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cunifiedsignals.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-csound.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-simplestatemachine.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-chostagemanager.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cgib.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cmomentarydoor.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cbasedoor.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cenvfunnel.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-ctesteffect.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cgibshooter.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-csprite.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cbombglow.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cglow.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-claser.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-clightning.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cbubbling.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cenvexplosion.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cpushable.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cbreakable.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cfunctankcontrols.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cfunctank.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cfunctanklaser.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cgrenade.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-crecharge.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cwreckage.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cweaponcycler.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-ccyclersprite.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-ccycler.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cwallhealth.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cworlditem.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-clight.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cgameplayerequip.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cgameplayerzone.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cgameteammaster.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cgametext.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cruleentity.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cmortar.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cfuncmortarfield.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cbasemonster.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cmapinfo.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cpathtrack.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cpathcorner.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cguntarget.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cfunctrackchange.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cfuncplatrot.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cfunctracktrain.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cfunctrain.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cbaseplattrain.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cplattrigger.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cbaseplayer.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-crevertsaved.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cdeadhev.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cwshield.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cspeaker.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cenvsound.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cambientgeneric.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-csoundent.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cbasetoggle.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cbasedelay.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cpointentity.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cfuncweaponcheck.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cbasegrencatch.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cclientfog.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-ctriggercamera.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-ctriggerchangetarget.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-ctriggerendsection.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cchangelevel.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cmultimanager.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-ctriggerrelay.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cfrictionmodifier.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cfuncvehicle.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-carmoury.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cweaponbox.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cbaseplayeritem.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cbaseplayerammo.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cbaseplayerweapon.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-caug.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cawp.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cdeagle.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-celite.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cfiveseven.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cflashbang.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cg3sg1.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cglock18.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-chegrenade.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cknife.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cm3.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cmac10.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cp228.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cp90.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cscout.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-csmokegrenade.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-ctmp.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cusp.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cfamas.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cgalil.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cxm1014.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-cvoicegamemgr.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-hostagefollowstate.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-chostage.txt" + { + "game" "cstrike" + "game" "czero" + } + + "entities.games/cstrike/offsets-chostageimprov.txt" + { + "game" "cstrike" + "game" "czero" + } +} diff --git a/gamedata/modules.games/game.cstrike.txt b/gamedata/modules.games/game.cstrike.txt new file mode 100644 index 00000000..d1a0f7c0 --- /dev/null +++ b/gamedata/modules.games/game.cstrike.txt @@ -0,0 +1,103 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Games" +{ + "#default" + { + "Signatures" + { + "AddAccount" // void CBasePlayer::AddAccount(int amount, bool bTrackChange) + { + "library" "server" + "windows" "\x8B\x2A\x2A\x2A\x56\x8B\x2A\x8B\x2A\x2A\x2A\x2A\x2A\x03" + "linux" "@_ZN11CBasePlayer10AddAccountEib" + "mac" "@_ZN11CBasePlayer10AddAccountEib" + } + + "GiveNamedItem" // void CBasePlayer::GiveNamedItem(const char *pszName) + { + "library" "server" + "windows" "\x8B\x2A\x2A\x2A\x56\x57\x8B\x2A\x8B\x2A\x2A\x2A\x2A\x2A\x2B" + "linux" "@_ZN11CBasePlayer10GiveShieldEb" + "mac" "@_ZN11CBasePlayer10GiveShieldEb" + } + + "GiveDefaultItems" // void CBasePlayer::GiveDefaultItems(void) + { + "library" "server" + "windows" "\x56\x57\x6A\x2A\x8B\x2A\xE8\x2A\x2A\x2A\x2A\x8B\x2A\x2A\x2A\x2A\x2A\xC6" + "linux" "@_ZN11CBasePlayer10GiveShieldEb" + "mac" "@_ZN11CBasePlayer10GiveShieldEb" + } + + "GiveShield" // void CBasePlayer::GiveShield(bool bRetire) + { + "library" "server" + "windows" "\x56\x8B\x2A\x57\x33\x2A\x8B\x2A\x2A\x2A\x2A\x2A\xB0" + "linux" "@_ZN11CBasePlayer10GiveShieldEb" + "mac" "@_ZN11CBasePlayer10GiveShieldEb" + } + + "CreateNamedEntity" // edict_t* CREATE_NAMED_ENTITY(int classname) + { + "library" "server" + "windows" "\x56\x57\x8B\x2A\x2A\x2A\x57\xFF\x2A\x2A\x2A\x2A\x2A\x8B" + "linux" "@_Z19CREATE_NAMED_ENTITYj" + "mac" "@_Z19CREATE_NAMED_ENTITYj" + } + + "FindEntityByString" // CBaseEntity *UTIL_FindEntityByString(CBaseEntity *pStartEntity, const char *szKeyword, const char *szValue) + { + "library" "server" + "windows" "\x51\x8B\x2A\x2A\x2A\x53\x55\x56\x85\x2A\x57" + "linux" "@_Z23UTIL_FindEntityByStringP11CBaseEntityPKcS2_" + "mac" "@_Z23UTIL_FindEntityByStringP11CBaseEntityPKcS2_" + } + } + } + + "#default" + { + "Signatures" + { + "UseBotArgs" // bool UseBotArgs + { + "library" "server" + "windows" "\x8B\x2A\x2A\x2A\x56\x8B\x2A\x8B\x2A\x2A\x2A\x2A\x2A\x03" + "linux" "@UseBotArgs" + "mac" "@UseBotArgs" + } + + "BotArgs" // const char *BotArgs[4] + { + "library" "server" + "windows" "\x8B\x2A\x2A\x2A\x56\x8B\x2A\x8B\x2A\x2A\x2A\x2A\x2A\x03" + "linux" "@BotArgs" + "mac" "@BotArgs" + } + } + + "Offsets" + { + "UseBotArgs" // bool UseBotArgs + { + "windows" "2" + } + + "BotArgs" // const char *BotArgs[4] + { + "windows" "22" + } + } + } +} + diff --git a/gamedata/modules.games/master.games.txt b/gamedata/modules.games/master.games.txt new file mode 100644 index 00000000..2d357e52 --- /dev/null +++ b/gamedata/modules.games/master.games.txt @@ -0,0 +1,19 @@ +/** + * Do not edit this file. Any changes will be overwritten by the gamedata + * updater or by upgrading your AMX Mod X install. + * + * To override data in this file, create a subdirectory named "custom" and + * place your own gamedata file(s) inside of it. Such files will be parsed + * after AMXX's own. + * + * For more information, see http://wiki.alliedmods.net/Gamedata_Updating_(AMX_Mod_X) + */ + +"Game Master" +{ + "game.cstrike.txt" + { + "game" "cstrike" + "game" "czero" + } +} diff --git a/modules/cstrike/cstrike/AMBuilder b/modules/cstrike/cstrike/AMBuilder index bae60bed..e89158c6 100644 --- a/modules/cstrike/cstrike/AMBuilder +++ b/modules/cstrike/cstrike/AMBuilder @@ -9,11 +9,12 @@ binary.compiler.defines += [ binary.sources = [ '../../../public/sdk/amxxmodule.cpp', - 'amxx_api.cpp', + 'CstrikeMain.cpp', 'CstrikePlayer.cpp', 'CstrikeNatives.cpp', 'CstrikeHacks.cpp', 'CstrikeUtils.cpp', + 'CstrikeUserMessages.cpp', 'CstrikeHLTypeConversion.cpp', '../../../public/memtools/MemoryUtils.cpp', '../../../public/memtools/CDetour/detours.cpp', diff --git a/modules/cstrike/cstrike/CstrikeDatas.h b/modules/cstrike/cstrike/CstrikeDatas.h index f65af4e1..8d9e1be6 100644 --- a/modules/cstrike/cstrike/CstrikeDatas.h +++ b/modules/cstrike/cstrike/CstrikeDatas.h @@ -16,193 +16,51 @@ #include "amxxmodule.h" -#if defined(__linux__) || defined (__APPLE__) - #define EXTRAOFFSET 5 // offsets 5 higher in Linux builds - #define EXTRAOFFSET_WEAPONS 4 // weapon offsets are obviously only 4 steps higher on Linux! - #define ACTUAL_EXTRA_OFFSET 20 // actual, byte-addressable offset -#else - #define EXTRAOFFSET 0 // no change in Windows builds - #define EXTRAOFFSET_WEAPONS 0 - #define ACTUAL_EXTRA_OFFSET 0 -#endif - -/* - Offset history: - 041029: - Confirmed (pretty much) ALL offsets for 32 bit Windows, 32 bit Linux and amd64 (yes that's all of them). - Found out that weapon offsets are only +4 higher on Linux. - Also backpack ammo offsets were all obviously 5 steps too high since unknown time... - -*/ -// "player" entities -#if !defined __amd64__ - // 32 bit offsets here - #define OFFSET_ARMORTYPE 112 + EXTRAOFFSET - #define OFFSET_TEAM 114 + EXTRAOFFSET - #define OFFSET_CSMONEY 115 + EXTRAOFFSET - #define OFFSET_PRIMARYWEAPON 116 + EXTRAOFFSET - #define OFFSET_LASTACTIVITY 124 + EXTRAOFFSET - #define OFFSET_INTERNALMODEL 126 + EXTRAOFFSET - #define OFFSET_NVGOGGLES 129 + EXTRAOFFSET - #define OFFSET_DEFUSE_PLANT 193 + EXTRAOFFSET - #define OFFSET_MENU 205 + EXTRAOFFSET - #define OFFSET_VIP 209 + EXTRAOFFSET - #define OFFSET_TK 216 + EXTRAOFFSET // 040926 - #define OFFSET_HOSTAGEKILLS 217 + EXTRAOFFSET - #define OFFSET_MAPZONE 235 + EXTRAOFFSET - #define OFFSET_ISDRIVING 350 + EXTRAOFFSET // 040926 - #define OFFSET_STATIONARY 362 + EXTRAOFFSET // 040927 (363 works also!) - #define OFFSET_ZOOMTYPE 363 + EXTRAOFFSET - - #define OFFSET_AWM_AMMO 377 + EXTRAOFFSET // 041029: All of these *_AMMO:s were changed -5 - #define OFFSET_SCOUT_AMMO 378 + EXTRAOFFSET - #define OFFSET_PARA_AMMO 379 + EXTRAOFFSET - #define OFFSET_FAMAS_AMMO 380 + EXTRAOFFSET - #define OFFSET_M3_AMMO 381 + EXTRAOFFSET - #define OFFSET_USP_AMMO 382 + EXTRAOFFSET - #define OFFSET_FIVESEVEN_AMMO 383 + EXTRAOFFSET - #define OFFSET_DEAGLE_AMMO 384 + EXTRAOFFSET - #define OFFSET_P228_AMMO 385 + EXTRAOFFSET - #define OFFSET_GLOCK_AMMO 386 + EXTRAOFFSET - #define OFFSET_FLASH_AMMO 387 + EXTRAOFFSET - #define OFFSET_HE_AMMO 388 + EXTRAOFFSET - #define OFFSET_SMOKE_AMMO 389 + EXTRAOFFSET - #define OFFSET_C4_AMMO 390 + EXTRAOFFSET - - #define OFFSET_CSDEATHS 444 + EXTRAOFFSET // 040926 - #define OFFSET_SHIELD 510 + EXTRAOFFSET - // "weapon_*" entities - #define OFFSET_WEAPONTYPE 43 + EXTRAOFFSET_WEAPONS - #define OFFSET_CLIPAMMO 51 + EXTRAOFFSET_WEAPONS - #define OFFSET_SILENCER_FIREMODE 74 + EXTRAOFFSET_WEAPONS - // "hostage_entity" entities - #define OFFSET_HOSTAGEFOLLOW 86 + EXTRAOFFSET - #define OFFSET_HOSTAGE_NEXTUSE 100 + EXTRAOFFSET - #define OFFSET_HOSTAGE_LASTUSE 483 + EXTRAOFFSET - #define OFFSET_HOSTAGEID 487 + EXTRAOFFSET - // "armoury_entity" - #define OFFSET_ARMOURY_TYPE 34 + EXTRAOFFSET_WEAPONS - // C4 offsets - #define OFFSET_C4_EXPLODE_TIME 100 + EXTRAOFFSET - #define OFFSET_C4_DEFUSING 0x181 + ACTUAL_EXTRA_OFFSET -#else - // Amd64 offsets here - #define OFFSET_ARMORTYPE 137 + EXTRAOFFSET - #define OFFSET_TEAM 139 + EXTRAOFFSET // +25 - #define OFFSET_CSMONEY 140 + EXTRAOFFSET // +25 - #define OFFSET_PRIMARYWEAPON 141 + EXTRAOFFSET // +25 - #define OFFSET_INTERNALMODEL 152 + EXTRAOFFSET // +26 - #define OFFSET_NVGOGGLES 155 + EXTRAOFFSET // +26 - #define OFFSET_DEFUSE_PLANT 219 + EXTRAOFFSET // +26 - #define OFFSET_VIP 242 + EXTRAOFFSET // +27 - #define OFFSET_TK 249 + EXTRAOFFSET // +33 040927 - #define OFFSET_MAPZONE 268 + EXTRAOFFSET // +27 - #define OFFSET_ISDRIVING 386 + EXTRAOFFSET // 040927 - #define OFFSET_STATIONARY 400 + EXTRAOFFSET // 040927 (401 works also) - #define OFFSET_ZOOMTYPE 402 + EXTRAOFFSET - - #define OFFSET_AWM_AMMO 426 + EXTRAOFFSET // +44 - #define OFFSET_SCOUT_AMMO 427 + EXTRAOFFSET // +44 - #define OFFSET_PARA_AMMO 428 + EXTRAOFFSET // +44 - #define OFFSET_FAMAS_AMMO 429 + EXTRAOFFSET // +44 - #define OFFSET_M3_AMMO 430 + EXTRAOFFSET // +44 - #define OFFSET_USP_AMMO 431 + EXTRAOFFSET // +44 - #define OFFSET_FIVESEVEN_AMMO 432 + EXTRAOFFSET // +44 - #define OFFSET_DEAGLE_AMMO 433 + EXTRAOFFSET // +44 - #define OFFSET_P228_AMMO 434 + EXTRAOFFSET // +44 - #define OFFSET_GLOCK_AMMO 435 + EXTRAOFFSET // +44 - #define OFFSET_FLASH_AMMO 436 + EXTRAOFFSET // +44 - #define OFFSET_HE_AMMO 437 + EXTRAOFFSET // +44 - #define OFFSET_SMOKE_AMMO 438 + EXTRAOFFSET // +44 - #define OFFSET_C4_AMMO 439 + EXTRAOFFSET // +44 - - #define OFFSET_CSDEATHS 493 + EXTRAOFFSET // +49 - #define OFFSET_SHIELD 559 + EXTRAOFFSET - // "weapon_*" entities - #define OFFSET_WEAPONTYPE 57 + EXTRAOFFSET // +14 - #define OFFSET_CLIPAMMO 65 + EXTRAOFFSET // +14 - #define OFFSET_SILENCER_FIREMODE 88 + EXTRAOFFSET // +14 - // "hostage_entity" entities - #define OFFSET_HOSTAGEFOLLOW 51 + EXTRAOFFSET // +21, long=51, int=107! (must use the long* offset because pointers on amd64 are stored the size of longs, 8 bytes, instead of the usual int 4 bytes.) - #define OFFSET_HOSTAGEID 516 + EXTRAOFFSET // +29 -#endif - -#if defined(__linux__) - #define CS_IDENT_USEBOTARGS "UseBotArgs" - #define CS_IDENT_BOTARGS "BotArgs" - #define CS_IDENT_HIDDEN_STATE false -#elif defined(__APPLE__) - #define CS_IDENT_USEBOTARGS "UseBotArgs" - #define CS_IDENT_BOTARGS "BotArgs" - #define CS_IDENT_HIDDEN_STATE true -#else - #define CS_CLICMD_OFFS_USEBOTARGS 2 - #define CS_CLICMD_OFFS_BOTARGS 22 -#endif - -#if defined(__linux__) - #define CS_IDENT_GIVENSHIELD "_ZN11CBasePlayer10GiveShieldEb" // CS_OnBuy forward - #define CS_IDENT_GIVENAMEDITEM "_ZN11CBasePlayer13GiveNamedItemEPKc" // CS_OnBuy forward - #define CS_IDENT_ADDACCOUNT "_ZN11CBasePlayer10AddAccountEib" // CS_OnBuy forward - #define CS_IDENT_CREATENAMEDENTITY "_Z19CREATE_NAMED_ENTITYj" // cs_create_entity - #define CS_IDENT_UTIL_FINDENTITYBYSTRING "_Z23UTIL_FindEntityByStringP11CBaseEntityPKcS2_" // cs_create_entity - #define CS_IDENT_HIDDEN_STATE false -#elif defined(__APPLE__) - #define CS_IDENT_GIVENSHIELD "_ZN11CBasePlayer10GiveShieldEb" - #define CS_IDENT_GIVENAMEDITEM "_ZN11CBasePlayer13GiveNamedItemEPKc" - #define CS_IDENT_ADDACCOUNT "_ZN11CBasePlayer10AddAccountEib" - #define CS_IDENT_CREATENAMEDENTITY "_Z19CREATE_NAMED_ENTITYj" - #define CS_IDENT_UTIL_FINDENTITYBYSTRING "_Z23UTIL_FindEntityByStringP11CBaseEntityPKcS2_" - #define CS_IDENT_HIDDEN_STATE true -#elif defined(WIN32) - #define CS_IDENT_GIVENSHIELD "\\x56\\x8B\\x2A\\x57\\x33\\x2A\\x8B\\x2A\\x2A\\x2A\\x2A\\x2A\\xB0" - #define CS_IDENT_GIVENAMEDITEM "\\x8B\\x2A\\x2A\\x2A\\x56\\x57\\x8B\\x2A\\x8B\\x2A\\x2A\\x2A\\x2A\\x2A\\x2B" - #define CS_IDENT_ADDACCOUNT "\\x8B\\x2A\\x2A\\x2A\\x56\\x8B\\x2A\\x8B\\x2A\\x2A\\x2A\\x2A\\x2A\\x03" - #define CS_IDENT_CREATENAMEDENTITY "\\x56\\x57\\x8B\\x2A\\x2A\\x2A\\x57\\xFF\\x2A\\x2A\\x2A\\x2A\\x2A\\x8B" - #define CS_IDENT_UTIL_FINDENTITYBYSTRING "\\x51\\x8B\\x2A\\x2A\\x2A\\x53\\x55\\x56\\x85\\x2A\\x57" - #define CS_IDENT_HIDDEN_STATE false -#endif - -#define CSI_P228 CSW_P228 -#define CSI_SCOUT CSW_SCOUT -#define CSI_HEGRENADE CSW_HEGRENADE -#define CSI_XM1014 CSW_XM1014 -#define CSI_C4 CSW_C4 -#define CSI_MAC10 CSW_MAC10 -#define CSI_AUG CSW_AUG -#define CSI_SMOKEGRENADE CSW_SMOKEGRENADE -#define CSI_ELITE CSW_ELITE -#define CSI_FIVESEVEN CSW_FIVESEVEN -#define CSI_UMP45 CSW_UMP45 -#define CSI_SG550 CSW_SG550 -#define CSI_GALI CSW_GALI -#define CSI_FAMAS CSW_FAMAS -#define CSI_USP CSW_USP -#define CSI_GLOCK18 CSW_GLOCK18 -#define CSI_AWP CSW_AWP -#define CSI_MP5NAVY CSW_MP5NAVY -#define CSI_M249 CSW_M249 -#define CSI_M3 CSW_M3 -#define CSI_M4A1 CSW_M4A1 -#define CSI_TMP CSW_TMP -#define CSI_G3SG1 CSW_G3SG1 -#define CSI_FLASHBANG CSW_FLASHBANG -#define CSI_DEAGLE CSW_DEAGLE -#define CSI_SG552 CSW_SG552 -#define CSI_AK47 CSW_AK47 -#define CSI_KNIFE CSW_KNIFE -#define CSI_P90 CSW_P90 -#define CSI_SHIELDGUN CSW_SHIELDGUN -#define CSI_VEST CSW_VEST // Custom -#define CSI_VESTHELM CSW_VESTHELM // Custom -#define CSI_DEFUSER 33 // Custom -#define CSI_NVGS 34 // Custom -#define CSI_PRIMAMMO 36 // Custom -#define CSI_SECAMMO 37 // Custom +/** + * Weapon Ids for use with CS_OnBuyAttempt(), CS_OnBuy(). + */ +#define CSI_P228 CSW_P228 +#define CSI_SCOUT CSW_SCOUT +#define CSI_HEGRENADE CSW_HEGRENADE +#define CSI_XM1014 CSW_XM1014 +#define CSI_C4 CSW_C4 +#define CSI_MAC10 CSW_MAC10 +#define CSI_AUG CSW_AUG +#define CSI_SMOKEGRENADE CSW_SMOKEGRENADE +#define CSI_ELITE CSW_ELITE +#define CSI_FIVESEVEN CSW_FIVESEVEN +#define CSI_UMP45 CSW_UMP45 +#define CSI_SG550 CSW_SG550 +#define CSI_GALIL CSW_GALIL +#define CSI_FAMAS CSW_FAMAS +#define CSI_USP CSW_USP +#define CSI_GLOCK18 CSW_GLOCK18 +#define CSI_AWP CSW_AWP +#define CSI_MP5NAVY CSW_MP5NAVY +#define CSI_M249 CSW_M249 +#define CSI_M3 CSW_M3 +#define CSI_M4A1 CSW_M4A1 +#define CSI_TMP CSW_TMP +#define CSI_G3SG1 CSW_G3SG1 +#define CSI_FLASHBANG CSW_FLASHBANG +#define CSI_DEAGLE CSW_DEAGLE +#define CSI_SG552 CSW_SG552 +#define CSI_AK47 CSW_AK47 +#define CSI_P90 CSW_P90 +#define CSI_SHIELDGUN CSW_SHIELDGUN // The real CS value, use CSI_SHIELD instead. +#define CSI_VEST CSW_VEST // Custom +#define CSI_VESTHELM CSW_VESTHELM // Custom +#define CSI_DEFUSER 33 // Custom +#define CSI_NVGS 34 // Custom +#define CSI_PRIAMMO 36 // Custom +#define CSI_SECAMMO 37 // Custom +#define CSI_SHIELD 38 // Custom - The value passed by the forward, more convenient for plugins. #define BITS_PISTOLS (1<v; + edict_t *pEdict = INDEXENT(0); + entvars_t *pev = VARS(pEdict); - byte* private_c = (byte*)edict->pvPrivateData; + byte *privateData = reinterpret_cast(pEdict->pvPrivateData); for (int i = 0; i < 0xFFF; i++) { - uintptr_t val = *((uintptr_t*)(private_c + i)); + entvars_t *val = *(reinterpret_cast(privateData + i)); - if (val == (uintptr_t)entvars) + if (val == pev) { this->pev = i; return; @@ -82,7 +82,8 @@ void* HL_TypeConversion::id_to_cbase(int index) entvars_t* HL_TypeConversion::id_to_entvar(int index) { - return &(INDEXENT2(index)->v); + edict_t *pEdict = INDEXENT2(index); + return pEdict ? VARS(pEdict) : nullptr; } entvars_t* HL_TypeConversion::cbase_to_entvar(void* cbase) @@ -92,7 +93,7 @@ entvars_t* HL_TypeConversion::cbase_to_entvar(void* cbase) return nullptr; } - return *(entvars_t **)((char *)(cbase) + G_OffsetHandler->pev); + return *reinterpret_cast(reinterpret_cast(cbase) + G_OffsetHandler->pev); } int HL_TypeConversion::cbase_to_id(void *cbase) @@ -102,7 +103,7 @@ int HL_TypeConversion::cbase_to_id(void *cbase) return -1; } - entvars_t* pev = this->cbase_to_entvar(cbase); + entvars_t *pev = this->cbase_to_entvar(cbase); if (!pev) { diff --git a/modules/cstrike/cstrike/CstrikeHacks.cpp b/modules/cstrike/cstrike/CstrikeHacks.cpp index 4fecf07f..e5cf68f9 100644 --- a/modules/cstrike/cstrike/CstrikeHacks.cpp +++ b/modules/cstrike/cstrike/CstrikeHacks.cpp @@ -13,43 +13,52 @@ #include "CstrikeDatas.h" #include "CstrikeUtils.h" -#include "CDetour/detours.h" +#include "CstrikeHacks.h" +#include "CstrikeHLTypeConversion.h" #include void CtrlDetours_ClientCommand(bool set); void CtrlDetours_BuyCommands(bool set); +void CtrlDetours_Natives(bool set); int ForwardInternalCommand = -1; -int ForwardOnBuy = -1; -int ForwardOnBuyAttempt = -1; +int ForwardOnBuy = -1; +int ForwardOnBuyAttempt = -1; -int *UseBotArgs = NULL; -const char **BotArgs = NULL; +int *UseBotArgs; +const char **BotArgs; -CDetour *ClientCommandDetour = NULL; -CDetour *GiveShieldDetour = NULL; -CDetour *GiveNamedItemDetour = NULL; -CDetour *AddAccountDetour = NULL; +CDetour *ClientCommandDetour; +CDetour *GiveShieldDetour; +CDetour *GiveNamedItemDetour; +CDetour *AddAccountDetour; +CDetour *GiveDefaultItemsDetour; -int CurrentItemId = 0; +CreateNamedEntityFunc CS_CreateNamedEntity; +UTIL_FindEntityByStringFunc CS_UTIL_FindEntityByString; + +int CurrentItemId; StringHashMap ItemAliasList; +int TeamOffset; +int MenuOffset; -extern enginefuncs_t *g_pengfuncsTable; +server_static_t *ServerStatic; +server_t *Server; void InitializeHacks() { -#if defined AMD64 - #error UNSUPPORTED -#endif - CtrlDetours_ClientCommand(true); CtrlDetours_BuyCommands(true); + CtrlDetours_Natives(true); + + InitGlobalVars(); } void ShutdownHacks() { CtrlDetours_ClientCommand(false); CtrlDetours_BuyCommands(false); + CtrlDetours_Natives(false); } #undef CMD_ARGV @@ -63,7 +72,7 @@ const char *CMD_ARGV(int i) return BotArgs[i]; } - return NULL; + return nullptr; } return g_engfuncs.pfnCmd_Argv(i); @@ -74,7 +83,7 @@ void OnEmitSound(edict_t *entity, int channel, const char *sample, float volume, // If shield is blocked with CS_OnBuy, we need to block the pickup sound ("items/gunpickup2.wav") // as well played right after. Why this sound is not contained in GiveShield()? - g_pengfuncsTable->pfnEmitSound = NULL; + g_pengfuncsTable->pfnEmitSound = nullptr; RETURN_META(MRES_SUPERCEDE); } @@ -101,9 +110,9 @@ DETOUR_DECL_STATIC1(C_ClientCommand, void, edict_t*, pEdict) // void ClientComma { static const int menuItemsTe[][9] = { - /* Menu_Buy */ { 0, 0, 0, 0, 0, 0, CSI_PRIMAMMO, CSI_SECAMMO, 0 }, + /* Menu_Buy */ { 0, 0, 0, 0, 0, 0, CSI_PRIAMMO, CSI_SECAMMO, 0 }, /* Menu_BuyPistol */ { 0, CSI_GLOCK18, CSI_USP, CSI_P228, CSI_DEAGLE, CSI_ELITE, 0, 0, 0 }, - /* Menu_BuyRifle */ { 0, CSI_GALI, CSI_AK47, CSI_SCOUT, CSI_SG552, CSI_AWP, CSI_G3SG1, 0, 0 }, + /* Menu_BuyRifle */ { 0, CSI_GALIL, CSI_AK47, CSI_SCOUT, CSI_SG552, CSI_AWP, CSI_G3SG1, 0, 0 }, /* Menu_BuyMachineGun */ { 0, CSI_M249, 0, 0, 0, 0, 0, 0, 0 }, /* Menu_BuyShotgun */ { 0, CSI_M3, CSI_XM1014, 0, 0, 0, 0, 0, 0 }, /* Menu_BuySubMachineGun */ { 0, CSI_MAC10, CSI_MP5NAVY, CSI_UMP45, CSI_P90, 0, 0, 0, 0 }, @@ -112,7 +121,7 @@ DETOUR_DECL_STATIC1(C_ClientCommand, void, edict_t*, pEdict) // void ClientComma static const int menuItemsCt[][9] = { - /* Menu_Buy */ { 0, 0, 0, 0, 0, 0, CSI_PRIMAMMO, CSI_SECAMMO, 0 }, + /* Menu_Buy */ { 0, 0, 0, 0, 0, 0, CSI_PRIAMMO, CSI_SECAMMO, 0 }, /* Menu_BuyPistol */ { 0, CSI_GLOCK18, CSI_USP, CSI_P228, CSI_DEAGLE, CSI_FIVESEVEN, 0, 0, 0 }, /* Menu_BuyRifle */ { 0, CSI_FAMAS, CSI_SCOUT, CSI_M4A1, CSI_AUG, CSI_SG550, CSI_AWP, 0, 0 }, /* Menu_BuyMachineGun */ { 0, CSI_M249, 0, 0, 0, 0, 0, 0, 0 }, @@ -121,11 +130,11 @@ DETOUR_DECL_STATIC1(C_ClientCommand, void, edict_t*, pEdict) // void ClientComma /* Menu_BuyItem */ { 0, CSI_VEST, CSI_VESTHELM, CSI_FLASHBANG, CSI_HEGRENADE, CSI_SMOKEGRENADE, CSI_NVGS, CSI_DEFUSER, CSI_SHIELDGUN } }; - int menuId = *((int *)pEdict->pvPrivateData + OFFSET_MENU); + int menuId = get_pdata(pEdict, MenuOffset); + if (menuId >= Menu_Buy && menuId <= Menu_BuyItem) { - int team = *((int *)pEdict->pvPrivateData + OFFSET_TEAM); - switch (team) + switch (get_pdata(pEdict, TeamOffset)) { case TEAM_T: itemId = menuItemsTe[menuId - 4][slot]; break; // -4 because array is zero-based and Menu_Buy* constants starts from 4. case TEAM_CT:itemId = menuItemsCt[menuId - 4][slot]; break; @@ -170,12 +179,41 @@ DETOUR_DECL_STATIC1(C_ClientCommand, void, edict_t*, pEdict) // void ClientComma DETOUR_STATIC_CALL(C_ClientCommand)(pEdict); } +edict_s* OnCreateNamedEntity(int classname) +{ + if (NoKifesMode) + { + if (!strcmp(STRING(classname), "weapon_knife")) + { + RETURN_META_VALUE(MRES_SUPERCEDE, nullptr); + } + } + else + { + g_pengfuncsTable->pfnCreateNamedEntity = nullptr; + } + + RETURN_META_VALUE(MRES_IGNORED, 0); +} + +DETOUR_DECL_MEMBER0(GiveDefaultItems, void) // void CBasePlayer::GiveDefaultItems(void) +{ + if (NoKifesMode) + { + g_pengfuncsTable->pfnCreateNamedEntity = OnCreateNamedEntity; + } + + DETOUR_MEMBER_CALL(GiveDefaultItems)(); + + g_pengfuncsTable->pfnCreateNamedEntity = nullptr; +} + DETOUR_DECL_MEMBER1(GiveNamedItem, void, const char*, pszName) // void CBasePlayer::GiveNamedItem(const char *pszName) { // If the current item id is not null, this means player has triggers a buy command. if (CurrentItemId) { - int client = PrivateToIndex(this); + int client = G_HL_TypeConversion.cbase_to_id(this); if (MF_IsPlayerAlive(client) && MF_ExecuteForward(ForwardOnBuy, static_cast(client), static_cast(CurrentItemId)) > 0) { @@ -196,7 +234,7 @@ DETOUR_DECL_MEMBER1(GiveShield, void, bool, bRetire) // void CBasePlayer::GiveSh // Special case for shield. Game doesn't use GiveNamedItem() to give a shield. if (CurrentItemId == CSI_SHIELDGUN) { - int client = PrivateToIndex(this); + int client = G_HL_TypeConversion.cbase_to_id(this); if (MF_IsPlayerAlive(client) && MF_ExecuteForward(ForwardOnBuy, static_cast(client), CSI_SHIELDGUN) > 0) { @@ -236,30 +274,52 @@ void CtrlDetours_ClientCommand(bool set) { if (set) { - void *target = (void *)MDLL_ClientCommand; + void *base = reinterpret_cast(MDLL_ClientCommand); #if defined(WIN32) - UseBotArgs = *(int **)((unsigned char *)target + CS_CLICMD_OFFS_USEBOTARGS); - BotArgs = (const char **)*(const char **)((unsigned char *)target + CS_CLICMD_OFFS_BOTARGS); + int offset = 0; + + if (MainConfig->GetOffset("UseBotArgs", &offset)) + { + UseBotArgs = get_pdata(base, offset); + } + + if (MainConfig->GetOffset("BotArgs", &offset)) + { + BotArgs = get_pdata(base, offset); + } #elif defined(__linux__) || defined(__APPLE__) - UseBotArgs = (int *)UTIL_FindAddressFromEntry(CS_IDENT_USEBOTARGS, CS_IDENT_HIDDEN_STATE); - BotArgs = (const char **)UTIL_FindAddressFromEntry(CS_IDENT_BOTARGS, CS_IDENT_HIDDEN_STATE); + void *address = nullptr; + if (MainConfig->GetMemSig("UseBotArgs", &address)) + { + UseBotArgs = reinterpret_cast(address); + } + + if (MainConfig->GetMemSig("BotArgs", &address)) + { + BotArgs = reinterpret_cast(address); + } #endif - ClientCommandDetour = DETOUR_CREATE_STATIC_FIXED(C_ClientCommand, target); + ClientCommandDetour = DETOUR_CREATE_STATIC_FIXED(C_ClientCommand, base); - if (!ClientCommandDetour) + CommonConfig->GetOffsetByClass("CBasePlayer", "m_iTeam", &TeamOffset); + CommonConfig->GetOffsetByClass("CBasePlayer", "m_iMenu", &MenuOffset); + + if (!ClientCommandDetour || !UseBotArgs || !BotArgs || !TeamOffset || !MenuOffset) { MF_Log("ClientCommand is not available - forward client_command has been disabled"); } } else { - if (ClientCommandDetour) + if (ClientCommandDetour) + { ClientCommandDetour->Destroy(); + } ItemAliasList.clear(); } @@ -268,7 +328,9 @@ void CtrlDetours_ClientCommand(bool set) void ToggleDetour_ClientCommands(bool enable) { if (ClientCommandDetour) + { (enable) ? ClientCommandDetour->EnableDetour() : ClientCommandDetour->DisableDetour(); + } if (enable) { @@ -291,7 +353,7 @@ void ToggleDetour_ClientCommands(bool enable) { "elites" , CSI_ELITE }, { "fn57" , CSI_FIVESEVEN }, { "fiveseven" , CSI_FIVESEVEN }, { "ump45" , CSI_UMP45 }, { "sg550" , CSI_SG550 }, { "krieg550" , CSI_SG550 }, - { "galil" , CSI_GALI }, { "defender" , CSI_GALI }, + { "galil" , CSI_GALIL }, { "defender" , CSI_GALIL }, { "famas" , CSI_FAMAS }, { "clarion" , CSI_FAMAS }, { "usp" , CSI_USP }, { "km45" , CSI_USP }, { "glock" , CSI_GLOCK18 }, { "9x19mm" , CSI_GLOCK18 }, @@ -308,12 +370,12 @@ void ToggleDetour_ClientCommands(bool enable) { "c90" , CSI_P90 }, { "vest" , CSI_VEST }, { "vesthelm" , CSI_VESTHELM }, { "defuser" , CSI_DEFUSER }, { "nvgs" , CSI_NVGS }, { "shield" , CSI_SHIELDGUN }, - { "buyammo1" , CSI_PRIMAMMO }, { "primammo" , CSI_PRIMAMMO }, + { "buyammo1" , CSI_PRIAMMO }, { "primammo" , CSI_PRIAMMO }, { "buyammo2" , CSI_SECAMMO }, { "secammo" , CSI_SECAMMO }, - { NULL , 0 } + { nullptr , 0 } }; - for (size_t i = 0; aliasToId[i].alias != NULL; ++i) + for (size_t i = 0; aliasToId[i].alias != nullptr; ++i) { ItemAliasList.insert(aliasToId[i].alias, aliasToId[i].id); } @@ -329,14 +391,23 @@ void CtrlDetours_BuyCommands(bool set) { if (set) { - void *giveShieldAddress = UTIL_FindAddressFromEntry(CS_IDENT_GIVENSHIELD , CS_IDENT_HIDDEN_STATE); - void *giveNamedItemAddress = UTIL_FindAddressFromEntry(CS_IDENT_GIVENAMEDITEM, CS_IDENT_HIDDEN_STATE); - void *addAccountAddress = UTIL_FindAddressFromEntry(CS_IDENT_ADDACCOUNT , CS_IDENT_HIDDEN_STATE); + void *address = nullptr; - GiveShieldDetour = DETOUR_CREATE_MEMBER_FIXED(GiveShield, giveShieldAddress); - GiveNamedItemDetour = DETOUR_CREATE_MEMBER_FIXED(GiveNamedItem, giveNamedItemAddress); - AddAccountDetour = DETOUR_CREATE_MEMBER_FIXED(AddAccount, addAccountAddress); + if (MainConfig->GetMemSig("GiveShield", &address)) + { + GiveShieldDetour = DETOUR_CREATE_MEMBER_FIXED(GiveShield, address); + } + if (MainConfig->GetMemSig("GiveNamedItem", &address)) + { + GiveNamedItemDetour = DETOUR_CREATE_MEMBER_FIXED(GiveNamedItem, address); + } + + if (MainConfig->GetMemSig("AddAccount", &address)) + { + AddAccountDetour = DETOUR_CREATE_MEMBER_FIXED(AddAccount, address); + } + if (!GiveShieldDetour || !GiveNamedItemDetour || !AddAccountDetour) { if (!GiveShieldDetour) @@ -360,13 +431,19 @@ void CtrlDetours_BuyCommands(bool set) else { if (GiveShieldDetour) + { GiveShieldDetour->Destroy(); + } if (GiveNamedItemDetour) + { GiveNamedItemDetour->Destroy(); + } if (AddAccountDetour) + { AddAccountDetour->Destroy(); + } ItemAliasList.clear(); } @@ -375,11 +452,97 @@ void CtrlDetours_BuyCommands(bool set) void ToggleDetour_BuyCommands(bool enable) { if (GiveShieldDetour) + { (enable) ? GiveShieldDetour->EnableDetour() : GiveShieldDetour->DisableDetour(); + } if (GiveNamedItemDetour) + { (enable) ? GiveNamedItemDetour->EnableDetour() : GiveNamedItemDetour->DisableDetour(); + } if (AddAccountDetour) + { (enable) ? AddAccountDetour->EnableDetour() : AddAccountDetour->DisableDetour(); + } } + +void CtrlDetours_Natives(bool set) +{ + if (set) + { + void *address = nullptr; + + if (MainConfig->GetMemSig("CreateNamedEntity", &address)) // cs_create_entity() + { + CS_CreateNamedEntity = reinterpret_cast(address); + } + + if (MainConfig->GetMemSig("FindEntityByString", &address)) // cs_find_ent_by_class() + { + CS_UTIL_FindEntityByString = reinterpret_cast(address); + } + + if (!CS_CreateNamedEntity) + { + MF_Log("CREATE_NAMED_ENITTY is not available - native cs_create_entity() has been disabled"); + } + + if (!CS_UTIL_FindEntityByString) + { + MF_Log("UTIL_FindEntByString is not available - native cs_find_ent_by_class() has been disabled"); + } + + if (MainConfig->GetMemSig("GiveDefaultItems", &address)) + { + GiveDefaultItemsDetour = DETOUR_CREATE_MEMBER_FIXED(GiveDefaultItems, address); + } + + if (!GiveDefaultItemsDetour) + { + MF_Log("GiveDefaultItems is not available - native cs_set_no_knives has been disabled"); + } + } + else + { + if (GiveDefaultItemsDetour) + { + GiveDefaultItemsDetour->Destroy(); + } + } +} + +void InitGlobalVars() +{ + void *address = nullptr; + +#if defined(WIN32) + + int offset = 0; + + if (CommonConfig->GetOffset("svs", &offset)) + { + uintptr_t base = *reinterpret_cast(reinterpret_cast(g_engfuncs.pfnGetCurrentPlayer) + offset); + ServerStatic = reinterpret_cast(base - 4); + } +#else + if (CommonConfig->GetMemSig("svs", &address)) + { + ServerStatic = reinterpret_cast(address); + } +#endif + if (CommonConfig->GetAddress("sv", &address)) + { + Server = *reinterpret_cast(address); + } + + if (!ServerStatic) + { + MF_Log("svs global variable is not available\n"); + } + + if (!Server) + { + MF_Log("sv global variable is not available\n"); + } +} \ No newline at end of file diff --git a/modules/cstrike/cstrike/CstrikeHacks.h b/modules/cstrike/cstrike/CstrikeHacks.h new file mode 100644 index 00000000..c7d91474 --- /dev/null +++ b/modules/cstrike/cstrike/CstrikeHacks.h @@ -0,0 +1,51 @@ +// vim: set ts=4 sw=4 tw=99 noet: +// +// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). +// Copyright (C) The AMX Mod X Development Team. +// +// This software is licensed under the GNU General Public License, version 3 or higher. +// Additional exceptions apply. For full license details, see LICENSE.txt or visit: +// https://alliedmods.net/amxmodx-license + +// +// Counter-Strike Module +// + +#ifndef CSTRIKE_HACKS_H +#define CSTRIKE_HACKS_H + +#include +#include +#include +#include + +void InitializeHacks(); +void InitGlobalVars(); +void ShutdownHacks(); +void ToggleDetour_ClientCommands(bool enable); +void ToggleDetour_BuyCommands(bool enable); + +extern AMX_NATIVE_INFO CstrikeNatives[]; + +extern IGameConfig *MainConfig; +extern IGameConfig *CommonConfig; + +extern int ForwardInternalCommand; +extern int ForwardOnBuy; +extern int ForwardOnBuyAttempt; + +typedef edict_t* (*CreateNamedEntityFunc)(string_t iszClassname); +typedef void* (*UTIL_FindEntityByStringFunc)(void* pStartEntity, const char *szKeyword, const char *szValue); + +extern CreateNamedEntityFunc CS_CreateNamedEntity; +extern UTIL_FindEntityByStringFunc CS_UTIL_FindEntityByString; + +extern CDetour *GiveDefaultItemsDetour; +extern enginefuncs_t *g_pengfuncsTable; +extern DLL_FUNCTIONS *g_pFunctionTable; +extern bool NoKifesMode; + +extern server_static_t *ServerStatic; +extern server_t *Server; + +#endif // CSTRIKE_HACKS_H diff --git a/modules/cstrike/cstrike/amxx_api.cpp b/modules/cstrike/cstrike/CstrikeMain.cpp similarity index 64% rename from modules/cstrike/cstrike/amxx_api.cpp rename to modules/cstrike/cstrike/CstrikeMain.cpp index 4fcefc13..05bfe478 100644 --- a/modules/cstrike/cstrike/amxx_api.cpp +++ b/modules/cstrike/cstrike/CstrikeMain.cpp @@ -14,21 +14,14 @@ #include "amxxmodule.h" #include "CstrikeUtils.h" #include "CstrikeDatas.h" +#include "CstrikeHacks.h" #include "CstrikeHLTypeConversion.h" +#include +#include "engine_strucs.h" -extern AMX_NATIVE_INFO CstrikeNatives[]; - -extern int ForwardInternalCommand; -extern int ForwardOnBuy; -extern int ForwardOnBuyAttempt; - -void InitializeHacks(); -void ShutdownHacks(); -void ToggleDetour_ClientCommands(bool enable); -void ToggleDetour_BuyCommands(bool enable); - -CreateNamedEntityFunc CS_CreateNamedEntity = nullptr; -UTIL_FindEntityByStringFunc CS_UTIL_FindEntityByString = nullptr; +IGameConfig *MainConfig; +IGameConfig *CommonConfig; +IGameConfigManager *ConfigManager; int AmxxCheckGame(const char *game) { @@ -44,23 +37,26 @@ void OnAmxxAttach() { MF_AddNatives(CstrikeNatives); + ConfigManager = MF_GetConfigManager(); + + char error[256]; + error[0] = '\0'; + + if (!ConfigManager->LoadGameConfigFile("modules.games", &MainConfig, error, sizeof(error)) && error[0] != '\0') + { + MF_Log("Could not read module.games gamedata: %s", error); + return; + } + + error[0] = '\0'; + + if (!ConfigManager->LoadGameConfigFile("common.games", &CommonConfig, error, sizeof(error)) && error[0] != '\0') + { + MF_Log("Could not read common.games gamedata: %s", error); + return; + } + InitializeHacks(); - - // cs_create_entity() - CS_CreateNamedEntity = reinterpret_cast(UTIL_FindAddressFromEntry(CS_IDENT_CREATENAMEDENTITY, CS_IDENT_HIDDEN_STATE)); - - if (CS_CreateNamedEntity <= 0) - { - MF_Log("CREATE_NAMED_ENITTY is not available - native cs_create_entity() has been disabled"); - } - - // cs_find_ent_by_class() - CS_UTIL_FindEntityByString = reinterpret_cast(UTIL_FindAddressFromEntry(CS_IDENT_UTIL_FINDENTITYBYSTRING, CS_IDENT_HIDDEN_STATE)); - - if (CS_UTIL_FindEntityByString <= 0) - { - MF_Log("UTIL_FindEntByString is not available - native cs_find_ent_by_class() has been disabled"); - } } void OnPluginsLoaded() @@ -84,9 +80,17 @@ void OnPluginsLoaded() { G_OffsetHandler = new OffsetHandler; } + + // Used with model natives, enabled on demand. + g_pengfuncsTable->pfnSetClientKeyValue = nullptr; + g_pFunctionTable->pfnClientUserInfoChanged = nullptr; + g_pFunctionTable->pfnStartFrame = nullptr; } void OnAmxxDetach() { + ConfigManager->CloseGameConfigFile(MainConfig); + ConfigManager->CloseGameConfigFile(CommonConfig); + ShutdownHacks(); } diff --git a/modules/cstrike/cstrike/CstrikeNatives.cpp b/modules/cstrike/cstrike/CstrikeNatives.cpp index 4d84c3ca..ea9205bf 100644 --- a/modules/cstrike/cstrike/CstrikeNatives.cpp +++ b/modules/cstrike/cstrike/CstrikeNatives.cpp @@ -14,399 +14,441 @@ #include "CstrikeDatas.h" #include "CstrikePlayer.h" #include "CstrikeUtils.h" +#include "CstrikeHacks.h" +#include "CstrikeUserMessages.h" #include "CstrikeHLTypeConversion.h" +#include +#include -CCstrikePlayer g_players[33]; -int g_zooming[33] = {0}; -bool g_precachedknife = false; -bool g_noknives = false; +bool NoKifesMode = false; -static cell AMX_NATIVE_CALL cs_set_user_money(AMX *amx, cell *params) // cs_set_user_money(index, money, flash = 1); = 3 arguments +// native cs_set_user_money(index, money, flash = 1); +static cell AMX_NATIVE_CALL cs_set_user_money(AMX *amx, cell *params) { - // Give money to user - // params[1] = user - // params[2] = money - // params[3] = flash money? + GET_OFFSET("CBasePlayer", m_iAccount); - // Check index - CHECK_PLAYER(params[1]); + int index = params[1]; + int money = params[2]; + int flash = static_cast(params[3] != 0); - // Fetch player pointer - edict_t *pPlayer = MF_GetPlayerEdict(params[1]); + CHECK_PLAYER(index); + edict_t *pPlayer = MF_GetPlayerEdict(index); - // Give money - *((int *)pPlayer->pvPrivateData + OFFSET_CSMONEY) = params[2]; + set_pdata(pPlayer, m_iAccount, money); - // Update display - MESSAGE_BEGIN(MSG_ONE, GET_USER_MSG_ID(PLID, "Money", NULL), NULL, pPlayer); - WRITE_LONG(params[2]); - WRITE_BYTE(params[3] ? 1 : 0); // if params[3] is 0, there will be no +/- flash of money in display... + MESSAGE_BEGIN(MSG_ONE, MessageIdMoney, nullptr, pPlayer); + WRITE_LONG(money); + WRITE_BYTE(flash); MESSAGE_END(); return 1; } -static cell AMX_NATIVE_CALL cs_get_user_money(AMX *amx, cell *params) // cs_get_user_money(index); = 1 argument +// native cs_get_user_money(index); +static cell AMX_NATIVE_CALL cs_get_user_money(AMX *amx, cell *params) { - // Give money to user - // params[1] = user + GET_OFFSET("CBasePlayer", m_iAccount); - // Check index - CHECK_PLAYER(params[1]); + int index = params[1]; - // Fetch player pointer - edict_t *pPlayer = MF_GetPlayerEdict(params[1]); + CHECK_PLAYER(index); + edict_t *pPlayer = MF_GetPlayerEdict(index); - // Return money - return *((int *)pPlayer->pvPrivateData + OFFSET_CSMONEY); + return get_pdata(pPlayer, m_iAccount); } -static cell AMX_NATIVE_CALL cs_get_user_deaths(AMX *amx, cell *params) // cs_get_user_deaths(index); = 1 param +// native cs_get_user_deaths(index); +static cell AMX_NATIVE_CALL cs_get_user_deaths(AMX *amx, cell *params) { - // Gets user deaths in cs. - // params[1] = user + GET_OFFSET("CBasePlayer", m_iDeaths); - // Check index - CHECK_PLAYER(params[1]); + int index = params[1]; - // Fetch player pointer - edict_t *pPlayer = MF_GetPlayerEdict(params[1]); + CHECK_PLAYER(index); + edict_t *pPlayer = MF_GetPlayerEdict(index); - return *((int *)pPlayer->pvPrivateData + OFFSET_CSDEATHS); + return get_pdata(pPlayer, m_iDeaths); } -static cell AMX_NATIVE_CALL cs_set_user_deaths(AMX *amx, cell *params) // cs_set_user_deaths(index, newdeaths); = 2 arguments +// native cs_set_user_deaths(index, newdeaths, bool:scoreboard = true); +static cell AMX_NATIVE_CALL cs_set_user_deaths(AMX *amx, cell *params) { - // Sets user deaths in cs. - // params[1] = user - // params[2] = new deaths + GET_OFFSET("CBasePlayer", m_iDeaths); + GET_OFFSET("CBasePlayer", m_iTeam ); - // Check index - CHECK_PLAYER(params[1]); + int index = params[1]; + int deaths = params[2]; - // Fetch player pointer - edict_t *pPlayer = MF_GetPlayerEdict(params[1]); + CHECK_PLAYER(index); + edict_t *pPlayer = MF_GetPlayerEdict(index); - // Set deaths - *((int *)pPlayer->pvPrivateData + OFFSET_CSDEATHS) = params[2]; + set_pdata(pPlayer, m_iDeaths, deaths); - // Update scoreboard here..? - MESSAGE_BEGIN(MSG_ALL, GET_USER_MSG_ID(PLID, "ScoreInfo", NULL)); - WRITE_BYTE(params[1]); - WRITE_SHORT((int)pPlayer->v.frags); // should these be byte? - WRITE_SHORT(params[2]); // should these be byte? - WRITE_SHORT(0); // dunno what this parameter is (doesn't seem to be vip) // should these be byte? - WRITE_SHORT(*((int *)pPlayer->pvPrivateData + OFFSET_TEAM)); // should these be byte? - MESSAGE_END(); + bool updateScoreboard = true; - *static_cast(MF_PlayerPropAddr(params[1], Player_Deaths)) = params[2]; - - return 1; -} - -static cell AMX_NATIVE_CALL cs_get_hostage_id(AMX *amx, cell *params) // cs_get_hostage_id(index) = 1 param -{ - // Gets unique id of a CS hostage. - // params[1] = hostage entity index - - // Valid entity should be within range - CHECK_ENTITY(params[1]); - - // Make into class pointer - edict_t *pEdict = GETEDICT(params[1]); - - // Make sure this is a hostage. - if (strcmp(STRING(pEdict->v.classname), "hostage_entity") != 0) { - MF_LogError(amx, AMX_ERR_NATIVE, "Entity %d (\"%s\") is not a hostage", params[1], STRING(pEdict->v.classname)); - return 0; + if (*params / sizeof(cell) >= 3) + { + updateScoreboard = params[3] != 0; } - // Return value at offset - return (int)*((int *)pEdict->pvPrivateData + OFFSET_HOSTAGEID); + if (updateScoreboard) + { + MESSAGE_BEGIN(MSG_ALL, MessageIdScoreInfo); + WRITE_BYTE(index); + WRITE_SHORT(static_cast(pPlayer->v.frags)); + WRITE_SHORT(deaths); + WRITE_SHORT(0); + WRITE_SHORT(get_pdata(pPlayer, m_iTeam)); + MESSAGE_END(); + } + + *static_cast(MF_PlayerPropAddr(index, Player_Deaths)) = deaths; + + return 1; } -static cell AMX_NATIVE_CALL cs_get_weapon_silenced(AMX *amx, cell *params) // cs_get_weapon_silenced(index); = 1 param +// native cs_get_hostage_id(index); +static cell AMX_NATIVE_CALL cs_get_hostage_id(AMX *amx, cell *params) { - // Is weapon silenced? Does only work on M4A1 and USP. - // params[1] = weapon index + GET_OFFSET("CHostage", m_iHostageIndex); - // Valid entity should be within range - CHECK_NONPLAYER(params[1]); + int index = params[1]; - // Make into edict pointer - edict_t *pWeapon = INDEXENT(params[1]); + CHECK_NONPLAYER(index); + edict_t *pHostage = INDEXENT(index); - int weapontype = *((int *)pWeapon->pvPrivateData + OFFSET_WEAPONTYPE); - int *silencemode = ((int *)pWeapon->pvPrivateData + OFFSET_SILENCER_FIREMODE); - switch (weapontype) { + CHECK_HOSTAGE(pHostage); + + return get_pdata(pHostage, m_iHostageIndex); +} + +// native cs_get_weapon_silen(index); +static cell AMX_NATIVE_CALL cs_get_weapon_silenced(AMX *amx, cell *params) +{ + GET_OFFSET("CBasePlayerItem" , m_iId); + GET_OFFSET("CBasePlayerWeapon", m_iWeaponState); + + int index = params[1]; + + CHECK_NONPLAYER(index); + edict_t *pWeapon = INDEXENT(index); + + switch (get_pdata(pWeapon, m_iId)) + { case CSW_M4A1: - if (*silencemode & M4A1_SILENCED) + { + if (get_pdata(pWeapon, m_iWeaponState) & WPNSTATE_M4A1_SILENCED) + { return 1; + } + } case CSW_USP: - if (*silencemode & USP_SILENCED) + { + if (get_pdata(pWeapon, m_iWeaponState) & WPNSTATE_USP_SILENCED) + { return 1; + } + } } - // All else return 0. return 0; } -static cell AMX_NATIVE_CALL cs_get_weapon_id(AMX *amx, cell *params) // cs_get_weapon_id(index); = 1 param +// native cs_get_weapon_id(index); +static cell AMX_NATIVE_CALL cs_get_weapon_id(AMX *amx, cell *params) { - // Get weapon type. Corresponds to CSW_* - // params[1] = weapon index + GET_OFFSET("CBasePlayerItem", m_iId); - // Valid entity should be within range - CHECK_NONPLAYER(params[1]); + int index = params[1]; - // Make into edict pointer - edict_t *pWeapon = INDEXENT(params[1]); + CHECK_NONPLAYER(index); + edict_t *pWeapon = INDEXENT(index); - return *((int *)pWeapon->pvPrivateData + OFFSET_WEAPONTYPE); + return get_pdata(pWeapon, m_iId); } -static cell AMX_NATIVE_CALL cs_set_weapon_silenced(AMX *amx, cell *params) // cs_set_weapon_silenced(index, silence = 1); = 2 params +// native cs_set_weapon_silen(index, silence = 1, draw_animation = 1); +static cell AMX_NATIVE_CALL cs_set_weapon_silenced(AMX *amx, cell *params) { - // Silence/unsilence gun. Does only work on M4A1 and USP. - // params[1] = weapon index - // params[2] = 1, and we silence the gun, 0 and we unsilence gun. + GET_OFFSET("CBasePlayerItem" , m_iId); + GET_OFFSET("CBasePlayerWeapon", m_iWeaponState); - // Valid entity should be within range - CHECK_NONPLAYER(params[1]); + int index = params[1]; + int silence = params[2]; - // Make into edict pointer - edict_t *pWeapon = INDEXENT(params[1]); + CHECK_NONPLAYER(index); + edict_t *pWeapon = INDEXENT(index); - bool draw_animation = true; + int draw_animation = 1; if ((params[0] / sizeof(cell)) >= 3) { - draw_animation = params[3] ? true : false; + draw_animation = params[3]; } - int weapontype = (int)*((int *)pWeapon->pvPrivateData + OFFSET_WEAPONTYPE); - int *silencemode = ((int *)pWeapon->pvPrivateData + OFFSET_SILENCER_FIREMODE); + int weaponType = get_pdata(pWeapon, m_iId); + int weaponState = get_pdata(pWeapon, m_iWeaponState); + int weaponNewState = weaponState; + int animation = 0; - switch (weapontype) + switch (weaponType) { case CSW_M4A1: - if (params[2] == 1) + { + if (silence) { - if (!(*silencemode & M4A1_SILENCED)) - { // want to silence - can't already be silenced - *silencemode |= M4A1_SILENCED; - // If this weapon has an owner that is a player, play animation for that player. - if (draw_animation && UTIL_IsPlayer(amx, pWeapon->v.owner)) - { - pWeapon->v.owner->v.weaponanim = M4A1_ATTACHSILENCEANIM; - } - } - } else if (*silencemode & M4A1_SILENCED) { // want to unsilence - can't already be unsilenced - *silencemode &= ~M4A1_SILENCED; - // If this weapon has an owner that is a player, play animation for that player. - if (draw_animation && UTIL_IsPlayer(amx, pWeapon->v.owner)) - { - pWeapon->v.owner->v.weaponanim = M4A1_DETACHSILENCEANIM; - } + weaponNewState |= WPNSTATE_M4A1_SILENCED; + animation = M4A1_ATTACH_SILENCER; + } + else + { + weaponNewState &= ~WPNSTATE_M4A1_SILENCED; + animation = M4A1_DETACH_SILENCER; } break; + } case CSW_USP: - if (params[2] == 1) + { + if (silence) { - if (!(*silencemode & USP_SILENCED)) - { // want to silence - can't already be silenced - *silencemode |= USP_SILENCED; - // If this weapon has an owner that is a player, play animation for that player. - if (draw_animation && UTIL_IsPlayer(amx, pWeapon->v.owner)) - { - pWeapon->v.owner->v.weaponanim = USP_ATTACHSILENCEANIM; - } - } - } else if (*silencemode & USP_SILENCED) { // want to unsilence - can't already be unsilenced - *silencemode &= ~USP_SILENCED; - // If this weapon has an owner that is a player, play animation for that player. - if (draw_animation && UTIL_IsPlayer(amx, pWeapon->v.owner)) - { - pWeapon->v.owner->v.weaponanim = USP_DETACHSILENCEANIM; - } + weaponNewState |= WPNSTATE_USP_SILENCED; + animation = USP_ATTACH_SILENCER; + } + else + { + weaponNewState &= ~WPNSTATE_USP_SILENCED; + animation = USP_DETACH_SILENCER; } break; - default: - return 0; + } } - return 1; -} + if (weaponState != weaponNewState) + { + set_pdata(pWeapon, m_iWeaponState, weaponNewState); -static cell AMX_NATIVE_CALL cs_get_weapon_burstmode(AMX *amx, cell *params) // cs_get_weapon_burstmode(index); = 1 param -{ - // Is weapon in burst mode? Does only work with FAMAS and GLOCK. - // params[1] = weapon index + edict_t *pPlayer = pWeapon->v.owner; - // Valid entity should be within range - CHECK_NONPLAYER(params[1]); + if (draw_animation > 0 && UTIL_IsPlayer(pPlayer)) + { + int currentWeapon = *static_cast(MF_PlayerPropAddr(ENTINDEX(pPlayer), Player_CurrentWeapon)); - // Make into edict pointer - edict_t *pWeapon = INDEXENT(params[1]); - - int weapontype = (int)*((int *)pWeapon->pvPrivateData + OFFSET_WEAPONTYPE); - int* firemode = ((int *)pWeapon->pvPrivateData + OFFSET_SILENCER_FIREMODE); - switch (weapontype) { - case CSW_GLOCK18: - if (*firemode == GLOCK_BURSTMODE) - return 1; - case CSW_FAMAS: - if (*firemode == FAMAS_BURSTMODE) + if (currentWeapon != weaponType) + { return 1; + } + + pPlayer->v.weaponanim = animation; + + if (draw_animation >= 2) + { + // Skip if cl_lw client cvar (client-side weapon firing prediction) is set. + // Technically, this should be associated to UseDecrement(), but it's true by default in game at compilation. + if (!ENGINE_CANSKIP(pPlayer)) + { + MESSAGE_BEGIN(MSG_ONE, SVC_WEAPONANIM, nullptr, pPlayer); + WRITE_BYTE(animation); + WRITE_BYTE(pWeapon->v.body); + MESSAGE_END(); + } + + GET_OFFSET("CBasePlayer", m_szAnimExtention); + GET_OFFSET("CBasePlayerWeapon", m_flTimeWeaponIdle); + GET_OFFSET("CBasePlayerWeapon", m_flNextSecondaryAttack); + GET_OFFSET("CBasePlayerWeapon", m_flNextPrimaryAttack); + + char animExt[12]; + float time; + + switch (weaponType) + { + case CSW_M4A1: + { + strcpy(animExt, "rifle"); + time = 2.0f; + break; + } + case CSW_USP: + { + strcpy(animExt, "onehanded"); + time = 3.0f; + break; + } + } + + set_pdata(pPlayer, m_szAnimExtention, STRING(MAKE_STRING(animExt))); + + set_pdata(pWeapon, m_flTimeWeaponIdle, time); + set_pdata(pWeapon, m_flNextSecondaryAttack, time); + set_pdata(pWeapon, m_flNextPrimaryAttack, time); + } + } + + return 1; } - // All else return 0. return 0; } -static cell AMX_NATIVE_CALL cs_set_weapon_burstmode(AMX *amx, cell *params) // cs_set_weapon_burstmode(index, burstmode = 1); = 2 params +// native cs_get_weapon_burst(index); +static cell AMX_NATIVE_CALL cs_get_weapon_burstmode(AMX *amx, cell *params) { - // Set/unset burstmode. Does only work with FAMAS and GLOCK. - // params[1] = weapon index - // params[2] = 1, and we set burstmode, 0 and we unset it. + GET_OFFSET("CBasePlayerItem" , m_iId); + GET_OFFSET("CBasePlayerWeapon", m_iWeaponState); - // Valid entity should be within range - CHECK_NONPLAYER(params[1]); + int index = params[1]; - // Make into edict pointer - edict_t *pWeapon = INDEXENT(params[1]); + CHECK_NONPLAYER(index); + edict_t *pWeapon = INDEXENT(index); - int weapontype = (int)*((int *)pWeapon->pvPrivateData + OFFSET_WEAPONTYPE); + int flag = 0; - int* firemode = ((int *)pWeapon->pvPrivateData + OFFSET_SILENCER_FIREMODE); - int previousMode = *firemode; - - switch (weapontype) { - case CSW_GLOCK18: - if (params[2]) { - if (previousMode != GLOCK_BURSTMODE) { - *firemode = GLOCK_BURSTMODE; - - // Is this weapon's owner a player? If so send this message... - if (UTIL_IsPlayer(amx, pWeapon->v.owner)) - UTIL_TextMsg_Generic(pWeapon->v.owner, "#Switch_To_BurstFire"); - } - } - else if (previousMode != GLOCK_SEMIAUTOMATIC) { - *firemode = GLOCK_SEMIAUTOMATIC; - - // Is this weapon's owner a player? If so send this message... - if (UTIL_IsPlayer(amx, pWeapon->v.owner)) - UTIL_TextMsg_Generic(pWeapon->v.owner, "#Switch_To_SemiAuto"); - } - break; - case CSW_FAMAS: - if (params[2]) { - if (previousMode != FAMAS_BURSTMODE) { - *firemode = FAMAS_BURSTMODE; - - // Is this weapon's owner a player? If so send this message... - if (UTIL_IsPlayer(amx, pWeapon->v.owner)) - UTIL_TextMsg_Generic(pWeapon->v.owner, "#Switch_To_BurstFire"); - } - } - else if (previousMode != FAMAS_AUTOMATIC) { - *firemode = FAMAS_AUTOMATIC; - - // Is this weapon's owner a player? If so send this message... - if (UTIL_IsPlayer(amx, pWeapon->v.owner)) - UTIL_TextMsg_Generic(pWeapon->v.owner, "#Switch_To_FullAuto"); - } - break; - default: - return 0; + switch (get_pdata(pWeapon, m_iId)) + { + case CSW_GLOCK18: flag = WPNSTATE_GLOCK18_BURST_MODE; break; + case CSW_FAMAS: flag = WPNSTATE_FAMAS_BURST_MODE; break; } - return 1; -} - -static cell AMX_NATIVE_CALL cs_get_user_armor(AMX *amx, cell *params) // cs_get_user_armor(index, &CsArmorType:armortype); = 2 params -{ - // Return how much armor and set reference of what type... - // params[1] = user index - // params[2] = byref, set armor type here (no armor/vest/vest+helmet) - - CHECK_PLAYER(params[1]); - - // Make into edict pointer - edict_t *pPlayer = MF_GetPlayerEdict(params[1]); - -// #if 0 (Removed this to make the function work) - cell *armorTypeByRef = MF_GetAmxAddr(amx, params[2]); - *armorTypeByRef = *((int *)pPlayer->pvPrivateData + OFFSET_ARMORTYPE); -// #endif - - return (cell)pPlayer->v.armorvalue; -} - -static cell AMX_NATIVE_CALL cs_set_user_armor(AMX *amx, cell *params) // cs_set_user_armor(index, armorvalue, CsArmorType:armortype); = 3 params -{ - // Set armor and set what type and send a message to client... - // params[1] = user index - // params[2] = armor value - // params[3] = armor type (no armor/vest/vest+helmet) - - CHECK_PLAYER(params[1]); - - // Make into edict pointer - edict_t *pPlayer = MF_GetPlayerEdict(params[1]); - - // Set armor value - pPlayer->v.armorvalue = params[2]; - - // Set armor type - *((int *)pPlayer->pvPrivateData + OFFSET_ARMORTYPE) = params[3]; - - if (params[3] == CS_ARMOR_KEVLAR || params[3] == CS_ARMOR_ASSAULTSUIT) + if (flag && get_pdata(pWeapon, m_iWeaponState) & flag) { - // And send appropriate message - MESSAGE_BEGIN(MSG_ONE, GET_USER_MSG_ID(PLID, "ArmorType", NULL), NULL, pPlayer); - WRITE_BYTE(params[3] == CS_ARMOR_ASSAULTSUIT ? 1 : 0); + return 1; + } + + return 0; +} + +// native cs_set_weapon_burst(index, burstmode = 1); +static cell AMX_NATIVE_CALL cs_set_weapon_burstmode(AMX *amx, cell *params) +{ + GET_OFFSET("CBasePlayerItem" , m_iId); + GET_OFFSET("CBasePlayerWeapon", m_iWeaponState); + + int index = params[1]; + int burst = params[2]; + + CHECK_NONPLAYER(index); + edict_t *pWeapon = INDEXENT(index); + + int weaponState = get_pdata(pWeapon, m_iWeaponState); + int weaponNewState = weaponState; + + switch (get_pdata(pWeapon, m_iId)) + { + case CSW_GLOCK18: + { + if (burst) + { + weaponNewState |= WPNSTATE_GLOCK18_BURST_MODE; + } + else + { + weaponNewState &= ~WPNSTATE_GLOCK18_BURST_MODE; + } + break; + } + case CSW_FAMAS: + { + if (burst) + { + weaponNewState |= WPNSTATE_FAMAS_BURST_MODE; + } + else + { + weaponNewState &= ~WPNSTATE_FAMAS_BURST_MODE; + } + break; + } + } + + if (weaponState != weaponNewState) + { + set_pdata(pWeapon, m_iWeaponState, weaponNewState); + + if (UTIL_IsPlayer(pWeapon->v.owner)) + { + UTIL_TextMsg_Generic(pWeapon->v.owner, burst ? "#Switch_To_BurstFire" : "#Switch_To_FullAuto"); + } + + return 1; + } + + return 0; +} + +// native cs_get_user_armor(index, &CsArmorType:armortype); +static cell AMX_NATIVE_CALL cs_get_user_armor(AMX *amx, cell *params) +{ + GET_OFFSET("CBasePlayer", m_iKevlar); + + int index = params[1]; + + CHECK_PLAYER(index); + + edict_t *pPlayer = MF_GetPlayerEdict(index); + cell *armorByRef = MF_GetAmxAddr(amx, params[2]); + + *armorByRef = get_pdata(pPlayer, m_iKevlar); + + return static_cast(pPlayer->v.armorvalue); +} + +// native cs_set_user_armor(index, armorvalue, CsArmorType:armortype); +static cell AMX_NATIVE_CALL cs_set_user_armor(AMX *amx, cell *params) +{ + GET_OFFSET("CBasePlayer", m_iKevlar); + + int index = params[1]; + int armor = params[2]; + int type = params[3]; + + CHECK_PLAYER(index); + edict_t *pPlayer = MF_GetPlayerEdict(index); + + pPlayer->v.armorvalue = armor; + set_pdata(pPlayer, m_iKevlar, type); + + if (type == CS_ARMOR_KEVLAR || type == CS_ARMOR_ASSAULTSUIT) + { + MESSAGE_BEGIN(MSG_ONE, MessageIdArmorType, nullptr, pPlayer); + WRITE_BYTE(type == CS_ARMOR_ASSAULTSUIT ? 1 : 0); MESSAGE_END(); } return 1; } -static cell AMX_NATIVE_CALL cs_get_user_vip(AMX *amx, cell *params) // cs_get_user_vip(index); = 1 param +// native cs_get_user_vip(index); +static cell AMX_NATIVE_CALL cs_get_user_vip(AMX *amx, cell *params) { - // Is user vip? - // params[1] = user index + GET_OFFSET("CBasePlayer", m_bIsVIP); - // Valid entity should be within range - CHECK_PLAYER(params[1]); + int index = params[1]; - // Make into edict pointer - edict_t *pPlayer = MF_GetPlayerEdict(params[1]); + CHECK_PLAYER(index); + edict_t *pPlayer = MF_GetPlayerEdict(index); - if ( *((int *)pPlayer->pvPrivateData + OFFSET_VIP) & PLAYER_IS_VIP ) + if (get_pdata(pPlayer, m_bIsVIP)) + { return 1; + } return 0; } -static cell AMX_NATIVE_CALL cs_set_user_vip(AMX *amx, cell *params) // cs_set_user_vip(index, vip = 1, model = 1, scoreboard = 1); = 4 params +// native cs_set_user_vip(index, vip = 1, model = 1, scoreboard = 1); +static cell AMX_NATIVE_CALL cs_set_user_vip(AMX *amx, cell *params) { - // Set user vip - // params[1] = user index - // params[2] = if 1, activate vip, else deactivate vip. - // params[3] = if 1, update model - // params[4] = if 1, update scoreboard with vip information + GET_OFFSET("CBasePlayer", m_bIsVIP); + GET_OFFSET("CBasePlayer", m_iModelName); - // Valid entity should be within range - CHECK_PLAYER(params[1]); + int index = params[1]; + bool vip = params[2] != 0; - // Make into edict pointer - edict_t *pPlayer = MF_GetPlayerEdict(params[1]); + CHECK_PLAYER(index); + edict_t *pPlayer = MF_GetPlayerEdict(index); bool updateModel, updateScoreboard; - // Backwards compatibility with older version of native that only took two params if (params[0] / sizeof(cell) == 2) { updateModel = true; @@ -418,287 +460,236 @@ static cell AMX_NATIVE_CALL cs_set_user_vip(AMX *amx, cell *params) // cs_set_us updateScoreboard = (params[4] == 1); } - if (params[2] == 1) + set_pdata(pPlayer, m_bIsVIP, vip); + + if (updateModel) { - // Set to "be" vip. - *((int *)pPlayer->pvPrivateData + OFFSET_VIP) |= PLAYER_IS_VIP; + CS_Internal_Models modelName = CS_CT_VIP; - if (updateModel) + if (!vip) { - // Set vip model - *((int *)pPlayer->pvPrivateData + OFFSET_INTERNALMODEL) = CS_CT_VIP; - // This makes the model get updated right away. - MDLL_ClientUserInfoChanged(pPlayer, GETINFOKEYBUFFER(pPlayer)); // If this causes any problems for WON, do this line only in STEAM builds. + CS_Internal_Models CTmodels[5] = { CS_CT_URBAN, CS_CT_GSG9, CS_CT_GIGN, CS_CT_SAS, CZ_CT_SPETSNAZ }; + modelName = CTmodels[RANDOM_LONG(0, 4)]; } - if (updateScoreboard) - { - // Set VIP on scoreboard. Probably doesn't work for terrorist team. - MESSAGE_BEGIN(MSG_ALL, GET_USER_MSG_ID(PLID, "ScoreAttrib", NULL)); - WRITE_BYTE(params[1]); - WRITE_BYTE(SCOREATTRIB_VIP); - MESSAGE_END(); - } + set_pdata(pPlayer, m_iModelName, modelName); + Players[index].ResetModel(pPlayer); } - else - { - // Set to not be vip. - *((int *)pPlayer->pvPrivateData + OFFSET_VIP) &= ~PLAYER_IS_VIP; - if (updateModel) + if (updateScoreboard) + { + int scoreattrib = SCOREATTRIB_VIP; + + if (!vip) { - // Set a random CT model. - CS_Internal_Models CTmodels[5] = {CS_CT_URBAN, CS_CT_GSG9, CS_CT_GIGN, CS_CT_SAS, CZ_CT_SPETSNAZ}; - CS_Internal_Models ct_model = CTmodels[RANDOM_LONG(0, 4)]; - *((int *)pPlayer->pvPrivateData + OFFSET_INTERNALMODEL) = ct_model; - // This makes the model get updated right away. - MDLL_ClientUserInfoChanged(pPlayer, GETINFOKEYBUFFER(pPlayer)); // If this causes any problems for WON, do this line only in STEAM builds. + scoreattrib = (pPlayer->v.deadflag == DEAD_NO && pPlayer->v.health > 0) ? SCOREATTRIB_NOTHING : SCOREATTRIB_DEAD; } - if (updateScoreboard) - { - // Set nothing/dead on scoreboard. - int scoreattrib; - - if (pPlayer->v.deadflag == DEAD_NO && pPlayer->v.health > 0) - scoreattrib = SCOREATTRIB_NOTHING; // cts can't have bombs anyway - else - scoreattrib = SCOREATTRIB_DEAD; - - MESSAGE_BEGIN(MSG_ALL, GET_USER_MSG_ID(PLID, "ScoreAttrib", NULL)); - WRITE_BYTE(params[1]); + MESSAGE_BEGIN(MSG_ALL, MessageIdScoreAttrib); + WRITE_BYTE(index); WRITE_BYTE(scoreattrib); - MESSAGE_END(); - } - } + MESSAGE_END(); + } return 1; } -static cell AMX_NATIVE_CALL cs_get_user_team(AMX *amx, cell *params) // cs_get_user_team(index); = 1 param +// native CsTeams:cs_get_user_team(index, &any:model = CS_DONTCHANGE); +static cell AMX_NATIVE_CALL cs_get_user_team(AMX *amx, cell *params) { - // Get user team - // params[1] = user index + GET_OFFSET("CBasePlayer", m_iModelName); + GET_OFFSET("CBasePlayer", m_iTeam); - // Valid entity should be within range - cell *model; - CHECK_PLAYER(params[1]); - - // Make into edict pointer - edict_t *pPlayer = MF_GetPlayerEdict(params[1]); + int index = params[1]; + + CHECK_PLAYER(index); + edict_t *pPlayer = MF_GetPlayerEdict(index); if ((params[0] / sizeof(cell)) >= 2) { - model = MF_GetAmxAddr(amx, params[2]); - *model = *((int *)pPlayer->pvPrivateData + OFFSET_INTERNALMODEL); + cell *modelByRef = MF_GetAmxAddr(amx, params[2]); + *modelByRef = get_pdata(pPlayer, m_iModelName); } - return *((int *)pPlayer->pvPrivateData + OFFSET_TEAM); + return get_pdata(pPlayer, m_iTeam); } -static cell AMX_NATIVE_CALL cs_set_user_team(AMX *amx, cell *params) // cs_set_user_team(index, team, model = 0); = 3 params +// native cs_set_user_team(index, any:team, any:model = CS_DONTCHANGE, bool:send_teaminfo = true); +static cell AMX_NATIVE_CALL cs_set_user_team(AMX *amx, cell *params) { - // Set user team - // params[1] = user index - // params[2] = team - // params[3] = model = 0 - - // Valid entity should be within range - CHECK_PLAYER(params[1]); - - // Make into edict pointer - edict_t *pPlayer = MF_GetPlayerEdict(params[1]); + GET_OFFSET("CBasePlayer", m_iModelName); + GET_OFFSET("CBasePlayer", m_iTeam); + int index = params[1]; + int team = params[2]; int model = params[3]; - // Just set team. Removed check of 1-2-3, because maybe scripters want to create new teams, 4, 5 etc? - *((int *)pPlayer->pvPrivateData + OFFSET_TEAM) = params[2]; - if (model != 0) - *((int *)pPlayer->pvPrivateData + OFFSET_INTERNALMODEL) = model; - - // This makes the model get updated right away. - MDLL_ClientUserInfoChanged(pPlayer, GETINFOKEYBUFFER(pPlayer)); // If this causes any problems for WON, do this line only in STEAM builds. + CHECK_PLAYER(index); + edict_t *pPlayer = MF_GetPlayerEdict(index); - // And update scoreboard by sending TeamInfo msg. - char teaminfo[32]; - switch (params[2]) { - case TEAM_UNASSIGNED: - strcpy(teaminfo, "UNASSIGNED"); - break; - case TEAM_T: - strcpy(teaminfo, "TERRORIST"); - break; - case TEAM_CT: - strcpy(teaminfo, "CT"); - break; - case TEAM_SPECTATOR: - strcpy(teaminfo, "SPECTATOR"); - break; - default: - int team_nr = (int)params[2]; - sprintf(teaminfo, "TEAM_%i", team_nr); - } - MESSAGE_BEGIN(MSG_ALL, GET_USER_MSG_ID(PLID, "TeamInfo", NULL)); - WRITE_BYTE(params[1]); - WRITE_STRING(teaminfo); - MESSAGE_END(); - - switch (params[2]) + set_pdata(pPlayer, m_iTeam, team); + + if (model > 0) { - case TEAM_T: - MF_SetPlayerTeamInfo(params[1], params[2], "TERRORIST"); - break; - case TEAM_CT: - MF_SetPlayerTeamInfo(params[1], params[2], "CT"); - break; - case TEAM_SPECTATOR: - MF_SetPlayerTeamInfo(params[1], params[2], "SPECTATOR"); - break; - default: - MF_SetPlayerTeamInfo(params[1], params[2], NULL); - break; + set_pdata(pPlayer, m_iModelName, model); } - return 1; -} + Players[index].ResetModel(pPlayer); -static cell AMX_NATIVE_CALL cs_get_user_inside_buyzone(AMX *amx, cell *params) // cs_get_user_inside_buyzone(index); = 1 param -{ - // Is user inside buy zone? - // params[1] = user index + bool sendTeamInfo = true; - // Valid entity should be within range - CHECK_PLAYER(params[1]); - - // Make into edict pointer - edict_t *pPlayer = MF_GetPlayerEdict(params[1]); - - // This offset is 0 when outside, 1 when inside. - if ((int)*((int *)pPlayer->pvPrivateData + OFFSET_MAPZONE) & PLAYER_IN_BUYZONE) - return 1; - - return 0; -} - -static cell AMX_NATIVE_CALL cs_get_user_mapzones(AMX *amx, cell *params) // cs_get_user_mapzones(index); = 1 param -{ - // Is user inside a special zone? - // params[1] = user index - - // Valid entity should be within range - CHECK_PLAYER(params[1]); - - // Make into edict pointer - edict_t *pPlayer = MF_GetPlayerEdict(params[1]); - - return (int)*((int *)pPlayer->pvPrivateData + OFFSET_MAPZONE); -} - - -static cell AMX_NATIVE_CALL cs_get_user_plant(AMX *amx, cell *params) // cs_get_user_plant(index); = 1 param -{ - // Can user plant a bomb if he has one? - // params[1] = user index - - // Valid entity should be within range - CHECK_PLAYER(params[1]); - - // Make into edict pointer - edict_t *pPlayer = MF_GetPlayerEdict(params[1]); - - if ((int)*((int *)pPlayer->pvPrivateData + OFFSET_DEFUSE_PLANT) & CAN_PLANT_BOMB) - return 1; - - return 0; -} - -static cell AMX_NATIVE_CALL cs_set_user_plant(AMX *amx, cell *params) // cs_set_user_plant(index, plant = 1, showbombicon = 1); = 1 param -{ - // Set user plant "skill". - // params[1] = user index - // params[2] = 1 = able to - // params[3] = show bomb icon? - - // Valid entity should be within range - CHECK_PLAYER(params[1]); - - // Make into edict pointer - edict_t *pPlayer = MF_GetPlayerEdict(params[1]); - - int* plantskill = ((int *)pPlayer->pvPrivateData + OFFSET_DEFUSE_PLANT); - - if (params[2]) { - *plantskill |= CAN_PLANT_BOMB; - if (params[3]) { - MESSAGE_BEGIN(MSG_ONE, GET_USER_MSG_ID(PLID, "StatusIcon", NULL), NULL, pPlayer); - WRITE_BYTE(1); // show - WRITE_STRING("c4"); - WRITE_BYTE(DEFUSER_COLOUR_R); - WRITE_BYTE(DEFUSER_COLOUR_G); - WRITE_BYTE(DEFUSER_COLOUR_B); - MESSAGE_END(); - } + if (*params / sizeof(cell) >= 4) + { + sendTeamInfo = params[4] != 0; } - else { - *plantskill &= ~CAN_PLANT_BOMB; - MESSAGE_BEGIN(MSG_ONE, GET_USER_MSG_ID(PLID, "StatusIcon", NULL), NULL, pPlayer); - WRITE_BYTE(0); // hide - WRITE_STRING("c4"); + + char teaminfo[32]; + + switch (team) + { + case TEAM_UNASSIGNED: strcpy(teaminfo, "UNASSIGNED"); break; + case TEAM_T: strcpy(teaminfo, "TERRORIST"); break; + case TEAM_CT: strcpy(teaminfo, "CT"); break; + case TEAM_SPECTATOR: strcpy(teaminfo, "SPECTATOR"); break; + default: sprintf(teaminfo, "TEAM_%i", team); + } + + if (sendTeamInfo) + { + MESSAGE_BEGIN(MSG_ALL, MessageIdTeamInfo); + WRITE_BYTE(index); + WRITE_STRING(teaminfo); MESSAGE_END(); } - /* - L 02/20/2004 - 16:58:00: [JGHG Trace] {MessageBegin type=StatusIcon(107), dest=MSG_ONE(1), classname=player netname=JGHG - L 02/20/2004 - 16:58:00: [JGHG Trace] WriteByte byte=2 - L 02/20/2004 - 16:58:00: [JGHG Trace] WriteString string=c4 - L 02/20/2004 - 16:58:00: [JGHG Trace] WriteByte byte=0 - L 02/20/2004 - 16:58:00: [JGHG Trace] WriteByte byte=160 - L 02/20/2004 - 16:58:00: [JGHG Trace] WriteByte byte=0 - L 02/20/2004 - 16:58:00: [JGHG Trace] MessageEnd} - */ + MF_SetPlayerTeamInfo(index, team, team <= TEAM_SPECTATOR ? teaminfo : nullptr); return 1; } -static cell AMX_NATIVE_CALL cs_get_user_defusekit(AMX *amx, cell *params) // cs_get_user_defusekit(index); = 1 param +// native cs_get_user_buyzone(index); +static cell AMX_NATIVE_CALL cs_get_user_inside_buyzone(AMX *amx, cell *params) { - // Does user have defusekit? - // params[1] = user index + GET_OFFSET("CBasePlayer", m_signals); - // Valid entity should be within range - CHECK_PLAYER(params[1]); + int index = params[1]; - // Make into edict pointer - edict_t *pPlayer = MF_GetPlayerEdict(params[1]); - - if ((int)*((int *)pPlayer->pvPrivateData + OFFSET_DEFUSE_PLANT) & HAS_DEFUSE_KIT) + CHECK_PLAYER(index); + edict_t *pPlayer = MF_GetPlayerEdict(index); + + if (get_pdata(pPlayer, m_signals).GetState() & SIGNAL_BUY) + { return 1; + } return 0; } -static cell AMX_NATIVE_CALL cs_set_user_defusekit(AMX *amx, cell *params) // cs_set_user_defusekit(index, defusekit = 1, r = 0, g = 160, b = 0, icon[] = "defuser", flash = 0); = 7 params +// native cs_get_user_mapzones(index); +static cell AMX_NATIVE_CALL cs_get_user_mapzones(AMX *amx, cell *params) { - // Give/take defusekit. - // params[1] = user index - // params[2] = 1 = give - // params[3] = r - // params[4] = g - // params[5] = b - // params[6] = icon[] - // params[7] = flash = 0 + GET_OFFSET("CBasePlayer", m_signals); - // Valid entity should be within range - CHECK_PLAYER(params[1]); + int index = params[1]; - // Make into edict pointer - edict_t *pPlayer = MF_GetPlayerEdict(params[1]); + CHECK_PLAYER(index); + edict_t *pPlayer = MF_GetPlayerEdict(index); + + return get_pdata(pPlayer, m_signals).GetSignal(); +} + +// native cs_get_user_plant(index); +static cell AMX_NATIVE_CALL cs_get_user_plant(AMX *amx, cell *params) +{ + GET_OFFSET("CBasePlayer", m_bHasC4); + + int index = params[1]; + + CHECK_PLAYER(index); + edict_t *pPlayer = MF_GetPlayerEdict(index); + + if (get_pdata(pPlayer, m_bHasC4)) + { + return 1; + } + + return 0; +} + +// native cs_set_user_plant(index, plant = 1, showbombicon = 1); +static cell AMX_NATIVE_CALL cs_set_user_plant(AMX *amx, cell *params) +{ + GET_OFFSET("CBasePlayer", m_bHasC4); + + int index = params[1]; + bool plant = params[2] != 0; + bool icon = params[3] != 0; + + CHECK_PLAYER(index); + edict_t *pPlayer = MF_GetPlayerEdict(index); + + set_pdata(pPlayer, m_bHasC4, plant); + + if (plant) + { + if (icon) + { + MESSAGE_BEGIN(MSG_ONE, MessageIdStatusIcon, nullptr, pPlayer); + WRITE_BYTE(1); + WRITE_STRING("c4"); + WRITE_BYTE(DEFUSER_COLOUR_R); + WRITE_BYTE(DEFUSER_COLOUR_G); + WRITE_BYTE(DEFUSER_COLOUR_B); + MESSAGE_END(); + } + } + else + { + MESSAGE_BEGIN(MSG_ONE, MessageIdStatusIcon, nullptr, pPlayer); + WRITE_BYTE(0); + WRITE_STRING("c4"); + MESSAGE_END(); + } + + return 1; +} + +// native cs_get_user_defuse(index); +static cell AMX_NATIVE_CALL cs_get_user_defusekit(AMX *amx, cell *params) +{ + GET_OFFSET("CBasePlayer", m_bHasDefuser); + + int index = params[1]; + + CHECK_PLAYER(index); + edict_t *pPlayer = MF_GetPlayerEdict(index); + + if (get_pdata(pPlayer, m_bHasDefuser)) + { + return 1; + } + + return 0; +} + +// native cs_set_user_defuse(index, defusekit = 1, r = 0, g = 160, b = 0, icon[] = "defuser", flash = 0); +static cell AMX_NATIVE_CALL cs_set_user_defusekit(AMX *amx, cell *params) +{ + GET_OFFSET("CBasePlayer", m_bHasDefuser); + + int index = params[1]; + bool kit = params[2] != 0; + + CHECK_PLAYER(index); + edict_t *pPlayer = MF_GetPlayerEdict(index); - int* defusekit = ((int *)pPlayer->pvPrivateData + OFFSET_DEFUSE_PLANT); + set_pdata(pPlayer, m_bHasDefuser, kit); + pPlayer->v.body = kit ? 1 : 0; - if (params[2]) + if (kit) { int colour[3] = {DEFUSER_COLOUR_R, DEFUSER_COLOUR_G, DEFUSER_COLOUR_B}; + for (int i = 0; i < 3; i++) { if (params[i + 3] != -1) @@ -707,1010 +698,1000 @@ static cell AMX_NATIVE_CALL cs_set_user_defusekit(AMX *amx, cell *params) // cs_ } } - pPlayer->v.body = 1; + const char* icon = "defuser"; - const char* icon; if (params[6] != -1) { - int len; - icon = MF_GetAmxString(amx, params[6], 1, &len); - } else { - icon = "defuser"; + int length; + icon = MF_GetAmxString(amx, params[6], 1, &length); } - - *defusekit |= HAS_DEFUSE_KIT; - MESSAGE_BEGIN(MSG_ONE, GET_USER_MSG_ID(PLID, "StatusIcon", NULL), NULL, pPlayer); - WRITE_BYTE(params[7] == 1 ? 2 : 1); // show (if params[7] == 1, then this should flash, so we should set two here, else just 1 to show normally) - WRITE_STRING(icon); - WRITE_BYTE(colour[0]); - WRITE_BYTE(colour[1]); - WRITE_BYTE(colour[2]); + + MESSAGE_BEGIN(MSG_ONE, MessageIdStatusIcon, nullptr, pPlayer); + WRITE_BYTE(params[7] == 1 ? 2 : 1); + WRITE_STRING(icon); + WRITE_BYTE(colour[0]); + WRITE_BYTE(colour[1]); + WRITE_BYTE(colour[2]); MESSAGE_END(); } - else { - *defusekit &= ~HAS_DEFUSE_KIT; - MESSAGE_BEGIN(MSG_ONE, GET_USER_MSG_ID(PLID, "StatusIcon", NULL), NULL, pPlayer); - WRITE_BYTE(0); // hide - WRITE_STRING("defuser"); + else + { + MESSAGE_BEGIN(MSG_ONE, MessageIdStatusIcon, nullptr, pPlayer); + WRITE_BYTE(0); + WRITE_STRING("defuser"); MESSAGE_END(); - pPlayer->v.body = 0; } - /* - to show: - L 02/20/2004 - 16:10:26: [JGHG Trace] {MessageBegin type=StatusIcon(107), dest=MSG_ONE(1), classname=player netname=JGHG - L 02/20/2004 - 16:10:26: [JGHG Trace] WriteByte byte=1 - L 02/20/2004 - 16:10:26: [JGHG Trace] WriteString string=defuser - L 02/20/2004 - 16:10:26: [JGHG Trace] WriteByte byte=0 - L 02/20/2004 - 16:10:26: [JGHG Trace] WriteByte byte=160 - L 02/20/2004 - 16:10:26: [JGHG Trace] WriteByte byte=0 - L 02/20/2004 - 16:10:26: [JGHG Trace] MessageEnd} - - to hide: - L 02/20/2004 - 16:10:31: [JGHG Trace] {MessageBegin type=StatusIcon(107), dest=MSG_ONE(1), classname=player netname=JGHG - L 02/20/2004 - 16:10:31: [JGHG Trace] WriteByte byte=0 - L 02/20/2004 - 16:10:31: [JGHG Trace] WriteString string=defuser - L 02/20/2004 - 16:10:31: [JGHG Trace] MessageEnd} - */ return 1; } -static cell AMX_NATIVE_CALL cs_get_user_backpackammo(AMX *amx, cell *params) // cs_get_user_backpackammo(index, weapon); = 2 params +// native cs_get_user_bpammo(index, weapon); +static cell AMX_NATIVE_CALL cs_get_user_backpackammo(AMX *amx, cell *params) { - // Get amount of ammo in a user's backpack for a specific weapon type. - // params[1] = user index - // params[2] = weapon, as in CSW_* + GET_OFFSET("CBasePlayer" , m_rgpPlayerItems ); + GET_OFFSET("CBasePlayer" , m_rgAmmo ); + GET_OFFSET("CBasePlayerItem" , m_pNext ); + GET_OFFSET("CBasePlayerItem" , m_iId ); + GET_OFFSET("CBasePlayerWeapon", m_iPrimaryAmmoType); - // Valid entity should be within range - CHECK_PLAYER(params[1]); + int index = params[1]; + int weaponId = params[2]; - // Make into edict pointer - edict_t *pPlayer = MF_GetPlayerEdict(params[1]); + CHECK_PLAYER(index); + edict_t *pPlayer = MF_GetPlayerEdict(index); - int offset; - - switch (params[2]) { - case CSW_AWP: - offset = OFFSET_AWM_AMMO; - break; - case CSW_SCOUT: - case CSW_AK47: - case CSW_G3SG1: - offset = OFFSET_SCOUT_AMMO; - break; - case CSW_M249: - offset = OFFSET_PARA_AMMO; - break; - case CSW_FAMAS: - case CSW_M4A1: - case CSW_AUG: - case CSW_SG550: - case CSW_GALI: - case CSW_SG552: - offset = OFFSET_FAMAS_AMMO; - break; - case CSW_M3: - case CSW_XM1014: - offset = OFFSET_M3_AMMO; - break; - case CSW_USP: - case CSW_UMP45: - case CSW_MAC10: - offset = OFFSET_USP_AMMO; - break; - case CSW_FIVESEVEN: - case CSW_P90: - offset = OFFSET_FIVESEVEN_AMMO; - break; - case CSW_DEAGLE: - offset = OFFSET_DEAGLE_AMMO; - break; - case CSW_P228: - offset = OFFSET_P228_AMMO; - break; - case CSW_GLOCK18: - case CSW_MP5NAVY: - case CSW_TMP: - case CSW_ELITE: - offset = OFFSET_GLOCK_AMMO; - break; - case CSW_FLASHBANG: - offset = OFFSET_FLASH_AMMO; - break; - case CSW_HEGRENADE: - offset = OFFSET_HE_AMMO; - break; - case CSW_SMOKEGRENADE: - offset = OFFSET_SMOKE_AMMO; - break; - case CSW_C4: - offset = OFFSET_C4_AMMO; - break; - default: - MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", params[2]); - return 0; + if (weaponId < CSW_P228 || weaponId > CSW_P90 || weaponId == CSW_KNIFE) + { + MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", params[2]); + return 0; } - return (int)*((int *)pPlayer->pvPrivateData + offset); + for (size_t i = 0; i < MAX_WEAPON_SLOTS; ++i) + { + uintptr_t *pItem = get_pdata(pPlayer, m_rgpPlayerItems, i); + + while (pItem) + { + if (weaponId == get_pdata(pItem, m_iId)) + { + return get_pdata(pPlayer, m_rgAmmo, get_pdata(pItem, m_iPrimaryAmmoType)); + } + + pItem = get_pdata(pItem, m_pNext); + } + } + + return 0; +} + +// native cs_set_user_bpammo(index, weapon, amount); +static cell AMX_NATIVE_CALL cs_set_user_backpackammo(AMX *amx, cell *params) +{ + GET_OFFSET("CBasePlayer" , m_rgpPlayerItems ); + GET_OFFSET("CBasePlayer" , m_rgAmmo ); + GET_OFFSET("CBasePlayerItem" , m_pNext ); + GET_OFFSET("CBasePlayerItem" , m_iId ); + GET_OFFSET("CBasePlayerWeapon", m_iPrimaryAmmoType); + + int index = params[1]; + int weaponId = params[2]; + int amount = params[3]; + + CHECK_PLAYER(index); + edict_t *pPlayer = MF_GetPlayerEdict(index); + + if (weaponId < CSW_P228 || weaponId > CSW_P90 || weaponId == CSW_KNIFE) + { + MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", params[2]); + return 0; + } + + for (size_t i = 0; i < MAX_WEAPON_SLOTS; ++i) + { + uintptr_t *pItem = get_pdata(pPlayer, m_rgpPlayerItems, i); + + while (pItem) + { + if (weaponId == get_pdata(pItem, m_iId)) + { + set_pdata(pPlayer, m_rgAmmo, amount, get_pdata(pItem, m_iPrimaryAmmoType)); + return 1; + } + + pItem = get_pdata(pItem, m_pNext); + } + } return 0; } -static cell AMX_NATIVE_CALL cs_set_user_backpackammo(AMX *amx, cell *params) // cs_set_user_backpackammo(index, weapon, amount); = 3 params +// native cs_get_user_nvg(index); +static cell AMX_NATIVE_CALL cs_get_user_nvg(AMX *amx, cell *params) { - // Set amount of ammo in a user's backpack for a specific weapon type. - // params[1] = user index - // params[2] = weapon, as in CSW_* - // params[3] = new amount + GET_OFFSET("CBasePlayer", m_bHasNightVision); - // Valid entity should be within range - CHECK_PLAYER(params[1]); + int index = params[1]; - // Make into edict pointer - edict_t *pPlayer = MF_GetPlayerEdict(params[1]); + CHECK_PLAYER(index); + edict_t *pPlayer = MF_GetPlayerEdict(index); - int offset; - - switch (params[2]) { - case CSW_AWP: - offset = OFFSET_AWM_AMMO; - break; - case CSW_SCOUT: - case CSW_AK47: - case CSW_G3SG1: - offset = OFFSET_SCOUT_AMMO; - break; - case CSW_M249: - offset = OFFSET_PARA_AMMO; - break; - case CSW_FAMAS: - case CSW_M4A1: - case CSW_AUG: - case CSW_SG550: - case CSW_GALI: - case CSW_SG552: - offset = OFFSET_FAMAS_AMMO; - break; - case CSW_M3: - case CSW_XM1014: - offset = OFFSET_M3_AMMO; - break; - case CSW_USP: - case CSW_UMP45: - case CSW_MAC10: - offset = OFFSET_USP_AMMO; - break; - case CSW_FIVESEVEN: - case CSW_P90: - offset = OFFSET_FIVESEVEN_AMMO; - break; - case CSW_DEAGLE: - offset = OFFSET_DEAGLE_AMMO; - break; - case CSW_P228: - offset = OFFSET_P228_AMMO; - break; - case CSW_GLOCK18: - case CSW_MP5NAVY: - case CSW_TMP: - case CSW_ELITE: - offset = OFFSET_GLOCK_AMMO; - break; - case CSW_FLASHBANG: - offset = OFFSET_FLASH_AMMO; - break; - case CSW_HEGRENADE: - offset = OFFSET_HE_AMMO; - break; - case CSW_SMOKEGRENADE: - offset = OFFSET_SMOKE_AMMO; - break; - case CSW_C4: - offset = OFFSET_C4_AMMO; - break; - default: - MF_LogError(amx, AMX_ERR_NATIVE, "Invalid weapon id %d", params[2]); - return 0; - } - - *((int *)pPlayer->pvPrivateData + offset) = params[3]; - - return 1; -} - -static cell AMX_NATIVE_CALL cs_get_user_nvg(AMX *amx, cell *params) // cs_get_user_nvg(index); = 1 param -{ - // Does user have night vision goggles? - // params[1] = user index - - // Valid entity should be within range - CHECK_PLAYER(params[1]); - - // Make into edict pointer - edict_t *pPlayer = MF_GetPlayerEdict(params[1]); - - if ((int)*((int *)pPlayer->pvPrivateData + OFFSET_NVGOGGLES) & HAS_NVGOGGLES) + if (get_pdata(pPlayer, m_bHasNightVision)) + { return 1; + } return 0; } -static cell AMX_NATIVE_CALL cs_set_user_nvg(AMX *amx, cell *params) // cs_set_user_nvg(index, nvgoggles = 1); = 2 params +// native cs_set_user_nvg(index, nvgoggles = 1); +static cell AMX_NATIVE_CALL cs_set_user_nvg(AMX *amx, cell *params) { - // Give/take nvgoggles.. - // params[1] = user index - // params[2] = 1 = give, 0 = remove + GET_OFFSET("CBasePlayer", m_bHasNightVision); - // Valid entity should be within range - CHECK_PLAYER(params[1]); + int index = params[1]; + bool nvg = params[2] != 0; - // Make into edict pointer - edict_t *pPlayer = MF_GetPlayerEdict(params[1]); - - int* defusekit = ((int *)pPlayer->pvPrivateData + OFFSET_NVGOGGLES); + CHECK_PLAYER(index); + edict_t *pPlayer = MF_GetPlayerEdict(index); - if (params[2]) { - if (*defusekit & HAS_NVGOGGLES) - UTIL_TextMsg_Generic(pPlayer, "#Already_Have_One"); - else - *defusekit |= HAS_NVGOGGLES; + if (nvg && get_pdata(pPlayer, m_bHasNightVision)) + { + UTIL_TextMsg_Generic(pPlayer, "#Already_Have_One"); } else - *defusekit &= ~HAS_NVGOGGLES; - /*L 02/27/2004 - 09:16:43: [JGHG Trace] {MessageBegin type=TextMsg(77), dest=MSG_ONE(1), classname=player netname=JGHG - L 02/27/2004 - 09:16:43: [JGHG Trace] WriteByte byte=4 - L 02/27/2004 - 09:16:43: [JGHG Trace] WriteString string=#Already_Have_One - L 02/27/2004 - 09:16:43: [JGHG Trace] MessageEnd}*/ + { + set_pdata(pPlayer, m_bHasNightVision, nvg); + } return 1; } -static cell AMX_NATIVE_CALL cs_get_user_model(AMX *amx, cell *params) // cs_get_user_model(index, model[], len); = 3 params +// native cs_get_user_model(index, model[], len); +static cell AMX_NATIVE_CALL cs_get_user_model(AMX *amx, cell *params) { - // Get model a player has. - // params[1] = user index - // params[2] = model - // params[3] = max length to set + int index = params[1]; - // Valid player index should be within range - CHECK_PLAYER(params[1]); - // Make into edict pointer - edict_t *pPlayer = MF_GetPlayerEdict(params[1]); + CHECK_PLAYER(index); + edict_t *pPlayer = MF_GetPlayerEdict(index); return MF_SetAmxString(amx, params[2], GETCLIENTKEYVALUE(GETINFOKEYBUFFER(pPlayer), "model"), params[3]); } -static cell AMX_NATIVE_CALL cs_set_user_model(AMX *amx, cell *params) // cs_set_user_model(index, const model[]); = 2 params +// native cs_set_user_model(index, const model[], bool:update_index = false); +static cell AMX_NATIVE_CALL cs_set_user_model(AMX *amx, cell *params) { - // Set model on player. - // params[1] = user index - // params[2] = model + int index = params[1]; + int model = params[2]; - // Valid player index should be within range - CHECK_PLAYER(params[1]); + CHECK_PLAYER(index); + edict_t *pPlayer = MF_GetPlayerEdict(index); - // Make into edict pointer - edict_t* pPlayer = MF_GetPlayerEdict(params[1]); - - if (params[2] == -1) { + if (model == -1) + { MF_LogError(amx, AMX_ERR_NATIVE, "Invalid model %d", params[2]); return 0; } - char model[32]; - int len; + int length; + const char *newModel = MF_GetAmxString(amx, params[2], 0, &length); - strcpy(model, MF_GetAmxString(amx, params[2], 0, &len)); - - g_players[params[1]].SetModel(model); - g_players[params[1]].SetModelled(true); + if (!*newModel) + { + MF_LogError(amx, AMX_ERR_NATIVE, "Model can not be empty"); + return 0; + } - SETCLIENTKEYVALUE(params[1], GETINFOKEYBUFFER(pPlayer), "model", (char*)g_players[params[1]].GetModel()); + Players[index].SetModel(newModel); + Players[index].UpdateModel(pPlayer); + + if (*params / sizeof(cell) >= 3 && params[3] != 0) + { + if (!Server) + { + MF_Log("cs_set_user_model is disabled with update_index parameter set"); + return 0; + } + + GET_OFFSET("CBasePlayer", m_modelIndexPlayer); + + char model[260]; + UTIL_Format(model, sizeof(model), "models/player/%s/%s.mdl", newModel, newModel); + + for (size_t i = 0; i < HL_MODEL_MAX; ++i) + { + if (Server->model_precache[i] && !strcmp(Server->model_precache[i], model)) + { + if (pPlayer->v.modelindex != i) + { + SET_MODEL(pPlayer, model); + } + + set_pdata(pPlayer, m_modelIndexPlayer, i); + return 1; + } + } + + MF_Log("Model must be precached using cs_set_user_model with update_index parameter set"); + return 0; + } return 1; } -static cell AMX_NATIVE_CALL cs_reset_user_model(AMX *amx, cell *params) // cs_reset_user_model(index); = 1 param +// native cs_reset_user_model(index); +static cell AMX_NATIVE_CALL cs_reset_user_model(AMX *amx, cell *params) { - // Reset model on player. - // params[1] = user index + int index = params[1]; - // Valid player index should be within range - CHECK_PLAYER(params[1]); + CHECK_PLAYER(index); + edict_t *pPlayer = MF_GetPlayerEdict(index); - // Make into edict pointer - edict_t* pPlayer = MF_GetPlayerEdict(params[1]); - - g_players[params[1]].SetModelled(false); - - MDLL_ClientUserInfoChanged(pPlayer, GETINFOKEYBUFFER(pPlayer)); + Players[index].ResetModel(pPlayer); return 1; } -static cell AMX_NATIVE_CALL cs_get_hostage_follow(AMX *amx, cell *params) // cs_get_hostage_follow(index); = 1 param +// native cs_get_hostage_foll(index); +static cell AMX_NATIVE_CALL cs_get_hostage_follow(AMX *amx, cell *params) { - // What index is the hostage following? (this doesn't have to be a player) - // params[1] = hostage index + GET_OFFSET("CBaseMonster", m_hTargetEnt); + GET_OFFSET("CHostage" , m_improv ); - // Valid index should be within range - CHECK_NONPLAYER(params[1]); + int index = params[1]; - // Make into edict pointer - edict_t* pHostage = INDEXENT(params[1]); + CHECK_NONPLAYER(index); + edict_t* pHostage = INDEXENT(index); - // Make sure this is a hostage. - if (strcmp(STRING(pHostage->v.classname), "hostage_entity") != 0) { - MF_LogError(amx, AMX_ERR_NATIVE, "Entity %d (\"%s\") is not a hostage", params[1], STRING(pHostage->v.classname)); - return 0; + CHECK_HOSTAGE(pHostage); + + void *pImprov = get_pdata(pHostage, m_improv); + edict_t *pEntity = nullptr; + + if (pImprov) // Specific to CZ + { + GET_OFFSET("CHostageImprov", m_behavior); + GET_OFFSET("CHostageImprov", m_followState); + GET_OFFSET("SimpleStateMachine", m_state); // +4 for virtual table pointer of IImprovEvent. + GET_OFFSET("HostageFollowState", m_leader); + + if (get_pdata(pImprov, m_behavior + 4 + m_state) == reinterpret_cast(pImprov) + m_followState) + { + pEntity = get_pdata(pImprov, m_followState + m_leader).Get(); + } + } + else + { + pEntity = get_pdata(pHostage, m_hTargetEnt).Get(); } -#if !defined __amd64__ - int following = *((int *)pHostage->pvPrivateData + OFFSET_HOSTAGEFOLLOW); -#else - long following = *((long *)pHostage->pvPrivateData + OFFSET_HOSTAGEFOLLOW); -#endif - if (following == 0) - return following; - - // Else this is probably a pointer to an entity's edict. - edict_t* pEntity = (edict_t*)following; - - if (FNullEnt(pEntity)) { - MF_LogError(amx, AMX_ERR_NATIVE, "Unknown error finding hostage parameter"); - return 0; - } - - return ENTINDEX(pEntity); + return pEntity ? ENTINDEX(pEntity) : 0; } -static cell AMX_NATIVE_CALL cs_set_hostage_follow(AMX *amx, cell *params) // cs_set_hostage_follow(index, followedindex = 0); = 2 params +// native cs_set_hostage_foll(index, followedindex = 0); +static cell AMX_NATIVE_CALL cs_set_hostage_follow(AMX *amx, cell *params) { - // What index should the hostage be following? (this doesn't have to be a player) - // params[1] = hostage index - // params[2] = index to follow, if -1 then set hostage to not follow anything + GET_OFFSET("CBaseMonster", m_hTargetEnt); + GET_OFFSET("CHostage" , m_improv ); - // Valid index should be within range - CHECK_NONPLAYER(params[1]); + int index = params[1]; + int target = params[2]; - // Make into edict pointer - edict_t* pHostage = INDEXENT(params[1]); + CHECK_NONPLAYER(index); + edict_t* pHostage = INDEXENT(index); - // Make sure this is a hostage. - if (strcmp(STRING(pHostage->v.classname), "hostage_entity") != 0) { - MF_LogError(amx, AMX_ERR_NATIVE, "Entity %d (\"%s\") is not a hostage", params[1], STRING(pHostage->v.classname)); - return 0; + if (target != 0) + { + CHECK_ENTITY(target); } - // Set to not follow anything? - if (params[2] == 0) { -#if !defined __amd64__ - *((int *)pHostage->pvPrivateData + OFFSET_HOSTAGEFOLLOW) = 0; -#else - *((long *)pHostage->pvPrivateData + OFFSET_HOSTAGEFOLLOW) = 0; -#endif + CHECK_HOSTAGE(pHostage); + void *pImprov = get_pdata(pHostage, m_improv); + + if (pImprov) // Specific to CZ + { + GET_OFFSET("CHostageImprov", m_behavior); + GET_OFFSET("CHostageImprov", m_followState); + GET_OFFSET("CHostageImprov", m_idleState); + GET_OFFSET("HostageFollowState", m_leader); + GET_OFFSET("SimpleStateMachine", m_state); // +4 for virtual table pointer of IImprovEvent. + GET_OFFSET("SimpleStateMachine", m_stateTimer); // + + if (target) + { + set_pdata(pImprov, m_behavior + 4 + m_state, reinterpret_cast(pImprov) + m_followState); + set_pdata(pImprov, m_behavior + 4 + m_stateTimer, gpGlobals->time); + + get_pdata(pImprov, m_followState + m_leader).Set(GETEDICT(target)); + } + else + { + set_pdata(pImprov, m_behavior + 4 + m_state, reinterpret_cast(pImprov) + m_idleState); + set_pdata(pImprov, m_behavior + 4 + m_stateTimer, gpGlobals->time); + + get_pdata(pImprov, m_followState + m_leader).Set(nullptr); + } + } + else + { + get_pdata(pHostage, m_hTargetEnt).Set(target ? GETEDICT(target) : nullptr); + } + + return 1; +} + +// native cs_get_weapon_ammo(index); +static cell AMX_NATIVE_CALL cs_get_weapon_ammo(AMX *amx, cell *params) +{ + GET_OFFSET("CBasePlayerWeapon", m_iClip); + + int index = params[1]; + + CHECK_NONPLAYER(index); + edict_t *pWeapon = INDEXENT(index); + + return get_pdata(pWeapon, m_iClip); +} + +// native cs_set_weapon_ammo(index, newammo); +static cell AMX_NATIVE_CALL cs_set_weapon_ammo(AMX *amx, cell *params) +{ + GET_OFFSET("CBasePlayerWeapon", m_iClip); + + int index = params[1]; + int ammo = params[2]; + + CHECK_NONPLAYER(index); + edict_t *pWeapon = INDEXENT(index); + + set_pdata(pWeapon, m_iClip, ammo); + + return 1; +} + +// native cs_get_user_hasprim(index); +static cell AMX_NATIVE_CALL cs_get_user_hasprimary(AMX *amx, cell *params) +{ + GET_OFFSET("CBasePlayer", m_bHasPrimary); + + int index = params[1]; + + CHECK_PLAYER(index); + edict_t *pPlayer = MF_GetPlayerEdict(index); + + if (get_pdata(pPlayer, m_bHasPrimary)) + { return 1; } - // Valid index should be within range - CHECK_ENTITY(params[2]); - - // Make into edict pointer - edict_t* pEntity = GETEDICT(params[2]); - -#if !defined __amd64__ - *((int *)pHostage->pvPrivateData + OFFSET_HOSTAGEFOLLOW) = (int)pEntity; -#else - *((long *)pHostage->pvPrivateData + OFFSET_HOSTAGEFOLLOW) = (long)pEntity; -#endif - return 1; + return 0; } -static cell AMX_NATIVE_CALL cs_get_weapon_ammo(AMX *amx, cell *params) // cs_get_weapon_ammo(index); = 1 param +// native cs_get_no_knives(); +static cell AMX_NATIVE_CALL cs_get_no_knives(AMX *amx, cell *params) { - // Get amount of ammo in weapon's clip - // params[1] = weapon index - - // Valid entity should be within range - CHECK_NONPLAYER(params[1]); - - // Make into edict pointer - edict_t *pWeapon = INDEXENT(params[1]); - - return *((int *)pWeapon->pvPrivateData + OFFSET_CLIPAMMO); + return NoKifesMode ? 1 : 0; } -static cell AMX_NATIVE_CALL cs_set_weapon_ammo(AMX *amx, cell *params) // cs_set_weapon_ammo(index, newammo); = 2 params +// native cs_set_no_knives(noknives = 0); +static cell AMX_NATIVE_CALL cs_set_no_knives(AMX *amx, cell *params) { - // Set amount of ammo in weapon's clip - // params[1] = weapon index - // params[2] = newammo + if (!GiveDefaultItemsDetour) + { + MF_LogError(amx, AMX_ERR_NATIVE, "Native cs_set_no_knives() is disabled"); + return 0; + } - // Valid entity should be within range - CHECK_NONPLAYER(params[1]); + NoKifesMode = params[1] != 0; - // Make into edict pointer - edict_t *pWeapon = INDEXENT(params[1]); - - *((int *)pWeapon->pvPrivateData + OFFSET_CLIPAMMO) = params[2]; + if (NoKifesMode) + { + GiveDefaultItemsDetour->EnableDetour(); + } + else + { + GiveDefaultItemsDetour->DisableDetour(); + } return 1; } -static cell AMX_NATIVE_CALL cs_get_user_hasprimary(AMX *amx, cell *params) // cs_get_user_hasprimary(index); = 1 param -{ - // Return 1 if user has a primary or shield (actually just return the value at the offset) - // params[1] = user index - - // Check player - CHECK_PLAYER(params[1]); - - // Make into edict pointer - edict_t *pPlayer = MF_GetPlayerEdict(params[1]); - - return *((int *)pPlayer->pvPrivateData + OFFSET_PRIMARYWEAPON); -} - -static cell AMX_NATIVE_CALL cs_get_no_knives(AMX *amx, cell *params) // cs_get_no_knives(); = 0 params -{ - // Returns 1 when g_noknives is true, else 0 - return g_noknives ? 1 : 0; -} - -static cell AMX_NATIVE_CALL cs_set_no_knives(AMX *amx, cell *params) // cs_set_no_knives(noknives = 0); = 1 param -{ - // Sets noknives mode on/off. When params[1] is 1, g_noknives goes true and no weapon_knife:s will from there be created until switch off again. - g_noknives = params[1] == 0 ? false : true; - - return 1; -} - -// Damaged Soul -static cell AMX_NATIVE_CALL cs_get_user_tked(AMX *amx, cell *params) // cs_get_user_tked(index); = 1 param +// native cs_get_user_tked(index); +static cell AMX_NATIVE_CALL cs_get_user_tked(AMX *amx, cell *params) { - // Return 1 if user has committed a team killing) - // params[1] = user index + GET_OFFSET("CBasePlayer", m_bJustKilledTeammate); - // Check player - CHECK_PLAYER(params[1]); + int index = params[1]; - // Make into edict pointer - edict_t *pPlayer = MF_GetPlayerEdict(params[1]); + CHECK_PLAYER(index); + edict_t *pPlayer = MF_GetPlayerEdict(index); - return *((int *)pPlayer->pvPrivateData + OFFSET_TK); + if (get_pdata(pPlayer, m_bJustKilledTeammate)) + { + return 1; + } + + return 0; } -// Damaged Soul -static cell AMX_NATIVE_CALL cs_set_user_tked(AMX *amx, cell *params) // cs_set_user_tked(index, tk = 1, subtract = 1); = 2 arguments +// native cs_set_user_tked(index, tk = 1, subtract = 1); +static cell AMX_NATIVE_CALL cs_set_user_tked(AMX *amx, cell *params) { - // Sets whether or not player has committed a TK. - // params[1] = user - // params[2] = 1: player has TKed, 0: player hasn't TKed - // params[3] = number of frags to subtract + GET_OFFSET("CBasePlayer", m_bJustKilledTeammate); + GET_OFFSET("CBasePlayer", m_iTeam); + GET_OFFSET("CBasePlayer", m_iDeaths); - // Check index - CHECK_PLAYER(params[1]); + int index = params[1]; + int tk = params[2]; + int subtract = params[3]; - // Fetch player pointer - edict_t *pPlayer = MF_GetPlayerEdict(params[1]); + CHECK_PLAYER(index); + edict_t *pPlayer = MF_GetPlayerEdict(index); - if (params[2]) { - *((int *)pPlayer->pvPrivateData + OFFSET_TK) = 1; - } else { - *((int *)pPlayer->pvPrivateData + OFFSET_TK) = 0; - } + set_pdata(pPlayer, m_bJustKilledTeammate, tk != 0); - if (params[3]) { - pPlayer->v.frags = pPlayer->v.frags - params[3]; + if (subtract > 0) + { + pPlayer->v.frags -= subtract; - MESSAGE_BEGIN(MSG_ALL, GET_USER_MSG_ID(PLID, "ScoreInfo", NULL)); - WRITE_BYTE(params[1]); // user index - WRITE_SHORT((int)pPlayer->v.frags); // frags - WRITE_SHORT(*((int *)pPlayer->pvPrivateData + OFFSET_CSDEATHS)); // deaths - WRITE_SHORT(0); // ? - WRITE_SHORT(*((int *)pPlayer->pvPrivateData + OFFSET_TEAM)); // team + MESSAGE_BEGIN(MSG_ALL, MessageIdScoreInfo); + WRITE_BYTE(index); + WRITE_SHORT(static_cast(pPlayer->v.frags)); + WRITE_SHORT(get_pdata(pPlayer, m_iDeaths)); + WRITE_SHORT(0); + WRITE_SHORT(get_pdata(pPlayer, m_iTeam)); MESSAGE_END(); } return 1; } -static cell AMX_NATIVE_CALL cs_get_user_driving(AMX *amx, cell *params) // cs_get_user_driving(index); = 1 param +// native cs_get_user_driving(index); +static cell AMX_NATIVE_CALL cs_get_user_driving(AMX *amx, cell *params) { - // Returns different values depending on if user is driving a value - and if so at what speed. - // 0: no driving - // 1: driving, but standing still - // 2-4: different positive speeds - // 5: negative speed (backing) - // params[1] = user index + GET_OFFSET("CBasePlayer", m_iTrain); - // Check player - CHECK_PLAYER(params[1]); + int index = params[1]; - // Make into edict pointer - edict_t *pPlayer = MF_GetPlayerEdict(params[1]); + CHECK_PLAYER(index); + edict_t *pPlayer = MF_GetPlayerEdict(index); - // If player driving, return 1, if not, return 0 - return *((int *)pPlayer->pvPrivateData + OFFSET_ISDRIVING); + return get_pdata(pPlayer, m_iTrain); } -static cell AMX_NATIVE_CALL cs_get_user_stationary(AMX *amx, cell *params) // cs_get_user_stationary(index); = 1 param +// native cs_get_user_stationary(index); +static cell AMX_NATIVE_CALL cs_get_user_stationary(AMX *amx, cell *params) { - // Returns 1 if client is using a stationary guns (maybe also other stuff) + GET_OFFSET("CBasePlayer", m_iClientHideHUD); - // Check player - CHECK_PLAYER(params[1]); + int index = params[1]; - // Make into edict pointer - edict_t *pPlayer = MF_GetPlayerEdict(params[1]); + CHECK_PLAYER(index); + edict_t *pPlayer = MF_GetPlayerEdict(index); - // If player driving, return 1, if not, return 0 -#if !defined __amd64__ - return *((int *)pPlayer->pvPrivateData + OFFSET_STATIONARY); -#else - // The 32 bit server return 0 and 1 by itself from this offset, but the amd64 server has 2 and 3 respectively - // Doing a simple checking of these defined constants here, and mapping to 0 and 1, to keep our plugin authors sane. - // If an unexpected value is encountered, this will be logged. - if (AMD64_STATIONARY_NO == *((int *)pPlayer->pvPrivateData + OFFSET_STATIONARY)) - return 0; - else if (AMD64_STATIONARY_YES == *((int *)pPlayer->pvPrivateData + OFFSET_STATIONARY)) - return 1; - else { - MF_LogError(amx, AMX_ERR_NATIVE, "Unexpected value at offset. Please report this to development team @ www.amxmodx.org!"); - - return 0; - } -#endif + return get_pdata(pPlayer, m_iClientHideHUD); } +// native cs_get_user_shield(index); static cell AMX_NATIVE_CALL cs_get_user_shield(AMX *amx, cell *params) { - //Return 1 if user has a shield. - //params[1] = user id + GET_OFFSET("CBasePlayer", m_bOwnsShield); + + int index = params[1]; + + CHECK_PLAYER(index); + edict_t *pPlayer = MF_GetPlayerEdict(index); - //Check player - CHECK_PLAYER(params[1]); - - // Make into edict pointer - edict_t *pPlayer = MF_GetPlayerEdict(params[1]); - - if ((int)*((int *)pPlayer->pvPrivateData + OFFSET_SHIELD) & HAS_SHIELD) + if (get_pdata(pPlayer, m_bOwnsShield)) + { return 1; + } return 0; } +// native cs_user_spawn(player); static cell AMX_NATIVE_CALL cs_user_spawn(AMX *amx, cell *params) { - //Check player - CHECK_PLAYER(params[1]); - - // Make into edict pointer - edict_t *pPlayer = MF_GetPlayerEdict(params[1]); + int index = params[1]; + + CHECK_PLAYER(index); + edict_t *pPlayer = MF_GetPlayerEdict(index); pPlayer->v.deadflag = DEAD_RESPAWNABLE; MDLL_Think(pPlayer); - const char *auth = GETPLAYERAUTHID(pPlayer); - if (((pPlayer->v.flags & FL_FAKECLIENT) == FL_FAKECLIENT || (auth && (strcmp(auth, "BOT") == 0))) && pPlayer->v.deadflag == DEAD_RESPAWNABLE) { + if (MF_IsPlayerBot(index) && pPlayer->v.deadflag == DEAD_RESPAWNABLE) + { MDLL_Spawn(pPlayer); } - // pPlayer->v.iuser1 = 0; - return 1; } +// native cs_get_armoury_type(index, &count = 1); static cell AMX_NATIVE_CALL cs_get_armoury_type(AMX *amx, cell *params) { - // Return CSW_* constants of specified armoury_entity. - // params[1] = entity + GET_OFFSET("CArmoury", m_iItem); - // Valid entity should be within range. - CHECK_NONPLAYER(params[1]); + int index = params[1]; - // Make into edict pointer. - edict_t *pArmoury = INDEXENT(params[1]); + CHECK_NONPLAYER(index); + edict_t *pArmoury = INDEXENT(index); - // Make sure this is an armoury_entity. - if (strcmp(STRING(pArmoury->v.classname), "armoury_entity")) { - // Error out here. - MF_LogError(amx, AMX_ERR_NATIVE, "Not an armoury_entity! (%d)", params[1]); + if (strcmp(STRING(pArmoury->v.classname), "armoury_entity")) + { + MF_LogError(amx, AMX_ERR_NATIVE, "Not an armoury_entity! (%d)", index); return 0; } -#if PAWN_CELL_SIZE == 32 - int weapontype = *((int *)pArmoury->pvPrivateData + OFFSET_ARMOURY_TYPE); + int weapontype = get_pdata(pArmoury, m_iItem);; + int weapontype_out = 0; - // We do a switch instead of a mapped array because this way we can nicely catch unexpected values, and we don't get array out of bounds thingies. - int weapontype_out; - switch (weapontype) { - case CSA_MP5NAVY: weapontype_out = CSW_MP5NAVY; break; - case CSA_TMP: weapontype_out = CSW_TMP; break; - case CSA_P90: weapontype_out = CSW_P90; break; - case CSA_MAC10: weapontype_out = CSW_MAC10; break; - case CSA_AK47: weapontype_out = CSW_AK47; break; - case CSA_SG552: weapontype_out = CSW_SG552; break; - case CSA_M4A1: weapontype_out = CSW_M4A1; break; - case CSA_AUG: weapontype_out = CSW_AUG; break; - case CSA_SCOUT: weapontype_out = CSW_SCOUT; break; - case CSA_G3SG1: weapontype_out = CSW_G3SG1; break; - case CSA_AWP: weapontype_out = CSW_AWP; break; - case CSA_M3: weapontype_out = CSW_M3; break; - case CSA_XM1014: weapontype_out = CSW_XM1014; break; - case CSA_M249: weapontype_out = CSW_M249; break; - case CSA_FLASHBANG: weapontype_out = CSW_FLASHBANG; break; - case CSA_HEGRENADE: weapontype_out = CSW_HEGRENADE; break; - case CSA_VEST: weapontype_out = CSW_VEST; break; - case CSA_VESTHELM: weapontype_out = CSW_VESTHELM; break; + switch (weapontype) + { + case CSA_MP5NAVY: weapontype_out = CSW_MP5NAVY; break; + case CSA_TMP: weapontype_out = CSW_TMP; break; + case CSA_P90: weapontype_out = CSW_P90; break; + case CSA_MAC10: weapontype_out = CSW_MAC10; break; + case CSA_AK47: weapontype_out = CSW_AK47; break; + case CSA_SG552: weapontype_out = CSW_SG552; break; + case CSA_M4A1: weapontype_out = CSW_M4A1; break; + case CSA_AUG: weapontype_out = CSW_AUG; break; + case CSA_SCOUT: weapontype_out = CSW_SCOUT; break; + case CSA_G3SG1: weapontype_out = CSW_G3SG1; break; + case CSA_AWP: weapontype_out = CSW_AWP; break; + case CSA_M3: weapontype_out = CSW_M3; break; + case CSA_XM1014: weapontype_out = CSW_XM1014; break; + case CSA_M249: weapontype_out = CSW_M249; break; + case CSA_FLASHBANG: weapontype_out = CSW_FLASHBANG; break; + case CSA_HEGRENADE: weapontype_out = CSW_HEGRENADE; break; + case CSA_VEST: weapontype_out = CSW_VEST; break; + case CSA_VESTHELM: weapontype_out = CSW_VESTHELM; break; case CSA_SMOKEGRENADE: weapontype_out = CSW_SMOKEGRENADE; break; default: - MF_LogError(amx, AMX_ERR_NATIVE, "Unexpected weapon type of %d!", params[1]); + { + MF_LogError(amx, AMX_ERR_NATIVE, "Unexpected weapon type of %d!", index); return 0; + } + } + + if (*params / sizeof(cell) >= 2) + { + GET_OFFSET("CArmoury", m_iCount); + + *MF_GetAmxAddr(amx, params[2]) = get_pdata(pArmoury, m_iCount); } return weapontype_out; -#else - MF_LogError(amx, AMX_ERR_NATIVE, "This function not implemented on AMD64."); - return 0; -#endif } +// native cs_set_armoury_type(index, type, count = -1); static cell AMX_NATIVE_CALL cs_set_armoury_type(AMX *amx, cell *params) { - // Set CSW->CSA mapped weapon type to entity. - // params[1] = entity - // params[2] = CSW_* constant + GET_OFFSET("CArmoury", m_iItem); - // Valid entity should be within range. - CHECK_NONPLAYER(params[1]); + int index = params[1]; + int type = params[2]; - // Make into edict pointer. - edict_t *pArmoury = INDEXENT(params[1]); + CHECK_NONPLAYER(index); + edict_t *pArmoury = INDEXENT(index); - // Make sure this is an armoury_entity. - if (strcmp(STRING(pArmoury->v.classname), "armoury_entity")) { - // Error out here. - MF_LogError(amx, AMX_ERR_NATIVE, "Not an armoury_entity! (%d)", params[1]); + if (strcmp(STRING(pArmoury->v.classname), "armoury_entity")) + { + MF_LogError(amx, AMX_ERR_NATIVE, "Not an armoury_entity! (%d)", index); return 0; } -#if PAWN_CELL_SIZE == 32 - - // We do a switch instead of a mapped array because this way we can nicely catch unexpected values, and we don't get array out of bounds thingies. int weapontype; - switch (params[2]) { - case CSW_MP5NAVY: weapontype = CSA_MP5NAVY; break; - case CSW_TMP: weapontype = CSA_TMP; break; - case CSW_P90: weapontype = CSA_P90; break; - case CSW_MAC10: weapontype = CSA_MAC10; break; - case CSW_AK47: weapontype = CSA_AK47; break; - case CSW_SG552: weapontype = CSA_SG552; break; - case CSW_M4A1: weapontype = CSA_M4A1; break; - case CSW_AUG: weapontype = CSA_AUG; break; - case CSW_SCOUT: weapontype = CSA_SCOUT; break; - case CSW_G3SG1: weapontype = CSA_G3SG1; break; - case CSW_AWP: weapontype = CSA_AWP; break; - case CSW_M3: weapontype = CSA_M3; break; - case CSW_XM1014: weapontype = CSA_XM1014; break; - case CSW_M249: weapontype = CSA_M249; break; - case CSW_FLASHBANG: weapontype = CSA_FLASHBANG; break; - case CSW_HEGRENADE: weapontype = CSA_HEGRENADE; break; - case CSW_VEST: weapontype = CSA_VEST; break; - case CSW_VESTHELM: weapontype = CSA_VESTHELM; break; - case CSW_SMOKEGRENADE: weapontype = CSA_SMOKEGRENADE; break; - default: - MF_LogError(amx, AMX_ERR_NATIVE, "Unsupported weapon type! (%d)", params[2]); - return 0; - } - - *((int *)pArmoury->pvPrivateData + OFFSET_ARMOURY_TYPE) = weapontype; - - return 1; -#else - MF_LogError(amx, AMX_ERR_NATIVE, "This function not implemented on AMD64."); - return 0; -#endif -} - -static cell AMX_NATIVE_CALL cs_set_user_zoom(AMX *amx, cell *params) -{ - // Set the weapon zoom type of a user - // params[1] = user index - // params[2] = zoom type - // params[3] = mode (0=blocking mode, 1=player will loose the zoom set by changing weapon) - - int index = params[1]; - // Check index - CHECK_PLAYER(index); - - int value, type = params[2]; - int curweap = *static_cast(MF_PlayerPropAddr(index, Player_CurrentWeapon)); - - // Fetch player pointer - edict_t *pPlayer = MF_GetPlayerEdict(index); - // Reset any previous zooming - g_zooming[index] = 0; - - if (type == CS_RESET_ZOOM) - { - *((int *)pPlayer->pvPrivateData + OFFSET_ZOOMTYPE) = CS_NO_ZOOM; - return 1; - } switch (type) { - case CS_SET_NO_ZOOM: - value = CS_NO_ZOOM; - break; - case CS_SET_FIRST_ZOOM: - value = CS_FIRST_ZOOM; - break; - case CS_SET_SECOND_ZOOM: - if (curweap == CSW_G3SG1 || curweap == CSW_SG550 || curweap == CSW_SCOUT) - value = CS_SECOND_NONAWP_ZOOM; - else - value = CS_SECOND_AWP_ZOOM; - break; - case CS_SET_AUGSG552_ZOOM: - value = CS_AUGSG552_ZOOM; - break; - default: - MF_LogError(amx, AMX_ERR_NATIVE, "Invalid zoom type %d", type); - return 0; + case CSW_MP5NAVY: weapontype = CSA_MP5NAVY; break; + case CSW_TMP: weapontype = CSA_TMP; break; + case CSW_P90: weapontype = CSA_P90; break; + case CSW_MAC10: weapontype = CSA_MAC10; break; + case CSW_AK47: weapontype = CSA_AK47; break; + case CSW_SG552: weapontype = CSA_SG552; break; + case CSW_M4A1: weapontype = CSA_M4A1; break; + case CSW_AUG: weapontype = CSA_AUG; break; + case CSW_SCOUT: weapontype = CSA_SCOUT; break; + case CSW_G3SG1: weapontype = CSA_G3SG1; break; + case CSW_AWP: weapontype = CSA_AWP; break; + case CSW_M3: weapontype = CSA_M3; break; + case CSW_XM1014: weapontype = CSA_XM1014; break; + case CSW_M249: weapontype = CSA_M249; break; + case CSW_FLASHBANG: weapontype = CSA_FLASHBANG; break; + case CSW_HEGRENADE: weapontype = CSA_HEGRENADE; break; + case CSW_VEST: weapontype = CSA_VEST; break; + case CSW_VESTHELM: weapontype = CSA_VESTHELM; break; + case CSW_SMOKEGRENADE: weapontype = CSA_SMOKEGRENADE; break; + default: + { + MF_LogError(amx, AMX_ERR_NATIVE, "Unsupported weapon type! (%d)", type); + return 0; + } } - if (!params[3]) - g_zooming[index] = value; - *((int *)pPlayer->pvPrivateData + OFFSET_ZOOMTYPE) = value; + set_pdata(pArmoury, m_iItem, weapontype); + + if (*params / sizeof(cell) >= 3) + { + GET_OFFSET("CArmoury", m_iCount); + GET_OFFSET("CArmoury", m_iInitialCount); + + int count = params[3]; + + if (count >= 0) + { + if (!count) + { + pArmoury->v.effects |= EF_NODRAW; + } + else + { + pArmoury->v.effects &= ~EF_NODRAW; + } + + set_pdata(pArmoury, m_iCount, count); + set_pdata(pArmoury, m_iInitialCount, count); + } + } return 1; } +// native cs_set_user_zoom(index, type, mode); +static cell AMX_NATIVE_CALL cs_set_user_zoom(AMX *amx, cell *params) +{ + GET_OFFSET("CBasePlayer", m_iFOV); + + int index = params[1]; + + CHECK_PLAYER(index); + edict_t *pPlayer = MF_GetPlayerEdict(index); + + int type = params[2]; + int mode = params[3]; + int weapon = *static_cast(MF_PlayerPropAddr(index, Player_CurrentWeapon)); + + Players[index].ResetZoom(); + + if (type == CS_RESET_ZOOM) + { + set_pdata(pPlayer, m_iFOV, CS_NO_ZOOM); + return 1; + } + + int value; + + switch (type) + { + case CS_SET_NO_ZOOM: + { + value = CS_NO_ZOOM; + break; + } + case CS_SET_FIRST_ZOOM: + { + value = CS_FIRST_ZOOM; + break; + } + case CS_SET_SECOND_ZOOM: + { + if (weapon == CSW_G3SG1 || weapon == CSW_SG550 || weapon == CSW_SCOUT) + { + value = CS_SECOND_NONAWP_ZOOM; + } + else + { + value = CS_SECOND_AWP_ZOOM; + } + break; + } + case CS_SET_AUGSG552_ZOOM: + { + value = CS_AUGSG552_ZOOM; + break; + } + default: + { + MF_LogError(amx, AMX_ERR_NATIVE, "Invalid zoom type %d", type); + return 0; + } + } + + if (!mode) + { + Players[index].SetZoom(value); + EnableMessageHooks(); + } + + set_pdata(pPlayer, m_iFOV, value); + + return 1; +} + +// native cs_get_user_zoom(index); static cell AMX_NATIVE_CALL cs_get_user_zoom(AMX *amx, cell *params) { - // Returns the zoom type of a player - // params[1] = user id + GET_OFFSET("CBasePlayer", m_iFOV); - // Check Player - CHECK_PLAYER(params[1]); - // Fetch player pointer - edict_t *pPlayer = MF_GetPlayerEdict(params[1]); - int value = *((int *)pPlayer->pvPrivateData + OFFSET_ZOOMTYPE); + int index = params[1]; - switch (value) + CHECK_PLAYER(index); + edict_t *pPlayer = MF_GetPlayerEdict(index); + + switch (get_pdata(pPlayer, m_iFOV)) { - case CS_NO_ZOOM: - return CS_SET_NO_ZOOM; - case CS_FIRST_ZOOM: - return CS_SET_FIRST_ZOOM; - case CS_SECOND_AWP_ZOOM: - case CS_SECOND_NONAWP_ZOOM: - return CS_SET_SECOND_ZOOM; - case CS_AUGSG552_ZOOM: - return CS_SET_AUGSG552_ZOOM; + case CS_NO_ZOOM: + { + return CS_SET_NO_ZOOM; + } + case CS_FIRST_ZOOM: + { + return CS_SET_FIRST_ZOOM; + } + case CS_SECOND_AWP_ZOOM: + case CS_SECOND_NONAWP_ZOOM: + { + return CS_SET_SECOND_ZOOM; + } + case CS_AUGSG552_ZOOM: + { + return CS_SET_AUGSG552_ZOOM; + } } return 0; } -// Returns whether the player has a thighpack or backpack model on +// native cs_get_user_submodel(index); static cell AMX_NATIVE_CALL cs_get_user_submodel(AMX* amx, cell* params) { - // Check Player - CHECK_PLAYER(params[1]); - // Fetch player pointer - edict_t* pPlayer = MF_GetPlayerEdict(params[1]); + int index = params[1]; + + CHECK_PLAYER(index); + edict_t *pPlayer = MF_GetPlayerEdict(index); return pPlayer->v.body; } + +// native cs_set_user_submodel(index, value); static cell AMX_NATIVE_CALL cs_set_user_submodel(AMX* amx, cell* params) { - // Check Player - CHECK_PLAYER(params[1]); - // Fetch player pointer - edict_t* pPlayer = MF_GetPlayerEdict(params[1]); + int index = params[1]; + + CHECK_PLAYER(index); + edict_t *pPlayer = MF_GetPlayerEdict(index); pPlayer->v.body = params[2]; return 1; } -#if PAWN_CELL_SIZE == 32 + +// native Float:cs_get_user_lastactivity(index); static cell AMX_NATIVE_CALL cs_get_user_lastactivity(AMX *amx, cell *params) { - //Return time that the user last did activity + GET_OFFSET("CBasePlayer", m_fLastMovement); + + int index = params[1]; + + CHECK_PLAYER(index); + edict_t *pPlayer = MF_GetPlayerEdict(index); - //Check player - CHECK_PLAYER(params[1]); - - // Make into edict pointer - edict_t *pPlayer = MF_GetPlayerEdict(params[1]); - - return amx_ftoc(*((REAL*)pPlayer->pvPrivateData + OFFSET_LASTACTIVITY)); + return amx_ftoc(get_pdata(pPlayer, m_fLastMovement)); } +// native cs_set_user_lastactivity(index, Float:value); static cell AMX_NATIVE_CALL cs_set_user_lastactivity(AMX *amx, cell *params) { - //set time that the user last did activity + GET_OFFSET("CBasePlayer", m_fLastMovement); + + int index = params[1]; + + CHECK_PLAYER(index); + edict_t *pPlayer = MF_GetPlayerEdict(index); - //Check player - CHECK_PLAYER(params[1]); - - // Make into edict pointer - edict_t *pPlayer = MF_GetPlayerEdict(params[1]); - - *((REAL*)pPlayer->pvPrivateData + OFFSET_LASTACTIVITY) = amx_ctof(params[2]); + set_pdata(pPlayer, m_fLastMovement, amx_ctof(params[2])); return 1; } +// native cs_get_user_hostagekills(index); static cell AMX_NATIVE_CALL cs_get_user_hostagekills(AMX *amx, cell *params) { - //Return number of hostages that user has killed + GET_OFFSET("CBasePlayer", m_iHostagesKilled); - //Check player - CHECK_PLAYER(params[1]); + int index = params[1]; - // Make into edict pointer - edict_t *pPlayer = MF_GetPlayerEdict(params[1]); + CHECK_PLAYER(index); + edict_t *pPlayer = MF_GetPlayerEdict(index); - return *((int *)pPlayer->pvPrivateData + OFFSET_HOSTAGEKILLS); + return get_pdata(pPlayer, m_iHostagesKilled); } +// native cs_set_user_hostagekills(index, value); static cell AMX_NATIVE_CALL cs_set_user_hostagekills(AMX *amx, cell *params) { - //Set number of hostages that user has killed + GET_OFFSET("CBasePlayer", m_iHostagesKilled); - //Check player - CHECK_PLAYER(params[1]); + int index = params[1]; - // Make into edict pointer - edict_t *pPlayer = MF_GetPlayerEdict(params[1]); + CHECK_PLAYER(index); + edict_t *pPlayer = MF_GetPlayerEdict(index); - *((int *)pPlayer->pvPrivateData + OFFSET_HOSTAGEKILLS) = params[2]; + set_pdata(pPlayer, m_iHostagesKilled, params[2]); return 1; } +// native Float:cs_get_hostage_lastuse(index); static cell AMX_NATIVE_CALL cs_get_hostage_lastuse(AMX *amx, cell *params) { - //Return time that the hostage was last used + GET_OFFSET("CHostage", m_flPathAcquired); + GET_OFFSET("CHostage", m_improv); + + int index = params[1]; - CHECK_NONPLAYER(params[1]); + CHECK_NONPLAYER(index); + edict_t *pHostage = INDEXENT(index); - // Make into edict pointer - edict_t* pHostage = INDEXENT(params[1]); + CHECK_HOSTAGE(pHostage); + + void *pImprov = get_pdata(pHostage, m_improv); - // Make sure this is a hostage. - if (strcmp(STRING(pHostage->v.classname), "hostage_entity") != 0) { - MF_LogError(amx, AMX_ERR_NATIVE, "Entity %d (\"%s\") is not a hostage", params[1], STRING(pHostage->v.classname)); - return 0; + if (pImprov) // Specific to CZ + { + GET_OFFSET("CHostageImprov", m_behavior); + GET_OFFSET("SimpleStateMachine", m_stateTimer); // +4 for virtual table pointer of IImprovEvent. + + return amx_ftoc(get_pdata(pImprov, m_behavior + 4 + m_stateTimer + 0)); // m_timestamp } - - return amx_ftoc(*((REAL*)pHostage->pvPrivateData + OFFSET_HOSTAGE_LASTUSE)); + + return amx_ftoc(get_pdata(pHostage, m_flPathAcquired)); } + +// native cs_set_hostage_lastuse(index, Float:value); static cell AMX_NATIVE_CALL cs_set_hostage_lastuse(AMX *amx, cell *params) { - //Return time that the hostage was last used + GET_OFFSET("CHostage", m_flPathAcquired); + GET_OFFSET("CHostage", m_improv); + + int index = params[1]; + + CHECK_NONPLAYER(index); + edict_t *pHostage = INDEXENT(index); + + CHECK_HOSTAGE(pHostage); - CHECK_NONPLAYER(params[1]); + void *pImprov = get_pdata(pHostage, m_improv); - // Make into edict pointer - edict_t* pHostage = INDEXENT(params[1]); + if (pImprov) // Specific to CZ + { + GET_OFFSET("CHostageImprov", m_behavior); + GET_OFFSET("SimpleStateMachine", m_stateTimer); // +4 for virtual table pointer of IImprovEvent. + + return amx_ftoc(get_pdata(pImprov, m_behavior + 4 + m_stateTimer + 0)); // m_timestamp - // Make sure this is a hostage. - if (strcmp(STRING(pHostage->v.classname), "hostage_entity") != 0) { - MF_LogError(amx, AMX_ERR_NATIVE, "Entity %d (\"%s\") is not a hostage", params[1], STRING(pHostage->v.classname)); - return 0; } - - *((REAL*)pHostage->pvPrivateData + OFFSET_HOSTAGE_LASTUSE) = amx_ctof(params[2]); + set_pdata(pHostage, m_flPathAcquired, amx_ctof(params[2])); return 1; } + +// native Float:cs_get_hostage_nextuse(index); static cell AMX_NATIVE_CALL cs_get_hostage_nextuse(AMX* amx, cell* params) { - //Return time that the hostage was last used - - CHECK_NONPLAYER(params[1]); + GET_OFFSET("CHostage", m_flNextChange); - // Make into edict pointer - edict_t* pHostage = INDEXENT(params[1]); + int index = params[1]; - // Make sure this is a hostage. - if (strcmp(STRING(pHostage->v.classname), "hostage_entity") != 0) { - MF_LogError(amx, AMX_ERR_NATIVE, "Entity %d (\"%s\") is not a hostage", params[1], STRING(pHostage->v.classname)); - return 0; - } + CHECK_NONPLAYER(index); + edict_t *pHostage = INDEXENT(index); + + CHECK_HOSTAGE(pHostage); - return amx_ftoc(*((REAL*)pHostage->pvPrivateData + OFFSET_HOSTAGE_NEXTUSE)); + return amx_ftoc(get_pdata(pHostage, m_flNextChange)); } + +// native cs_set_hostage_nextuse(index, Float:value); static cell AMX_NATIVE_CALL cs_set_hostage_nextuse(AMX* amx, cell* params) { - //Return time that the hostage was last used - - CHECK_NONPLAYER(params[1]); + GET_OFFSET("CHostage", m_flNextChange); - // Make into edict pointer - edict_t* pHostage = INDEXENT(params[1]); + int index = params[1]; - // Make sure this is a hostage. - if (strcmp(STRING(pHostage->v.classname), "hostage_entity") != 0) { - MF_LogError(amx, AMX_ERR_NATIVE, "Entity %d (\"%s\") is not a hostage", params[1], STRING(pHostage->v.classname)); - return 0; - } - - *((REAL*)pHostage->pvPrivateData + OFFSET_HOSTAGE_NEXTUSE) = amx_ctof(params[2]); + CHECK_NONPLAYER(index); + edict_t *pHostage = INDEXENT(index); + + CHECK_HOSTAGE(pHostage); + + set_pdata(pHostage, m_flNextChange, amx_ctof(params[2])); return 1; } +// native Float:cs_get_c4_explode_time(index); static cell AMX_NATIVE_CALL cs_get_c4_explode_time(AMX* amx, cell* params) { - CHECK_NONPLAYER(params[1]); - edict_t* pC4 = INDEXENT(params[1]); + GET_OFFSET("CGrenade", m_flC4Blow); + + int index = params[1]; + + CHECK_NONPLAYER(index); + edict_t *pC4 = INDEXENT(index); - // Make sure it's a c4 if (strcmp(STRING(pC4->v.classname), "grenade") != 0) { - MF_LogError(amx, AMX_ERR_NATIVE, "Entity %d (\"%s\") is not C4!", params[1], STRING(pC4->v.classname)); + MF_LogError(amx, AMX_ERR_NATIVE, "Entity %d (\"%s\") is not C4!", index, STRING(pC4->v.classname)); return 0; } - return amx_ftoc(*((REAL*)pC4->pvPrivateData + OFFSET_C4_EXPLODE_TIME)); + return amx_ftoc(get_pdata(pC4, m_flC4Blow)); } + +// native cs_set_c4_explode_time(index, Float:value); static cell AMX_NATIVE_CALL cs_set_c4_explode_time(AMX* amx, cell* params) { - CHECK_NONPLAYER(params[1]); - edict_t* pC4 = INDEXENT(params[1]); + GET_OFFSET("CGrenade", m_flC4Blow); + + int index = params[1]; + + CHECK_NONPLAYER(index); + edict_t *pC4 = INDEXENT(index); - // Make sure it's a c4 if (strcmp(STRING(pC4->v.classname), "grenade") != 0) { - MF_LogError(amx, AMX_ERR_NATIVE, "Entity %d (\"%s\") is not C4!", params[1], STRING(pC4->v.classname)); + MF_LogError(amx, AMX_ERR_NATIVE, "Entity %d (\"%s\") is not C4!", index, STRING(pC4->v.classname)); return 0; } - *((REAL*)pC4->pvPrivateData + OFFSET_C4_EXPLODE_TIME) = amx_ctof(params[2]); + set_pdata(pC4, m_flC4Blow, amx_ctof(params[2])); return 1; } + +// native bool:cs_get_c4_defusing(c4index); static cell AMX_NATIVE_CALL cs_get_c4_defusing(AMX* amx, cell* params) { - CHECK_NONPLAYER(params[1]); - edict_t* pC4 = INDEXENT(params[1]); + GET_OFFSET("CGrenade", m_bStartDefuse); + + int index = params[1]; + + CHECK_NONPLAYER(index); + edict_t *pC4 = INDEXENT(index); - // Make sure it's a c4 if (strcmp(STRING(pC4->v.classname), "grenade") != 0) { - MF_LogError(amx, AMX_ERR_NATIVE, "Entity %d (\"%s\") is not C4!", params[1], STRING(pC4->v.classname)); + MF_LogError(amx, AMX_ERR_NATIVE, "Entity %d (\"%s\") is not C4!", index, STRING(pC4->v.classname)); return 0; } - return *(bool *)((char *)(pC4->pvPrivateData) + OFFSET_C4_DEFUSING) ? 1 : 0; + return get_pdata(pC4, m_bStartDefuse) ? 1 : 0; } +// native cs_set_c4_defusing(c4index, bool:defusing); static cell AMX_NATIVE_CALL cs_set_c4_defusing(AMX* amx, cell* params) { - CHECK_NONPLAYER(params[1]); - edict_t* pC4 = INDEXENT(params[1]); + GET_OFFSET("CGrenade", m_bStartDefuse); + + int index = params[1]; + + CHECK_NONPLAYER(index); + edict_t *pC4 = INDEXENT(index); - // Make sure it's a c4 if (strcmp(STRING(pC4->v.classname), "grenade") != 0) { - MF_LogError(amx, AMX_ERR_NATIVE, "Entity %d (\"%s\") is not C4!", params[1], STRING(pC4->v.classname)); + MF_LogError(amx, AMX_ERR_NATIVE, "Entity %d (\"%s\") is not C4!", index, STRING(pC4->v.classname)); return 0; } - *(bool *)((char *)(pC4->pvPrivateData) + OFFSET_C4_DEFUSING) = params[2] ? true : false; + set_pdata(pC4, m_bStartDefuse, params[2] != 0); return 1; } -extern CreateNamedEntityFunc CS_CreateNamedEntity; -extern UTIL_FindEntityByStringFunc CS_UTIL_FindEntityByString; - // cs_create_entity(const classname[]) static cell AMX_NATIVE_CALL cs_create_entity(AMX* amx, cell* params) { @@ -1756,31 +1737,8 @@ static cell AMX_NATIVE_CALL cs_find_ent_by_class(AMX* amx, cell* params) return 0; } - -#else - -static cell AMX_NATIVE_CALL not_on_64(AMX* amx, cell* params) +AMX_NATIVE_INFO CstrikeNatives[] = { - MF_LogError(amx, AMX_ERR_NATIVE, "This function is not implemented on AMD64"); - - return 0; -} -#define cs_get_user_lastactivity not_on_64 -#define cs_set_user_lastactivity not_on_64 -#define cs_get_user_hostagekills not_on_64 -#define cs_set_user_hostagekills not_on_64 -#define cs_get_hostage_lastuse not_on_64 -#define cs_set_hostage_lastuse not_on_64 -#define cs_get_hostage_nextuse not_on_64 -#define cs_set_hostage_nextuse not_on_64 -#define cs_get_c4_explode_time not_on_64 -#define cs_set_c4_explode_time not_on_64 -#define cs_get_c4_defusing not_on_64 -#define cs_set_c4_defusing not_on_64 -#endif - - -AMX_NATIVE_INFO CstrikeNatives[] = { {"cs_set_user_money", cs_set_user_money}, {"cs_get_user_money", cs_get_user_money}, {"cs_get_user_deaths", cs_get_user_deaths}, @@ -1844,83 +1802,5 @@ AMX_NATIVE_INFO CstrikeNatives[] = { {"cs_create_entity", cs_create_entity }, {"cs_find_ent_by_class", cs_find_ent_by_class}, - {NULL, NULL} + {nullptr, nullptr} }; - -edict_s* FN_CreateNamedEntity(int classname) { - if (g_noknives && !strcmp(STRING(classname), "weapon_knife")) { - if (g_precachedknife) { - // Knife is creating - RETURN_META_VALUE(MRES_SUPERCEDE, NULL); - } - // Let it create a knife first time; this seems to keep it precached properly in case anyone give_items a knife later. - g_precachedknife = true; - } - - RETURN_META_VALUE(MRES_IGNORED, 0); -} - -void FN_ServerDeactivate() { - g_precachedknife = false; - - RETURN_META(MRES_IGNORED); -} - -/***GetEngineFunctions******************/ -void MessageBegin(int msg_dest, int msg_type, const float *pOrigin, edict_t *ed) { - // Reset player model a short while (MODELRESETTIME) after this if they are using an edited model. - if(msg_type == GET_USER_MSG_ID(PLID, "ResetHUD", NULL)) { - int entityIndex = ENTINDEX(ed); - if (g_zooming[entityIndex]) - g_zooming[entityIndex] = 0; - if(g_players[entityIndex].GetModelled()) - g_players[entityIndex].SetInspectModel(true); - //g_players[ENTINDEX(ed)].SetTime(gpGlobals->time + MODELRESETTIME); - } - - RETURN_META(MRES_IGNORED); -} - - -/***GetEntityAPI2******************/ -void ClientDisconnect(edict_t *pEntity) { - int index = ENTINDEX(pEntity); - g_players[index].SetModelled(false); - g_zooming[index] = 0; - - RETURN_META(MRES_IGNORED); -} - -void ClientUserInfoChanged(edict_t *pEntity, char *infobuffer) { - int index = ENTINDEX(pEntity); - - if(g_players[index].GetModelled() && pEntity->v.deadflag == DEAD_NO) { - RETURN_META(MRES_SUPERCEDE); - } else { - RETURN_META(MRES_IGNORED); - } -} - -void PlayerPostThink(edict_t* pPlayer) { - int entityIndex = ENTINDEX(pPlayer); - - if(g_players[entityIndex].GetModelled()) { - if (g_players[entityIndex].GetInspectModel() && strcmp(g_players[entityIndex].GetModel(), GETCLIENTKEYVALUE(GETINFOKEYBUFFER(pPlayer), "model")) != 0) { - //LOG_CONSOLE(PLID, "%s should have model %s and currently has %s", STRING(pPlayer->v.netname), (char*)g_players[entityIndex].GetModel(), GETCLIENTKEYVALUE(GETINFOKEYBUFFER(pPlayer), "model")); - SETCLIENTKEYVALUE(entityIndex, GETINFOKEYBUFFER(pPlayer), "model", (char*)g_players[entityIndex].GetModel()); - g_players[entityIndex].SetInspectModel(false); - } - } - RETURN_META(MRES_IGNORED); -} - -void PlayerPreThink(edict_t *pPlayer) -{ - int entityIndex = ENTINDEX(pPlayer); - if (g_zooming[entityIndex]) - { - *((int *)pPlayer->pvPrivateData + OFFSET_ZOOMTYPE) = g_zooming[entityIndex]; - } - - RETURN_META(MRES_IGNORED); -} diff --git a/modules/cstrike/cstrike/CstrikePlayer.cpp b/modules/cstrike/cstrike/CstrikePlayer.cpp index a3953e13..05099bce 100644 --- a/modules/cstrike/cstrike/CstrikePlayer.cpp +++ b/modules/cstrike/cstrike/CstrikePlayer.cpp @@ -12,47 +12,61 @@ // #include "CstrikePlayer.h" -#include // strcpy() -////////////////////////////////////////////////////////////////////// -// Construction/Destruction -////////////////////////////////////////////////////////////////////// +CPlayer Players[33]; +ke::Vector ModelsUpdateQueue; -CCstrikePlayer::CCstrikePlayer() +void ClientDisconnect(edict_t *pEntity) { - modelled = false; - inspectModel = false; + int index = ENTINDEX(pEntity); + + Players[index].ResetModel(); + Players[index].ResetZoom(); + + RETURN_META(MRES_IGNORED); } -bool CCstrikePlayer::GetModelled() +void ClientUserInfoChanged(edict_t *pEntity, char *infobuffer) { - return modelled; + if (pEntity->pvPrivateData) + { + Players[ENTINDEX(pEntity)].UpdateModel(pEntity); + } + + RETURN_META(MRES_IGNORED); } -bool CCstrikePlayer::SetModelled(bool modelledIn) +void SetClientKeyValue(int clientIndex, char *infobuffer, const char *key, const char *value) { - if (!modelledIn) - SetInspectModel(false); + if (!strcmp(key, "model") && Players[clientIndex].HasModel(value)) + { + RETURN_META(MRES_SUPERCEDE); + } - return modelled = modelledIn; + RETURN_META(MRES_IGNORED); } -const char* CCstrikePlayer::GetModel() +void StartFrame() { - return model; -} + if (ModelsUpdateQueue.empty()) + { + g_pFunctionTable->pfnStartFrame = nullptr; -void CCstrikePlayer::SetModel(const char* modelIn) -{ - strcpy(model, modelIn); -} + for (int i = 1; i < gpGlobals->maxClients; ++i) + { + if (Players[i].HasModel()) + { + RETURN_META(MRES_IGNORED); + } + } -bool CCstrikePlayer::GetInspectModel() -{ - return inspectModel; -} + g_pFunctionTable->pfnClientUserInfoChanged = nullptr; + g_pengfuncsTable->pfnSetClientKeyValue = nullptr; -void CCstrikePlayer::SetInspectModel(bool inspectModelIn) -{ - inspectModel = inspectModelIn; + RETURN_META(MRES_IGNORED); + } + + ServerStatic->clients[ModelsUpdateQueue.popCopy()].sendinfo = true; + + RETURN_META(MRES_IGNORED); } diff --git a/modules/cstrike/cstrike/CstrikePlayer.h b/modules/cstrike/cstrike/CstrikePlayer.h index 0674192d..fa78644e 100644 --- a/modules/cstrike/cstrike/CstrikePlayer.h +++ b/modules/cstrike/cstrike/CstrikePlayer.h @@ -11,27 +11,131 @@ // Counter-Strike Module // -#if !defined(INCLUDED_CCSTRIKEPLAYER) -#define INCLUDED_CCSTRIKEPLAYER +#ifndef _CSTRIKE_PLAYER_H_ +#define _CSTRIKE_PLAYER_H_ -class CCstrikePlayer +#include +#include "CstrikeUtils.h" +#include "CstrikeHacks.h" +#include + +extern ke::Vector ModelsUpdateQueue; + +void StartFrame(); +void ClientUserInfoChanged(edict_t *pEntity, char *infobuffer); +void SetClientKeyValue(int clientIndex, char *infobuffer, const char *key, const char *value); + +class CPlayer { -public: - CCstrikePlayer(); + public: - bool GetModelled(); - bool SetModelled(bool modelledIn); - const char* GetModel(); - void SetModel(const char* modelIn); + CPlayer() + { + ResetModel(); + ResetZoom(); + } - bool GetInspectModel(); - void SetInspectModel(bool inspectModelIn); + bool HasModel(const char *model = nullptr) + { + if (*m_Model != '\0') + { + if (model && *model) + { + return strcmp(m_Model, model) != 0; + } + return true; + } -private: - bool inspectModel; - bool modelled; - char model[32]; + return false; + } + + void SetModel(const char* modelIn) + { + if (modelIn && *modelIn) + { + strncopy(m_Model, modelIn, sizeof(m_Model)); + } + else + { + ResetModel(); + } + } + + void ResetModel(edict_t *pPlayer = nullptr) + { + *m_Model = '\0'; + + if (pPlayer) + { + MDLL_ClientUserInfoChanged(pPlayer, GETINFOKEYBUFFER(pPlayer)); + + PostponeModelUpdate(ENTINDEX(pPlayer) - 1); + } + } + + void UpdateModel(edict_t *pPlayer) + { + if (!HasModel()) + { + return; + } + + char *infobuffer = GETINFOKEYBUFFER(pPlayer); + + if (strcmp(GETCLIENTKEYVALUE(infobuffer, "model"), m_Model) != 0) + { + int index = ENTINDEX(pPlayer); + + SETCLIENTKEYVALUE(index, infobuffer, "model", m_Model); + + PostponeModelUpdate(index - 1); + } + } + + int GetZoom() + { + return m_Zooming; + } + + void SetZoom(int value) + { + m_Zooming = value; + } + + void ResetZoom() + { + m_Zooming = 0; + } + + private: + + void PostponeModelUpdate(int index) + { + if (!g_pFunctionTable->pfnStartFrame) + { + g_pFunctionTable->pfnStartFrame = StartFrame; + g_pFunctionTable->pfnClientUserInfoChanged = ClientUserInfoChanged; + g_pengfuncsTable->pfnSetClientKeyValue = SetClientKeyValue; + } + + if (!ServerStatic) + { + MF_Log("Postponing of model update disabled, check your gamedata files"); + return; + } + + ServerStatic->clients[index].sendinfo = false; + + ModelsUpdateQueue.append(index); + } + + private: + + char m_Model[32]; + int m_Zooming; }; -#endif // !defined(INCLUDED_CCSTRIKEPLAYER) +extern CPlayer Players[33]; + +#endif // _CSTRIKE_PLAYER_H_ diff --git a/modules/cstrike/cstrike/CstrikeUserMessages.cpp b/modules/cstrike/cstrike/CstrikeUserMessages.cpp new file mode 100644 index 00000000..00c368f6 --- /dev/null +++ b/modules/cstrike/cstrike/CstrikeUserMessages.cpp @@ -0,0 +1,155 @@ +// vim: set ts=4 sw=4 tw=99 noet: +// +// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). +// Copyright (C) The AMX Mod X Development Team. +// +// This software is licensed under the GNU General Public License, version 3 or higher. +// Additional exceptions apply. For full license details, see LICENSE.txt or visit: +// https://alliedmods.net/amxmodx-license + +// +// Counter-Strike Module +// + +#include +#include "CstrikeUserMessages.h" +#include "CstrikeUtils.h" +#include "CstrikeHacks.h" +#include "CstrikePlayer.h" + +bool ShouldBlock; +bool ShouldBlockHLTV; + +int MessageIdArmorType; +int MessageIdHLTV; +int MessageIdMoney; +int MessageIdResetHUD; +int MessageIdScoreAttrib; +int MessageIdScoreInfo; +int MessageIdSetFOV; +int MessageIdStatusIcon; +int MessageIdTeamInfo; +int MessageIdTextMsg; + +struct UserMsg +{ + const char* name; + int* id; +}; + +UserMsg MessagesList[] = +{ + { "ArmorType" , &MessageIdArmorType }, + { "HLTV" , &MessageIdHLTV }, + { "Money" , &MessageIdMoney }, + { "ResetHUD" , &MessageIdResetHUD }, + { "ScoreAttrib", &MessageIdScoreAttrib }, + { "ScoreInfo" , &MessageIdScoreInfo }, + { "SetFOV" , &MessageIdSetFOV }, + { "StatusIcon" , &MessageIdStatusIcon }, + { "TeamInfo" , &MessageIdTeamInfo }, + { "TextMsg" , &MessageIdTextMsg }, + { nullptr , nullptr } +}; + +int OnRegUserMsg_Post(const char *pszName, int iSize) +{ + for (size_t i = 0; MessagesList[i].name; ++i) + { + if (!*MessagesList[i].id && strcmp(MessagesList[i].name, pszName) == 0) + { + *MessagesList[i].id = META_RESULT_ORIG_RET(int); + break; + } + } + + RETURN_META_VALUE(MRES_IGNORED, 0); +} + +void OnMessageBegin(int msg_dest, int msg_type, const float *pOrigin, edict_t *pEntity) +{ + switch (msg_dest) + { + case MSG_ONE: + case MSG_ONE_UNRELIABLE: + { + if (msg_type == MessageIdSetFOV) + { + int index = ENTINDEX(pEntity); + int zoom = Players[index].GetZoom(); + + if (zoom) + { + GET_OFFSET_NO_ERROR("CBasePlayer", m_iFOV); + + if (get_pdata(pEntity, m_iFOV) != zoom) + { + set_pdata(pEntity, m_iFOV, zoom); + + ShouldBlock = true; + ShouldBlockHLTV = true; + + RETURN_META(MRES_SUPERCEDE); + } + } + } + else if (msg_type == MessageIdResetHUD) + { + int index = ENTINDEX(pEntity); + + if (Players[index].GetZoom()) + Players[index].ResetZoom(); + } + break; + } + case MSG_SPEC: + { + if (msg_type == MessageIdHLTV && ShouldBlockHLTV) + { + ShouldBlock = true; + ShouldBlockHLTV = false; + + RETURN_META(MRES_SUPERCEDE); + } + break; + } + } + + if (ShouldBlockHLTV) + { + ShouldBlockHLTV = false; + } + + RETURN_META(MRES_IGNORED); +} + +void OnWriteByte(int iValue) +{ + if (ShouldBlock) + { + RETURN_META(MRES_SUPERCEDE); + } + + RETURN_META(MRES_IGNORED); +} + +void OnMessageEnd(void) +{ + if (ShouldBlock) + { + ShouldBlock = false; + RETURN_META(MRES_SUPERCEDE); + } + + RETURN_META(MRES_IGNORED); +} + +void EnableMessageHooks() +{ + if (!g_pengfuncsTable->pfnMessageBegin) + { + g_pengfuncsTable->pfnMessageBegin = OnMessageBegin; + g_pengfuncsTable->pfnWriteByte = OnWriteByte; + g_pengfuncsTable->pfnMessageEnd = OnMessageEnd; + } +} diff --git a/modules/cstrike/cstrike/CstrikeUserMessages.h b/modules/cstrike/cstrike/CstrikeUserMessages.h new file mode 100644 index 00000000..7c1a66ac --- /dev/null +++ b/modules/cstrike/cstrike/CstrikeUserMessages.h @@ -0,0 +1,30 @@ +// vim: set ts=4 sw=4 tw=99 noet: +// +// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). +// Copyright (C) The AMX Mod X Development Team. +// +// This software is licensed under the GNU General Public License, version 3 or higher. +// Additional exceptions apply. For full license details, see LICENSE.txt or visit: +// https://alliedmods.net/amxmodx-license + +// +// Counter-Strike Module +// + +#ifndef CSTRIKE_USER_MESSAGES_H +#define CSTRIKE_USER_MESSAGES_H + +extern int MessageIdArmorType; +extern int MessageIdHLTV; +extern int MessageIdMoney; +extern int MessageIdResetHUD; +extern int MessageIdScoreAttrib; +extern int MessageIdScoreInfo; +extern int MessageIdSetFOV; +extern int MessageIdStatusIcon; +extern int MessageIdTeamInfo; +extern int MessageIdTextMsg; + +void EnableMessageHooks(); + +#endif // CSTRIKE_USER_MESSAGES_H diff --git a/modules/cstrike/cstrike/CstrikeUtils.cpp b/modules/cstrike/cstrike/CstrikeUtils.cpp index 6892cbd7..d6949364 100644 --- a/modules/cstrike/cstrike/CstrikeUtils.cpp +++ b/modules/cstrike/cstrike/CstrikeUtils.cpp @@ -12,93 +12,20 @@ // #include "amxxmodule.h" -#include "MemoryUtils.h" -bool UTIL_IsPlayer(AMX* amx, edict_t* pPlayer) +extern int MessageIdTextMsg; + +bool UTIL_IsPlayer(edict_t *pPlayer) { - bool player = false; - - if (strcmp(STRING(pPlayer->v.classname), "player") == 0) - { - player = true; - } - - return player; + return strcmp(STRING(pPlayer->v.classname), "player") == 0; } void UTIL_TextMsg_Generic(edict_t* pPlayer, const char* message) { - MESSAGE_BEGIN(MSG_ONE, GET_USER_MSG_ID(PLID, "TextMsg", NULL), NULL, pPlayer); - WRITE_BYTE(HUD_PRINTCENTER); // 1 = console, 2 = console, 3 = chat, 4 = center, 5 = radio - WRITE_STRING(message); + MESSAGE_BEGIN(MSG_ONE, MessageIdTextMsg, nullptr, pPlayer); + WRITE_BYTE(HUD_PRINTCENTER); // 1 = console, 2 = console, 3 = chat, 4 = center, 5 = radio + WRITE_STRING(message); MESSAGE_END(); - /* - The byte above seems to use these: - #define HUD_PRINTNOTIFY 1 - #define HUD_PRINTCONSOLE 2 - #define HUD_PRINTTALK 3 - #define HUD_PRINTCENTER 4 - #define HUD_PRINTRADIO 5 - However both 1 and 2 seems to go to console with Steam CS. - */ -} - -void *UTIL_FindAddressFromEntry(const char *entry, bool isHidden, const char *library) -{ - void *addressInBase = NULL; - void *finalAddress; - - if (strcmp(library, "mod") == 0) - { - addressInBase = (void *)MDLL_Spawn; - } - else if (strcmp(library, "engine") == 0) - { - addressInBase = (void *)gpGlobals; - } - - finalAddress = NULL; - - if (*entry != '\\') - { -#if defined(WIN32) - - MEMORY_BASIC_INFORMATION mem; - - if (VirtualQuery(addressInBase, &mem, sizeof(mem))) - { - finalAddress = g_MemUtils.ResolveSymbol(mem.AllocationBase, entry); - } - -#elif defined(__linux__) || defined(__APPLE__) - - Dl_info info; - - if (dladdr(addressInBase, &info) != 0) - { - void *handle = dlopen(info.dli_fname, RTLD_NOW); - if (handle) - { - if (isHidden) - { - finalAddress = g_MemUtils.ResolveSymbol(handle, entry); - } - else - { - finalAddress = dlsym(handle, entry); - } - - dlclose(handle); - } - } -#endif - } - else - { - finalAddress = g_MemUtils.DecodeAndFindPattern(addressInBase, entry); - } - - return finalAddress != NULL ? finalAddress : NULL; } bool UTIL_CheckForPublic(const char *publicname) @@ -108,9 +35,9 @@ bool UTIL_CheckForPublic(const char *publicname) int i = 0; char blah[64]; - strncpy(blah, publicname, sizeof(blah)- 1); + strncpy(blah, publicname, sizeof(blah) - 1); - while ((amx = MF_GetScriptAmx(i++)) != NULL) + while ((amx = MF_GetScriptAmx(i++))) { if (MF_AmxFindPublic(amx, blah, &iFunctionIndex) == AMX_ERR_NONE) { @@ -118,6 +45,5 @@ bool UTIL_CheckForPublic(const char *publicname) } } - return false; + return false; } - diff --git a/modules/cstrike/cstrike/CstrikeUtils.h b/modules/cstrike/cstrike/CstrikeUtils.h index 9e8f75cd..ff10c287 100644 --- a/modules/cstrike/cstrike/CstrikeUtils.h +++ b/modules/cstrike/cstrike/CstrikeUtils.h @@ -14,11 +14,9 @@ #ifndef CSTRIKE_UTILS_H #define CSTRIKE_UTILS_H -bool UTIL_IsPlayer(AMX* amx, edict_t* pPlayer); +bool UTIL_IsPlayer(edict_t *pPlayer); void UTIL_TextMsg_Generic(edict_t* pPlayer, const char* message); -void *UTIL_FindAddressFromEntry(const char *entry, bool isHidden = false, const char *library = "mod"); bool UTIL_CheckForPublic(const char *publicname); -char *UTIL_StringToLower(char *str); #define GETINFOKEYBUFFER (*g_engfuncs.pfnGetInfoKeyBuffer) #define SETCLIENTKEYVALUE (*g_engfuncs.pfnSetClientKeyValue) @@ -65,39 +63,132 @@ char *UTIL_StringToLower(char *str); } \ } +#define CHECK_HOSTAGE(x) \ + if (strcmp(STRING(x->v.classname), "hostage_entity") != 0 && strcmp(STRING(x->v.classname), "monster_scientist") != 0) \ + { \ + MF_LogError(amx, AMX_ERR_NATIVE, "Entity %d (\"%s\") is not a hostage", index, STRING(x->v.classname)); \ + return 0; \ + } + #define GETEDICT(n) \ ((n >= 1 && n <= gpGlobals->maxClients) ? MF_GetPlayerEdict(n) : INDEXENT(n)) -inline edict_t *PrivateToEdict(const void *pdata) +#define GET_OFFSET(classname, member) \ + static int member = -1; \ + if (member == -1) \ + { \ + if (!CommonConfig->GetOffsetByClass(classname, #member, &member) || member < 0)\ + { \ + MF_LogError(amx, AMX_ERR_NATIVE, "Invalid %s offset. Native %s is disabled", #member, __FUNCTION__);\ + return 0; \ + } \ + } + +#define GET_OFFSET_NO_ERROR(classname, member) \ + static int member = -1; \ + if (member == -1) \ + { \ + if (!CommonConfig->GetOffsetByClass(classname, #member, &member) || member < 0)\ + { \ + return; \ + } \ + } + +template +inline T& get_pdata(edict_t *pEntity, int offset, int element = 0) { - if (!pdata) - { - return NULL; - } + return *reinterpret_cast(reinterpret_cast(pEntity->pvPrivateData) + offset + element * sizeof(T)); +} - char *ptr = (char*)pdata; - ptr += 4; - entvars_t *pev = *(entvars_t **)ptr; +template +inline T& get_pdata(void *pEntity, int offset, int element = 0) +{ + return *reinterpret_cast(reinterpret_cast(pEntity) + offset + element * sizeof(T)); +} - if (!pev) - { - return NULL; - } +template +inline void set_pdata(edict_t *pEntity, int offset, T value, int element = 0) +{ + *reinterpret_cast(reinterpret_cast(pEntity->pvPrivateData) + offset + element * sizeof(T)) = value; +} - return pev->pContainingEntity; +template +inline void set_pdata(void *pEntity, int offset, T value, int element = 0) +{ + *reinterpret_cast(reinterpret_cast(pEntity) + offset + element * sizeof(T)) = value; +} + +class EHANDLE +{ + private: + + edict_t* m_pent; + int m_serialnumber; + + public: + + edict_t* Get(void) + { + if (!FNullEnt(m_pent)) + { + if (m_pent->serialnumber == m_serialnumber) + { + return m_pent; + } + + return nullptr; + } + + return nullptr; + }; + + edict_t* Set(edict_t *pent) + { + if (!FNullEnt(pent)) + { + m_pent = pent; + m_serialnumber = m_pent->serialnumber; + } + else + { + m_pent = nullptr; + m_serialnumber = 0; + } + + return pent; + }; }; -inline int PrivateToIndex(const void *pdata) +class CUnifiedSignals { - edict_t *pEntity = PrivateToEdict(pdata); + public: - if (!pEntity) - { - return -1; - } + void Update(void) + { + m_flState = m_flSignal; + m_flSignal = 0; + } - return ENTINDEX(pEntity); + void Signal(int flags) + { + m_flSignal |= flags; + } + + int GetSignal(void) + { + return m_flSignal; + } + + int GetState(void) + { + return m_flState; + } + + private: + + int m_flSignal; + int m_flState; }; #endif // CSTRIKE_UTILS_H diff --git a/modules/cstrike/cstrike/moduleconfig.h b/modules/cstrike/cstrike/moduleconfig.h index 52de1dfd..79b9eccd 100644 --- a/modules/cstrike/cstrike/moduleconfig.h +++ b/modules/cstrike/cstrike/moduleconfig.h @@ -122,11 +122,11 @@ // #define FN_ClientKill ClientKill /* pfnClientKill() (wd) Player has typed "kill" */ // #define FN_ClientPutInServer ClientPutInServer /* pfnClientPutInServer() (wd) Client is entering the game */ // #define FN_ClientCommand ClientCommand /* pfnClientCommand() (wd) Player has sent a command (typed or from a bind) */ -#define FN_ClientUserInfoChanged ClientUserInfoChanged /* pfnClientUserInfoChanged() (wd) Client has updated their setinfo structure */ +// #define FN_ClientUserInfoChanged ClientUserInfoChanged /* pfnClientUserInfoChanged() (wd) Client has updated their setinfo structure */ // #define FN_ServerActivate ServerActivate /* pfnServerActivate() (wd) Server is starting a new map */ -#define FN_ServerDeactivate ServerDeactivate /* pfnServerDeactivate() (wd) Server is leaving the map (shutdown or changelevel); SDK2 */ -#define FN_PlayerPreThink PlayerPreThink /* pfnPlayerPreThink() */ -#define FN_PlayerPostThink PlayerPostThink /* pfnPlayerPostThink() */ +// #define FN_ServerDeactivate ServerDeactivate /* pfnServerDeactivate() (wd) Server is leaving the map (shutdown or changelevel); SDK2 */ +// #define FN_PlayerPreThink PlayerPreThink /* pfnPlayerPreThink() */ +// #define FN_PlayerPostThink PlayerPostThink /* pfnPlayerPostThink() */ // #define FN_StartFrame StartFrame /* pfnStartFrame() */ // #define FN_ParmsNewLevel ParmsNewLevel /* pfnParmsNewLevel() */ // #define FN_ParmsChangeLevel ParmsChangeLevel /* pfnParmsChangeLevel() */ @@ -229,7 +229,7 @@ // #define FN_AngleVectors AngleVectors // #define FN_CreateEntity CreateEntity // #define FN_RemoveEntity RemoveEntity -#define FN_CreateNamedEntity CreateNamedEntity +// #define FN_CreateNamedEntity CreateNamedEntity // #define FN_MakeStatic MakeStatic // #define FN_EntIsOnFloor EntIsOnFloor // #define FN_DropToFloor DropToFloor @@ -252,7 +252,7 @@ // #define FN_LightStyle LightStyle // #define FN_DecalIndex DecalIndex // #define FN_PointContents PointContents -#define FN_MessageBegin MessageBegin +// #define FN_MessageBegin MessageBegin // #define FN_MessageEnd MessageEnd // #define FN_WriteByte WriteByte // #define FN_WriteChar WriteChar @@ -427,7 +427,7 @@ // #define FN_PEntityOfEntIndex_Post PEntityOfEntIndex_Post // #define FN_FindEntityByVars_Post FindEntityByVars_Post // #define FN_GetModelPtr_Post GetModelPtr_Post -// #define FN_RegUserMsg_Post RegUserMsg_Post +#define FN_RegUserMsg_Post OnRegUserMsg_Post // #define FN_AnimationAutomove_Post AnimationAutomove_Post // #define FN_GetBonePosition_Post GetBonePosition_Post // #define FN_FunctionFromName_Post FunctionFromName_Post diff --git a/modules/cstrike/cstrike/msvc12/cstrike.vcxproj b/modules/cstrike/cstrike/msvc12/cstrike.vcxproj index 98f84d2e..fd2f3fb9 100644 --- a/modules/cstrike/cstrike/msvc12/cstrike.vcxproj +++ b/modules/cstrike/cstrike/msvc12/cstrike.vcxproj @@ -144,11 +144,12 @@ - + + @@ -158,7 +159,9 @@ + + diff --git a/modules/cstrike/cstrike/msvc12/cstrike.vcxproj.filters b/modules/cstrike/cstrike/msvc12/cstrike.vcxproj.filters index be95ef31..1a91cf72 100644 --- a/modules/cstrike/cstrike/msvc12/cstrike.vcxproj.filters +++ b/modules/cstrike/cstrike/msvc12/cstrike.vcxproj.filters @@ -35,9 +35,6 @@ Source Files - - Source Files - Memtools @@ -59,6 +56,12 @@ Source Files + + Source Files + + + Source Files + @@ -88,6 +91,12 @@ Module SDK + + Header Files + + + Header Files + diff --git a/plugins/include/cstrike.inc b/plugins/include/cstrike.inc index f9642f03..9961b81b 100755 --- a/plugins/include/cstrike.inc +++ b/plugins/include/cstrike.inc @@ -127,13 +127,14 @@ enum #define CSI_SG552 CSW_SG552 #define CSI_AK47 CSW_AK47 #define CSI_P90 CSW_P90 -#define CSI_SHIELDGUN CSW_SHIELDGUN +#define CSI_SHIELDGUN CSW_SHIELDGUN // The real CS value, use CSI_SHELD instead. #define CSI_VEST CSW_VEST // Custom #define CSI_VESTHELM CSW_VESTHELM // Custom #define CSI_DEFUSER 33 // Custom #define CSI_NVGS 34 // Custom #define CSI_PRIAMMO 36 // Custom #define CSI_SECAMMO 37 // Custom +#define CSI_SHIELD 38 // Custom - The value passed by the forward, more convenient for plugins. /** * Returns client's deaths. @@ -152,21 +153,20 @@ native cs_get_user_deaths(index); * * @param index Client index * @param newdeaths New value to set + * @param scoreboard If true the scoreboard will be updated to reflect the new value. * * @noreturn * @error If the client index is not within the range of 1 to * MaxClients, or the client is not connected, an error * will be thrown. */ -native cs_set_user_deaths(index, newdeaths); +native cs_set_user_deaths(index, newdeaths, bool:scoreboard = true); /** * Returns index of the entity that a hostage is following. * * @note Hostages can theoretically follow any entity in the game, so the * returned entity index is not necessarily a client index. - * @note This native does not work on Condition Zero, which has a different - * hostage AI than other versions of Counter-Strike. * * @param index Hostage entity index * @@ -181,8 +181,6 @@ native cs_get_hostage_foll(index); * * @note Hostages can theoretically follow any entity in the game, so the * followedindex does not have to be a client index. - * @note This native does not work on Condition Zero, which has a different - * hostage AI than other versions of Counter-Strike. * * @param index Hostage entity index * @param followedindex New entity to follow @@ -344,16 +342,21 @@ native cs_get_user_model(index, model[], len); * @note This is not a one-time set. The CStrike module will remember the * selected model and try to prevent attempts at changing the player * model, or immediately re-apply it if necessary. + * @note Updating modelindex is useful for custom models which don't have + * the same structure as the default ones (hitbox, etc..). Model must + * be precached before. * - * @param index Client index - * @param model Model name + * @param index Client index + * @param model Model name + * @param update_index If true, the modelindex is updated as well * * @noreturn - * @error If the client index is not within the range of 1 to - * MaxClients, or the client is not connected, an error will be - * thrown. + * @error If the client index is not within the range of 1 to + * MaxClients, the client is not connected, the provided + * model is empty, or if modeindex is updated and the + * provided model is not precached, an error will be thrown. */ -native cs_set_user_model(index, const model[]); +native cs_set_user_model(index, const model[], bool:update_index = false); /** * Resets the client's model. @@ -468,17 +471,17 @@ native cs_set_user_plant(index, plant = 1, showbombicon = 1); * @note For a list of valid team ids see the CsTeams enum, and for a list of * valid internal model ids see the CsInternalModel enum. * - * @param index Client index - * @param team Team id - * @param model Internal model id, if CS_DONTCHANGE the game will choose the - * model + * @param index Client index + * @param team Team id + * @param model Internal model id, if CS_DONTCHANGE the game will choose the model + * @param send_teaminfo If true, a TeamInfo message will be sent * * @noreturn * @error If the client index is not within the range of 1 to * MaxClients, or the client is not connected, an error will be * thrown. */ -native cs_set_user_team(index, any:team, any:model = CS_DONTCHANGE); +native cs_set_user_team(index, any:team, any:model = CS_DONTCHANGE, bool:send_teaminfo = true); /** * Returns the client's team and optionally the model id. @@ -574,7 +577,8 @@ native cs_set_user_tked(index, tk = 1, subtract = 1); * * @return 0 if the client is not driving, 1 if driving a vehicle but * not moving, 2 to 4 if driving positive speeds, 5 if - * driving at a negative speed (backing) + * driving at a negative speed (backing), see TRAIN_* constants + * in hlsdk_const.inc * @error If the client index is not within the range of 1 to * MaxClients, or the client is not connected, an error will be * thrown. @@ -618,7 +622,7 @@ native cs_get_user_stationary(index); * MaxClients, or the client is not connected, an error * will be thrown. */ -native cs_get_user_armor(index, &CsArmorType:armortype); +native cs_get_user_armor(index, &CsArmorType:armortype = CS_ARMOR_NONE); /** * Sets the client's armor value the type of armor. @@ -701,9 +705,12 @@ native cs_get_weapon_silen(index); * @param index Weapon entity index * @param silence If nonzero the weapon will be put into silenced * mode, otherwise the silenced mode will be removed - * @param draw_animation If nonzero and the weapon is currently held by a + * @param draw_animation If 1 and the weapon is currently held by a * client, the appropriate weapon animation will be * played + * If 2, same as 1 but follows game behavior by playing + * the associated player's model sequence and disallowing + * firing while animation is playing. * * @return 1 if silenced mode set successfully, 0 if entity is * not an applicable weapon @@ -811,12 +818,14 @@ native cs_user_spawn(player); * CSW_SG552, CSW_AK47, CSW_P90 * * @param index Armoury entity index + * @param count Optional variable to store in the number of times that an item can be retrieved + * from the same entity before being hidden * * @return Weapon id * @error If a non-armoury entity is provided, an error will be * thrown. */ -native cs_get_armoury_type(index); +native cs_get_armoury_type(index, &count = 1); /** * Sets the amoury entity type. @@ -828,15 +837,19 @@ native cs_get_armoury_type(index); * CSW_TMP, CSW_G3SG1, CSW_VEST, CSW_VESTHELM, CSW_FLASHBANG, * CSW_SG552, CSW_AK47, CSW_P90 * @note This does not update the entity model. + * @note On restart, entity is always unhidden and the count is restored (this can not be below 1). * * @param index Armoury entity index * @param type Weapon id - * + * @param count Number of times that an item can be retrieved from + * the same entity before being hidden + * If zero, the entity is hidden + * If below zero, nothing is set * @noreturn * @error If a non-armoury entity is provided, an error will be * thrown. */ -native cs_set_armoury_type(index, type); +native cs_set_armoury_type(index, type, count = -1); /** * Returns the map zones the client is inside of as a bitflag value. @@ -1032,7 +1045,7 @@ native Float:cs_get_hostage_nextuse(index); native cs_set_hostage_nextuse(index, Float:value); /** - * Returns the time the bomb will explode. + * Returns the game time at which the bomb will explode. * * @param index C4 entity * @@ -1043,7 +1056,7 @@ native cs_set_hostage_nextuse(index, Float:value); native Float:cs_get_c4_explode_time(index); /** - * Sets the time the bomb will explode. + * Sets the game time at which the bomb will explode. * * @param index C4 entity * @param value New explosion time diff --git a/plugins/include/hlsdk_const.inc b/plugins/include/hlsdk_const.inc index 4cf20d4b..c463e9b6 100644 --- a/plugins/include/hlsdk_const.inc +++ b/plugins/include/hlsdk_const.inc @@ -613,6 +613,19 @@ * @endsection */ +/** + * Train status values + */ +#define TRAIN_ACTIVE 0x80 +#define TRAIN_NEW 0xc0 + +#define TRAIN_OFF 0x00 +#define TRAIN_NEUTRAL 0x01 +#define TRAIN_SLOW 0x02 +#define TRAIN_MEDIUM 0x03 +#define TRAIN_FAST 0x04 +#define TRAIN_BACK 0x05 + /** * Valve Mod Weapon Constants */ diff --git a/public/engine_strucs.h b/public/engine_strucs.h new file mode 100644 index 00000000..3191e7d0 --- /dev/null +++ b/public/engine_strucs.h @@ -0,0 +1,512 @@ +// +// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO"). +// Copyright (C) The AMX Mod X Development Team. +// +// This software is licensed under the GNU General Public License, version 3 or higher. +// Additional exceptions apply. For full license details, see LICENSE.txt or visit: +// https://alliedmods.net/amxmodx-license + +#ifndef _ENGINE_STRUCTS_H_ +#define _ENGINE_STRUCTS_H_ + +#include +#include +#include +#include +#include +#include + +#define MAX_CLIENTS 32 +#define MAX_EDICTS 900 +#define MAX_NAME 32 +#define MAX_LIGHTSTYLES 64 +#define MAX_PACKET_ENTITIES 256 + +#define MAX_LATENT 32 +#define FRAGMENT_SIZE 1400 +#define MAX_FRAGMENTS 25000 +#define MAX_EVENT_QUEUE 64 + +#define MAX_FLOWS 2 +#define FLOW_OUTGOING 0 +#define FLOW_INCOMING 1 + +#define MAX_KV_LEN 127 // Max key/value length (with a NULL char) +#define MAX_INFO_STRING 256 // Key + value + 2 x slash + NULL +#define INFO_MAX_BUFFER_VALUES 4 + +#define FEVENT_ORIGIN (1<<0) // Event was invoked with stated origin +#define FEVENT_ANGLES (1<<1) // Event was invoked with stated angles + +#define HL_MODEL_MAX 512 +#define HL_GENERIC_MAX 512 +#define HL_EVENT_MAX 256 +#define HL_SOUND_MAX 512 +#define HL_SOUND_HASHLOOKUP_SIZE (HL_SOUND_MAX * 2 - 1) + +// Authentication types +#define AUTH_IDTYPE_UNKNOWN 0 +#define AUTH_IDTYPE_STEAM 1 +#define AUTH_IDTYPE_VALVE 2 +#define AUTH_IDTYPE_LOCAL 3 + +#define NUM_BASELINES 64 + +// 0 == regular, 1 == file stream +#define MAX_STREAMS 2 + +// Flow control bytes per second limits +#define MAX_RATE 20000 +#define MIN_RATE 1000 + +// Default data rate +#define DEFAULT_RATE (9999.0f) + +// This is the packet payload without any header bytes (which are attached for actual sending) +#define NET_MAX_PAYLOAD 3990 + +typedef enum netsrc_s +{ + NS_CLIENT, + NS_SERVER, + NS_MULTICAST + +} netsrc_t; + +typedef enum server_state_e +{ + ss_dead = 0, + ss_loading = 1, + ss_active = 2, + +} server_state_t; + +typedef enum +{ + NA_UNUSED, + NA_LOOPBACK, + NA_BROADCAST, + NA_IP, + NA_IPX, + NA_BROADCAST_IPX, + +} netadrtype_t; + +typedef struct netadr_s +{ + netadrtype_t type; + unsigned char ip[4]; + unsigned char ipx[10]; + unsigned short port; + +} netadr_t; + +typedef struct sizebuf_s +{ + const char* buffername; + uint16 flags; + byte* data; + int maxsize; + int cursize; + +} sizebuf_t; + +typedef struct flowstats_s +{ + int size; // Size of message sent/received + double time; // Time that message was sent/received + +} flowstats_t; + +typedef struct flow_s +{ + + flowstats_t stats[MAX_LATENT]; // Data for last MAX_LATENT messages + int current; // Current message position + double nextcompute; // Time when we should recompute k/sec data + float kbytespersec; // Average data + float avgkbytespersec; + +} flow_t; + +typedef struct fragbuf_s +{ + + fragbuf_s* next; // Next buffer in chain + int bufferid; // Id of this buffer + + sizebuf_t frag_message; // Message buffer where raw data is stored + byte frag_message_buf[FRAGMENT_SIZE]; // The actual data sits here + + qboolean isfile; // Is this a file buffer? + qboolean isbuffer; // Is this file buffer from memory ( custom decal, etc. ). + qboolean iscompressed; + + char filename[MAX_PATH]; // Name of the file to save out on remote host + int foffset; // Offset in file from which to read data + int size; // Size of data to read at that offset + +} fragbuf_t; + +typedef struct fragbufwaiting_s +{ + fragbufwaiting_s* next; // Next chain in waiting list + int fragbufcount; // Number of buffers in this chain + fragbuf_t* fragbufs; // The actual buffers + +} fragbufwaiting_t; + +typedef struct netchan_s +{ + netsrc_t sock; // NS_SERVER or NS_CLIENT, depending on channel. + netadr_t remote_address; // Address this channel is talking to. + + int player_slot; + + float last_received; // For timeouts. Time last message was received. + float connect_time; // Time when channel was connected. + + double rate; // Bandwidth choke, Bytes per second + double cleartime; // If realtime > cleartime, free to send next packet + + // Sequencing variables + int incoming_sequence; // Increasing count of sequence numbers + int incoming_acknowledged; // # of last outgoing message that has been ack'd. + int incoming_reliable_acknowledged;// Toggles T/F as reliable messages are received. + int incoming_reliable_sequence; // single bit, maintained local + int outgoing_sequence; // Message we are sending to remote + int reliable_sequence; // Whether the message contains reliable payload, single bit + int last_reliable_sequence; // Outgoing sequence number of last send that had reliable data + + void* connection_status; + int (*pfnNetchan_Blocksize)(void *); + + sizebuf_t message; // Staging and holding areas + byte message_buf[NET_MAX_PAYLOAD]; + + + int reliable_length; // Reliable message buffer. We keep adding to it until reliable is acknowledged. Then we clear it. + byte reliable_buf[NET_MAX_PAYLOAD]; + + fragbufwaiting_t* waitlist[MAX_STREAMS]; // Waiting list of buffered fragments to go onto queue. Multiple outgoing buffers can be queued in succession. + + int reliable_fragment[MAX_STREAMS]; // Is reliable waiting buf a fragment? + unsigned int reliable_fragid[MAX_STREAMS]; // Buffer id for each waiting fragment + + + fragbuf_t* fragbufs[MAX_STREAMS]; // The current fragment being set + int fragbufcount[MAX_STREAMS]; // The total number of fragments in this stream + + short int frag_startpos[MAX_STREAMS]; // Position in outgoing buffer where frag data starts + short int frag_length[MAX_STREAMS]; // Length of frag data in the buffer + + fragbuf_t* incomingbufs[MAX_STREAMS]; // Incoming fragments are stored here + qboolean incomingready[MAX_STREAMS]; // Set to true when incoming data is ready + + char incomingfilename[MAX_PATH]; // Only referenced by the FRAG_FILE_STREAM component + // Name of file being downloaded + void* tempbuffer; + int tempbuffersize; + + flow_t flow[MAX_FLOWS]; // Incoming and outgoing flow metrics + +} netchan_t; + +typedef struct packet_entities_s +{ + int num_entities; + unsigned char flags[32]; + entity_state_t* entities; + +} packet_entities_t; + + +typedef struct client_frame_s +{ + double senttime; + float ping_time; + clientdata_t clientdata; + weapon_data_t weapondata[64]; + packet_entities_t entities; + +} client_frame_t; + +typedef struct event_args_s +{ + int flags; + + int entindex; // Transmitted + + float origin[3]; + float angles[3]; + float velocity[3]; + + int ducking; + + float fparam1; + float fparam2; + + int iparam1; + int iparam2; + + int bparam1; + int bparam2; + +} event_args_t; + +struct event_info_s +{ + unsigned short index; // 0 implies not in use + + short packet_index; // Use data from state info for entity in delta_packet . -1 implies separate info based on event + short entity_index; // The edict this event is associated with + + float fire_time; // if non-zero, the time when the event should be fired ( fixed up on the client ) + + event_args_t args; + int flags; // Client only - Reliable or not, etc. +}; + +typedef struct event_state_s +{ + struct event_info_s ei[MAX_EVENT_QUEUE]; + +} event_state_t; + +typedef struct USERID_s +{ + int idtype; + uint64 m_SteamID; + unsigned int clientip; + +} USERID_t; + +typedef struct consistency_s +{ + char* filename; + int issound; + int orig_index; + int value; + int check_type; + float mins[3]; + float maxs[3]; + +} consistency_t; + +typedef struct event_s +{ + unsigned short index; + const char* filename; + int filesize; + const char* pszScript; + +} event_t; + +typedef struct extra_baselines_s +{ + int number; + int classname[NUM_BASELINES]; + entity_state_t baseline[NUM_BASELINES]; +} extra_baselines_t; + +typedef struct server_log_s +{ + qboolean active; + qboolean net_log_; + netadr_t net_address_; + void* file; + +} server_log_t; + +typedef struct server_stats_s +{ + int num_samples; + + int at_capacity; + int at_empty; + + float capacity_percent; + float empty_percent; + + int minusers; + int maxusers; + + float cumulative_occupancy; + float occupancy; + + int num_sessions; + float cumulative_sessiontime; + float average_session_len; + + float cumulative_latency; + float average_latency; + +} server_stats_t; + +typedef struct server_static_s +{ + qboolean dll_initialized; + + struct client_s* clients; + int maxclients; + int maxclientslimit; + + int spawncount; + int serverflags; + + server_log_t log; + + double next_cleartime; + double next_sampletime; + + server_stats_t stats; + qboolean isSecure; + +} server_static_t; + +typedef struct server_s +{ + qboolean active; + qboolean paused; + qboolean loadgame; + + double time; + double oldtime; + + int lastcheck; + double lastchecktime; + + char name[64]; + char oldname[64]; + char startspot[64]; + char modelname[64]; + + struct model_s* worldmodel; + CRC32_t worldmapCRC; + + unsigned char clientdllmd5[16]; + + resource_t resourcelist[1280]; + int num_resources; + + consistency_t consistency_list[512]; + int num_consistency; + + const char* model_precache[HL_MODEL_MAX]; + struct model_s* models[HL_MODEL_MAX]; + unsigned char model_precache_flags[HL_MODEL_MAX]; + struct event_s event_precache[HL_EVENT_MAX]; + + const char* sound_precache[HL_SOUND_MAX]; + short int sound_precache_hashedlookup[HL_SOUND_HASHLOOKUP_SIZE]; + qboolean sound_precache_hashedlookup_built; + + const char* generic_precache[HL_GENERIC_MAX]; + char generic_precache_names[HL_GENERIC_MAX][64]; + int num_generic_names; + + char* lightstyles[MAX_LIGHTSTYLES]; + + int num_edicts; + int max_edicts; + edict_t* edicts; + + struct entity_state_s* baselines; + extra_baselines_t* instance_baselines; + server_state_t state; + + sizebuf_t datagram; + unsigned char datagram_buf[4000]; + + sizebuf_t reliable_datagram; + unsigned char reliable_datagram_buf[4000]; + + sizebuf_t multicast; + unsigned char multicast_buf[1024]; + + sizebuf_t spectator; + unsigned char spectator_buf[1024]; + + sizebuf_t signon; + unsigned char signon_data[32768]; + +} server_t; + +typedef struct client_s +{ + qboolean active; + qboolean spawned; + qboolean fully_connected; + qboolean connected; + qboolean uploading; + qboolean hasusrmsgs; + qboolean has_force_unmodified; + + netchan_t netchan; + + int chokecount; + int delta_sequence; + + qboolean fakeclient; + qboolean proxy; + usercmd_t lastcmd; + + double connecttime; + double cmdtime; + double ignorecmdtime; + + float latency; + float packet_loss; + + double localtime; + double nextping; + double svtimebase; + + sizebuf_t datagram; + byte datagram_buf[4000]; + + double connection_started; + double next_messagetime; + double next_messageinterval; + qboolean send_message; + qboolean skip_message; + + client_frame_t* frames; + event_state_t events; + edict_t* edict; + const edict_t* pViewEntity; + int userid; + USERID_t network_userid; + + char userinfo[MAX_INFO_STRING]; + + qboolean sendinfo; + float sendinfo_time; + + char hashedcdkey[64]; + char name[32]; + int topcolor; + int bottomcolor; + int entityId; + + resource_t resourcesonhand; + resource_t resourcesneeded; + + FileHandle_t upload; + qboolean uploaddoneregistering; + customization_t customdata; + + int crcValue; + int lw; + int lc; + + char physinfo[MAX_INFO_STRING]; + + qboolean m_bLoopback; + uint32 m_VoiceStreams[2]; + double m_lastvoicetime; + int m_sendrescount; + +} client_t; + +#endif //_ENGINE_STRUCTS_H_ diff --git a/public/sdk/amxxmodule.cpp b/public/sdk/amxxmodule.cpp index ea4049b0..7528f376 100644 --- a/public/sdk/amxxmodule.cpp +++ b/public/sdk/amxxmodule.cpp @@ -3151,3 +3151,27 @@ size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...) return len; } } + +template unsigned int strncopy(char *, const char *src, size_t count); +template unsigned int strncopy(cell *, const char *src, size_t count); +template unsigned int strncopy(cell *, const cell *src, size_t count); + +template +unsigned int strncopy(D *dest, const S *src, size_t count) +{ + if (!count) + { + return 0; + } + + D *start = dest; + + while ((*src) && (--count)) + { + *dest++ = *(unsigned char*)src++; + } + + *dest = '\0'; + + return (dest - start); +} diff --git a/public/sdk/amxxmodule.h b/public/sdk/amxxmodule.h index c9f9e75f..adf081e9 100644 --- a/public/sdk/amxxmodule.h +++ b/public/sdk/amxxmodule.h @@ -2509,5 +2509,6 @@ void Mem_Deallocator(const char *sourceFile, const unsigned int sourceLine, cons #endif //MEMORY_TEST size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...); +template unsigned int strncopy(D *dest, const S *src, size_t count); #endif // #ifndef __AMXXMODULE_H__ diff --git a/support/PackageScript b/support/PackageScript index 692c043b..92e6ad5c 100644 --- a/support/PackageScript +++ b/support/PackageScript @@ -17,6 +17,11 @@ folder_list = [ 'base/addons/amxmodx', 'base/addons/amxmodx/configs', 'base/addons/amxmodx/data', + 'base/addons/amxmodx/data/gamedata', + 'base/addons/amxmodx/data/gamedata/common.games', + 'base/addons/amxmodx/data/gamedata/common.games/entities.games', + 'base/addons/amxmodx/data/gamedata/common.games/entities.games/cstrike', + 'base/addons/amxmodx/data/gamedata/modules.games', 'base/addons/amxmodx/data/lang', 'base/addons/amxmodx/dlls', 'base/addons/amxmodx/logs', @@ -74,6 +79,15 @@ for folder in folder_list: norm_folder = os.path.normpath(folder) folder_map[folder] = builder.AddFolder(norm_folder) +# Do all straight-up file copies from the source tree. +def CopyFiles(src, dest, files): + if not dest: + dest = src + dest_entry = folder_map[dest] + for source_file in files: + source_path = os.path.join(builder.sourcePath, src, source_file) + builder.AddCopy(source_path, dest_entry) + # Copy core dlls. for dll in AMXX.binaries: copy_binary(dll, folder_map['base/addons/amxmodx/dlls']) @@ -366,6 +380,136 @@ for datafile in datafiles: source = os.path.join(builder.sourcePath, 'plugins', 'lang', datafile), output_path = folder_map['base/addons/amxmodx/data/lang'] ) + + +CopyFiles('gamedata/modules.games', 'base/addons/amxmodx/data/gamedata/modules.games', + [ + 'master.games.txt', + 'game.cstrike.txt', + ] +) +CopyFiles('gamedata/common.games', 'base/addons/amxmodx/data/gamedata/common.games', + [ + 'master.games.txt', + 'globalvars.engine.txt', + ] +) + +CopyFiles('gamedata/common.games/entities.games/cstrike', 'base/addons/amxmodx/data/gamedata/common.games/entities.games/cstrike', + [ + 'offsets-cairtank.txt', + 'offsets-cbaseanimating.txt', + 'offsets-cpendulum.txt', + 'offsets-cfuncrotating.txt', + 'offsets-cbasebutton.txt', + 'offsets-cenvspark.txt', + 'offsets-cmomentaryrotbutton.txt', + 'offsets-cmultisource.txt', + 'offsets-cenvglobal.txt', + 'offsets-cbaseentity.txt', + 'offsets-cunifiedsignals.txt', + 'offsets-csound.txt', + 'offsets-simplestatemachine.txt', + 'offsets-chostagemanager.txt', + 'offsets-cgib.txt', + 'offsets-cmomentarydoor.txt', + 'offsets-cbasedoor.txt', + 'offsets-cenvfunnel.txt', + 'offsets-ctesteffect.txt', + 'offsets-cgibshooter.txt', + 'offsets-csprite.txt', + 'offsets-cbombglow.txt', + 'offsets-cglow.txt', + 'offsets-claser.txt', + 'offsets-clightning.txt', + 'offsets-cbubbling.txt', + 'offsets-cenvexplosion.txt', + 'offsets-cpushable.txt', + 'offsets-cbreakable.txt', + 'offsets-cfunctankcontrols.txt', + 'offsets-cfunctank.txt', + 'offsets-cfunctanklaser.txt', + 'offsets-cgrenade.txt', + 'offsets-crecharge.txt', + 'offsets-cwreckage.txt', + 'offsets-cweaponcycler.txt', + 'offsets-ccyclersprite.txt', + 'offsets-ccycler.txt', + 'offsets-cwallhealth.txt', + 'offsets-cworlditem.txt', + 'offsets-clight.txt', + 'offsets-cgameplayerequip.txt', + 'offsets-cgameplayerzone.txt', + 'offsets-cgameteammaster.txt', + 'offsets-cgametext.txt', + 'offsets-cruleentity.txt', + 'offsets-cmortar.txt', + 'offsets-cfuncmortarfield.txt', + 'offsets-cbasemonster.txt', + 'offsets-cmapinfo.txt', + 'offsets-cpathtrack.txt', + 'offsets-cpathcorner.txt', + 'offsets-cguntarget.txt', + 'offsets-cfunctrackchange.txt', + 'offsets-cfuncplatrot.txt', + 'offsets-cfunctracktrain.txt', + 'offsets-cfunctrain.txt', + 'offsets-cbaseplattrain.txt', + 'offsets-cplattrigger.txt', + 'offsets-cbaseplayer.txt', + 'offsets-crevertsaved.txt', + 'offsets-cdeadhev.txt', + 'offsets-cwshield.txt', + 'offsets-cspeaker.txt', + 'offsets-cenvsound.txt', + 'offsets-cambientgeneric.txt', + 'offsets-csoundent.txt', + 'offsets-cbasetoggle.txt', + 'offsets-cbasedelay.txt', + 'offsets-cpointentity.txt', + 'offsets-cfuncweaponcheck.txt', + 'offsets-cbasegrencatch.txt', + 'offsets-cclientfog.txt', + 'offsets-ctriggercamera.txt', + 'offsets-ctriggerchangetarget.txt', + 'offsets-ctriggerendsection.txt', + 'offsets-cchangelevel.txt', + 'offsets-cmultimanager.txt', + 'offsets-ctriggerrelay.txt', + 'offsets-cfrictionmodifier.txt', + 'offsets-cfuncvehicle.txt', + 'offsets-carmoury.txt', + 'offsets-cweaponbox.txt', + 'offsets-cbaseplayeritem.txt', + 'offsets-cbaseplayerammo.txt', + 'offsets-cbaseplayerweapon.txt', + 'offsets-caug.txt', + 'offsets-cawp.txt', + 'offsets-cdeagle.txt', + 'offsets-celite.txt', + 'offsets-cfiveseven.txt', + 'offsets-cflashbang.txt', + 'offsets-cg3sg1.txt', + 'offsets-cglock18.txt', + 'offsets-chegrenade.txt', + 'offsets-cknife.txt', + 'offsets-cm3.txt', + 'offsets-cmac10.txt', + 'offsets-cp228.txt', + 'offsets-cp90.txt', + 'offsets-cscout.txt', + 'offsets-csmokegrenade.txt', + 'offsets-ctmp.txt', + 'offsets-cusp.txt', + 'offsets-cfamas.txt', + 'offsets-cgalil.txt', + 'offsets-cxm1014.txt', + 'offsets-cvoicegamemgr.txt', + 'offsets-hostagefollowstate.txt', + 'offsets-chostage.txt', + 'offsets-chostageimprov.txt', + ] +) # Copy license files licenses = [