PDA

View Full Version : [Info] Counter-Strike pvPrivateData offsets


VEN
03-08-2008, 15:49
Alright. Here we go.

The current CS Class List (http://wiki.alliedmods.net/Category:CS_Class_List) attached to the Scripting section (http://wiki.alliedmods.net/Category:Scripting_(AMX_Mod_X)).

I know it's quite ugly the page name in the category page but I had to do that since there are already some pages for Source. If someome knows how to use piped link in this case, tell me.

As notes, I've not finished. There are few classes to add yet and others to complete like CBasePlayer.

I post here to know if you have some comments, suggestions or others while I'm still working on it.


EDIT : New links, will explain more anothe day.

http://forums.alliedmods.net/showthread.php?p=791658#post791658

Thanks to all contributors!

Arkshine
03-08-2008, 15:55
Oh ! Thanks for your sharing ! :)

ConnorMcLeod
03-08-2008, 15:56
Yeah, thanks a lot.

113 - alive player
238 - ( groundspeed ) -see next post

510 - USES_SHIELD (1<<16)

VEN
03-08-2008, 16:33
238 - groundspeedYeah i thought so as well but when shooting this value will be also changed.

ConnorMcLeod
03-08-2008, 18:57
What to do with cbase values ?
I've already found some of those you provided in first post (368-375) without being able to "convert" values :(

Styles
03-08-2008, 21:59
ahaha dude scripting is going to be all about Data offsets next.. It was FM now its going even more hardcore...

But nice ven +karma

VEN
03-09-2008, 05:33
What to do with cbase values ?Use [g|s]et_pdata_cbase[_safe] from HS module.

Example #1:new ent = get_pdata_cbase(id, 375)
if (pev_valid(ent) && get_pdata_int(ent, 43) == CSW_KNIFE)
engclient_cmd(id, "lastinv")

Example #2:if (get_pdata_cbase(ent, 375) == get_pdata_cbase(ent, 372))
set_pdata_cbase(ent, 375, get_pdata_cbase(ent, 370))

Alka
03-09-2008, 14:31
Oh, cool!Alot of useful things...

VEN
03-15-2008, 07:39
Updated "weapon_*" section: renamed iAmmoType into m_iPrimaryAmmoType, added m_pPlayer and m_fInReload.

You can review the use of m_flNextAttack, m_pPlayer and m_fInReload here: http://forums.alliedmods.net/showpost.php?p=597138&postcount=24

Cheap_Suit
04-19-2008, 03:56
219 - bIsPrimaryFireAllowed (note: disallow in prePlayerPostThink)

I need to block players from attacking. Does this also block clientside sounds and animations?

Alka
04-19-2008, 04:02
@Cheap_Suit - if that wont work, you can remove the attack button and trick enginge in FM_UpdateClientData forward with CD_flNextAttack...

ConnorMcLeod
04-19-2008, 04:51
@Cheap_Suit

You can also use :
83 - m_flNextAttack

Cheap_Suit
04-19-2008, 04:54
That offset I know doesnt block the clientside gunfire.

ConnorMcLeod
04-19-2008, 05:40
That offset I know doesnt block the clientside gunfire.

Yes it does :mrgreen:

Cheap_Suit
04-19-2008, 06:03
On a local server yes, but on a dedicated server it doesnt. (Experienced in a live server)

VEN
04-19-2008, 06:55
Does this also block clientside sounds and animations?IIRC, yes.

i saw some you used and are not hereFor example? (except animation offset which replicates the corresponding pev structure member).

ConnorMcLeod
04-19-2008, 08:15
For example : http://forums.alliedmods.net/showpost.php?p=401189&postcount=91

VEN
04-19-2008, 15:48
The offsets/values in that post are quite specialized and empirical. I can't guarantee that 96/114 grenade offsets holds an actual grenade type. It may be some different grenade data that game mod is use for different purposes. The fact that we can differentiate grenades with that method doesn't necessarily mean that we doing a direct grenade type check.

MPNumB
05-04-2008, 13:50
What's the iMenuCode _linuxdiff? 5?

ConnorMcLeod
05-04-2008, 15:54
It should be 5, as for all players offsets, but you should double check it ;)

XxAvalanchexX
08-02-2008, 22:40
Player offset 257 (Windows) = m_afPhysicsFlags

ConnorMcLeod
10-14-2008, 15:20
Feel free to add more (not from cstrike.h).
player
211 - fOriginX
212 - fOriginY
213 - fOriginZ
Those offset are updated with a ~1sec freq
offset 210 hold the fGameTime when those offsets are updated

119 - last say gametime


Weapons offsets (windows) (linuxdiff=4)

#define m_fKnown 44
#define m_flNextPrimaryAttack 46
#define m_flNextSecondaryAttack 47
#define m_flTimeWeaponIdle 48
50 m_iSecondaryAmmoType ?
#define m_iClientClip 52
#define m_iClientWeaponState 53
#define m_fInSpecialReload 55
#define b_IsSilent 74

63 flLastShotGameTime
76 flLastTakeInHandGameTime [in fact this is not true for primary weapons]

ConnorMcLeod
12-19-2008, 03:31
C4 WIN32 offsets :

#define flDefusedTime 99
#define m_flNextBeep 102
#define m_sBeepName 104
#define m_flNextBlink 106

jim_yang
12-25-2008, 00:10
#define OFFSET_TEAMMATEKILLS 127

jim_yang
12-25-2008, 21:46
player

88 - m_flFieldOfView
90 - m_HackedGunPos.x
91 - m_HackedGunPos.y
92 - m_HackedGunPos.z
237 - m_iPlayerSound
238 - m_iTargetVolume
239 - m_iWeaponVolume
240 - m_iExtraSoundTypes
241 - m_iWeaponFlash
242 - m_flStopExtraSoundTime
248 - m_pentSndLast //get_pdata_ent
249 - m_flSndRoomtype
250 - m_flSndRange
259 - m_flTimeStepSound
264 - m_flSuitUpdate
265 -> 268 - m_rgSuitPlayList[CSUITPLAYLIST]
269 - m_iSuitPlayNext
270 -> 301 - m_rgiSuitNoRepeat[CSUITNOREPEAT]
302 -> 333 - m_rgflSuitNoRepeatTime[CSUITNOREPEAT]
335 - m_tbdPrev
336 - m_flgeigerRange
337 - m_flgeigerDelay
338 - m_igeigerRangePrev
339 - m_iStepLeft
348 - m_fInitHUD
349 - m_fGameHUDInitialized
350 - m_iTrain
351 - m_fWeapon
354 - m_fDeadTime
355 - m_fNoPlayerSound
357 - m_tSneaking
358 - m_iUpdateTime
361 - m_iHideHUD
362 - m_iClientHideHUD
440 - m_vecAutoAim.x
441 - m_vecAutoAim.y
442 - m_vecAutoAim.z
443 - m_fOnTarget
449 - m_flNextSBarUpdateTime
450 - m_flStatusBarDisappearDelay
483 - m_lastx
484 - m_lasty
492 - m_szAnimExtention[32]


weapon_*

42 - m_pNext (cbase)
44 - m_iPlayEmptySound
45 - m_fFireOnEmpty
56 - m_iDefaultAmmo
57 - m_iShell //shell model index of awp, g3sg1, glock18, m3, scout, sg550, xm1014
68 - m_iViewModel
78 - m_iShell //shell model index, gun only
79 - m_flPumpTime


weaponbox

34 -> 39 m_rgpPlayerItems[MAX_ITEM_TYPES] (cbase) //MAX_ITEM_TYPES is 6
41 -> 72 m_rgiszAmmo[MAX_AMMO_SLOTS]
73 -> 84 m_rgAmmo[MAX_AMMO_SLOTS]
104 - m_cAmmoTypes

jim_yang
12-29-2008, 21:32
376 -> 407 - m_rgAmmo[MAX_AMMO_SLOTS]
408 -> 439 - m_rgAmmoLast[MAX_AMMO_SLOTS]
MAX_AMMO_SLOTS is 32

ConnorMcLeod
02-01-2009, 19:36
game_text

#define m_textParms_x 35
#define m_textParms_y 36
#define m_textParms_effect 37
#define m_textParms_color1 38
#define m_textParms_color2 39
#define m_textParms_fadeinTime 40
#define m_textParms_fadeoutTime 41
#define m_textParms_holdTime 42
#define m_textParms_fxTime 43
#define m_textParms_channel 44

For color1 and color2, formulas founded by arkshine :
stock Alloc_Color(r,g,b,a)
{
return (r + (g<<8) + (b<<16) + (a<<24))
}

stock Decode_Color(Color)
{
new aCol[4]
aCol[3] = Color / (256<<16)
Color %= (256<<16)
aCol[2] = Color / (256<<8)
Color %= (256<<8)
aCol[1] = Color / 256
aCol[0] = Color % 256
return aCol
}


example :
set_pdata_int(iEnt, m_textParms_color1, Alloc_Color(0,60,120,0), 4)
new Color[4]
Color = get_pdata_int(iEnt, m_textParms_color2, 4)

After quick tests, not sure that alpha has any effect.

Arkshine
02-01-2009, 20:12
Actually I would prefer something like ( no simplified formula, more readable/understable ) :


enum Color_e { red, green, blue, alpha };

stock AllocColor ( const r, const g, const b, const a )
{
// r × 256º + g × 256¹ + b × 256² + a × 256³
return ( r + g * 256 + b * ( 256 << 8 ) + a * ( 256 << 16 ) );
}

stock DecodeColor ( const i_DeciColor )
{
new Color_e:ai_Color[ Color_e ];

ai_Color[ red ] = ( i_DeciColor ) % 256;
ai_Color[ green ] = ( i_DeciColor / 256 ) % 256;
ai_Color[ blue ] = ( i_DeciColor / ( 256 << 8 ) ) % 256;
ai_Color[ alpha ] = ( i_DeciColor / ( 256 << 16 ) ) % 256;

return ai_Color;
}

jim_yang
02-02-2009, 02:23
func_rotating
34 - m_flFanFriction
35 - m_flAttenuation
36 - m_flVolume
37 - m_pitch
38 - m_sounds

func_pendulum

34 - m_accel
35 - m_distance
36 - m_time
37 - m_damp
38 - m_maxSpeed
39 - m_dampSpeed
40 - m_center
43 - m_start

env_bubbles

34 - m_density
35 - m_frequency
36 - m_bubbleModel
37 - m_state

env_lightning
env_beam

34 - m_active
35 - m_iszStartEntity
36 - m_iszEndEntity
37 - m_life
38 - m_boltWidth
39 - m_noiseAmplitude
40 - m_brightness
41 - m_speed
42 - m_restrike
43 - m_spriteTexture
44 - m_iszSpriteName
45 - m_frameStart
46 - m_radius

env_laser

34 - m_pSprite
35 - m_iszSpriteName
36 - m_firePosition.x
37 - m_firePosition.y
38 - m_firePosition.z

env_glow
env_sprite

34 - m_lastTime
35 - m_maxFrame

gibshooter
env_shooter

34 - m_flDelay
35 - m_iszKillTarget
36 - m_iGibs
37 - m_iGibCapacity
38 - m_iGibMaterial
39 - m_iGibModelIndex
40 - m_flGibVelocity
41 - m_flVariance
42 - m_flGibLife

light
light_spot
light_environment
34 - m_iStyle
35 - m_iszPattern

func_breakable

36 - m_Material
37 - m_Explosion
38 - m_idShard
39 - m_angle
40 - m_iszGibModel
41 - m_iszSpawnObject

env_global

34 - m_globalstate
35 - m_triggermode
36 - m_initialstate

multisource

34 -> 96 - m_rgEntities[MS_MAX_TARGETS]
98 -> 129 - m_rgTriggered[MS_MAX_TARGETS]
130 - m_iTotal
131 - m_globalstate
MS_MAX_TARGETS is 32

func_tank

34 - m_pController (cbase)
35 - m_flNextAttack
36 - m_vecControllerUsePos.x
37 - m_vecControllerUsePos.y
38 - m_vecControllerUsePos.z
39 - m_yawCenter
40 - m_yawRate
41 - m_yawRange
42 - m_yawTolerance
43 - m_pitchCenter
44 - m_pitchRate
45 - m_pitchRange
46 - m_pitchTolerance
47 - m_fireLast
48 - m_fireRate
49 - m_lastSightTime
50 - m_persist
51 - m_minRange
52 - m_maxRange
53 - m_barrelPos.x
54 - m_barrelPos.y
55 - m_barrelPos.z
56 - m_spriteScale
57 - m_iszSpriteSmoke
58 - m_iszSpriteFlash
59 - m_bulletType
60 - m_iBulletDamage
61 - m_sightOrigin.x
62 - m_sightOrigin.y
63 - m_sightOrigin.z
64 - m_spread
65 - m_iszMaster

func_tanklaser

66 - m_pLaser (cbase)
67 - m_laserTime

func_tankcontrols

34 - m_pTank (cbase)

func_train

79 - m_pevCurrentTarget
80 - m_sounds
81 - m_activated

env_spark
env_debris

34 - m_flDelay

trigger_auto

36 - m_globalstate
37 - triggerType

trigger_relay

36 - triggerType

multi_manager

73 - m_cTargets
74 - m_index
75 - m_startTime
76 -> 91 - m_iTargetName[MAX_MULTI_TARGETS]
92 -> 107 - m_flTargetDelay[MAX_MULTI_TARGETS]

trigger_changelevel

73 - m_szMapName //32 chars
81 - m_szLandmarkName //8 chars
89 - m_changeTarget
90 - m_changeTargetDelay

trigger_camera

36 - m_hPlayer
38 - m_hTarget
40 - m_pentPath
41 - m_sPath
42 - m_flWait
43 - m_flReturnTime
44 - m_flStopTime
45 - m_moveDistance
46 - m_targetSpeed
47 - m_initialSpeed
48 - m_acceleration
49 - m_deceleration
50 - m_state

Arkshine
02-02-2009, 13:34
player :

11 - m_cAmmoLoaded[ ammo_buckshot ]
13 - m_cAmmoLoaded[ ammo_9mm ]
15 - m_cAmmoLoaded[ ammo_556nato ]
17 - m_cAmmoLoaded[ ammo_556natobox]
19 - m_cAmmoLoaded[ ammo_762nato ]
21 - m_cAmmoLoaded[ ammo_45acp ]
23 - m_cAmmoLoaded[ ammo_50ae ]
25 - m_cAmmoLoaded[ ammo_338magnum ]
27 - m_cAmmoLoaded[ ammo_57mm ]
29 - m_cAmmoLoaded[ ammo_357sig ]

73 - m_Activity
74 - m_IdealActivity


speaker :

34 - m_preset


env_sound :

34 - m_flRadius
35 - m_flRoomtype


func_friction :

34 - m_frictionFraction


func_healthcharger :

73 - m_flNextCharge
74 - m_iReactivate
75 - m_iJuice
76 - m_iOn
77 - m_flSoundTime


func_tracktrain :

34 - m_ppath
35 - m_length
36 - m_height
37 - m_speed
38 - m_dir
39 - m_startSpeed
40 - m_controlMins.x
41 - m_controlMins.y
42 - m_controlMins.z
43 - m_controlMaxs.x
44 - m_controlMaxs.y
45 - m_controlMaxs.z
46 - m_soundPlaying
47 - m_sounds
48 - m_flVolume
49 - m_flBank
50 - m_oldSpeed

ConnorMcLeod
02-02-2009, 14:41
ambient_sound

34 - m_flAttenuation
35 - m_dpv.preset
36 - m_dpv.pitchrun
37 - m_dpv.pitchstart
38 - m_dpv.spinup
39 - m_dpv.spindown
40 - m_dpv.volrun
41 - m_dpv.volstart
42 - m_dpv.fadein
43 - m_dpv.fadeout
44 - m_dpv.lfotype
45 - m_dpv.lforate
46 - m_dpv.lfomodpitch
47 - m_dpv.lfomodvol
48 - m_dpv.cspinup
49 - m_dpv.cspincount
50 - m_dpv.pitch
51 - m_dpv.spinupsav
52 - m_dpv.spindownsav
53 - m_dpv.pitchfrac
54 - m_dpv.vol
55 - m_dpv.fadeinsav
56 - m_dpv.fadeoutsav
57 - m_dpv.volfrac
58 - m_dpv.lfofrac
59 - m_dpv.lfomult

???
m_fActive
m_fLooping

jim_yang
02-02-2009, 23:32
ambient_sound
???
m_fActive - 60
m_fLooping - 61

Cheap_Suit
02-03-2009, 01:14
How do you guys find these offsets? If you have anything on grenades, let me know.

ConnorMcLeod
02-03-2009, 07:57
If it can hepls you, that's how i found ambien_generic offsets values :

Create a ambient_generic entity with specifi values that will be easy to identify later.
Then, dump all offsets values after Spawn forward.
At last, compare the dumped file with values i've set, look at HLSDK (dlls/sound.cpp) for offsets names.
/* Copyright © 2009, ConnorMcLeod

Ambien Generic Test is free software;
you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Ambien Generic Test; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define PLUGIN "Ambien Generic Test"
#define AUTHOR "ConnorMcLeod"
#define VERSION "0.0.1"

public plugin_precache()
{
register_plugin(PLUGIN, VERSION, AUTHOR)

RegisterHam(Ham_Spawn, "ambien_generic", "CAmbientGeneric_Spawn")

create_ambient()

}

stock create_ambient()
{
new iEnt

iEnt = engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString , "ambient_generic" ) )

set_pev(iEnt, pev_message, "ambience/lv_jubilee.wav")


SetKeyValue(iEnt, "preset", "0", "ambient_generic")

SetKeyValue(iEnt, "pitch", "95", "ambient_generic")
SetKeyValue(iEnt, "pitchstart", "91", "ambient_generic")
SetKeyValue(iEnt, "spinup", "13", "ambient_generic")
SetKeyValue(iEnt, "spindown", "17", "ambient_generic")

SetKeyValue(iEnt, "health", "9", "ambient_generic")
SetKeyValue(iEnt, "volstart", "8", "ambient_generic")
SetKeyValue(iEnt, "fadein", "24", "ambient_generic")
SetKeyValue(iEnt, "fadeout", "26", "ambient_generic")

SetKeyValue(iEnt, "lfotype", "3", "ambient_generic")
SetKeyValue(iEnt, "lforate", "777", "ambient_generic")

SetKeyValue(iEnt, "lfomodpitch", "71", "ambient_generic")
SetKeyValue(iEnt, "lfomodvol", "69", "ambient_generic")

SetKeyValue(iEnt, "cspinup", "4", "ambient_generic")

SetKeyValue(iEnt, "spawnflags", "32", "ambient_generic")



ExecuteHamB(Ham_Spawn, iEnt)
}

/*#define AMBIENT_SOUND_STATIC 0 // medium radius attenuation
#define AMBIENT_SOUND_EVERYWHERE 1
#define AMBIENT_SOUND_SMALLRADIUS 2
#define AMBIENT_SOUND_MEDIUMRADIUS 4
#define AMBIENT_SOUND_LARGERADIUS 8
#define AMBIENT_SOUND_START_SILENT 16
#define AMBIENT_SOUND_NOT_LOOPING 32*/

public CAmbientGeneric_Spawn( iEnt )
{
dump( iEnt )
}

dump( iEnt )
{
static logfile[192], fp
if(logfile[0] == 0)
{
new basedir[64], date[16]
get_localinfo("amxx_basedir", basedir, charsmax(basedir))
get_time("%m%d", date, charsmax(date))
formatex(logfile, charsmax(logfile), "%s/logs/CAmbientGeneric_%s.log", basedir, date)
}

fp = fopen(logfile, "a")

static Float:flTime ; flTime = get_gametime()

static szBuffer[64], iOffSet, iCbase, Float:flOffset, n, szOffset[128]
for(new i=0; i<=1024; i++)
{
n = 0
iOffSet = get_pdata_int(iEnt,i)
iCbase = get_pdata_cbase_safe(iEnt, i)
flOffset = get_pdata_float(iEnt,i)
get_pdata_string(iEnt, i, szOffset, 127, 1, 4)

n += formatex(szBuffer[n], charsmax(szBuffer)-n, "^nEnt(%d) #%i: ", iEnt, i)


if( iCbase > -1 )
{
n += formatex(szBuffer[n], charsmax(szBuffer)-n, "Cbase<%d>", iCbase)
}

n += formatex(szBuffer[n], charsmax(szBuffer)-n, "Int<%d>", iOffSet)

n += formatex(szBuffer[n], charsmax(szBuffer)-n, "Float<%f><%.3f>", flOffset, flTime)

n += formatex(szBuffer[n], charsmax(szBuffer)-n, "<%s>", szOffset)

fprintf(fp, szBuffer)
}
fclose(fp)
}

stock SetKeyValue(iEnt, const szKey[], const szValue[], const szClassName[])
{
set_kvd(0, KV_ClassName, szClassName)
set_kvd(0, KV_KeyName, szKey)
set_kvd(0, KV_Value, szValue)
set_kvd(0, KV_fHandled, 0)
dllfunc(DLLFunc_KeyValue, iEnt, 0)
}

jim_yang
02-03-2009, 23:11
CBaseDelay
34 - m_flDelay
35 - m_iszKillTarget
CBaseAnimating
36 - m_flFrameRate
37 - m_flGroundSpeed
38 - m_flLastEventCheck
39 - m_fSequenceFinished
40 - m_fSequenceLoops
CBaseToggle
41 - m_toggle_state
42 - m_flActivateFinished
43 - m_flMoveDistance
44 - m_flWait
45 - m_flLip
46 - m_flTWidth
47 - m_flTLength
48 - m_vecPosition1.x
49 - m_vecPosition1.y
50 - m_vecPosition1.z
51 - m_vecPosition2.x
52 - m_vecPosition2.y
53 - m_vecPosition2.z
54 - m_vecAngle1.x
55 - m_vecAngle1.y
56 - m_vecAngle1.z
57 - m_vecAngle2.x
58 - m_vecAngle2.y
59 - m_vecAngle2.z
60 - m_cTriggersLeft
61 - m_flHeight
62 - m_hActivator
64 - m_pfnCallWhenMoveDone
65 - m_vecFinalDest.x
66 - m_vecFinalDest.y
67 - m_vecFinalDest.z
68 - m_vecFinalAngle.x
69 - m_vecFinalAngle.y
70 - m_vecFinalAngle.z
71 - m_bitsDamageInflict
72 - m_sMaster
CBaseMonster
73 - m_Activity
74 - m_IdealActivity
75 - m_LastHitGroup
76 - m_bitsDamageType
77 - m_rgbTimeBasedDamage[CDMG_TIMEBASED]
79 - m_MonsterState
80 - m_IdealMonsterState
81 - m_afConditions
82 - m_afMemory
83 - m_flNextAttack
84 - m_hEnemy
86 - m_hTargetEnt
88 - m_flFieldOfView
89 - m_bloodColor
90 - m_HackedGunPos.x
91 - m_HackedGunPos.y
92 - m_HackedGunPos.z
93 - m_vecEnemyLKP.x
94 - m_vecEnemyLKP.y
95 - m_vecEnemyLKP.z

Arkshine
02-04-2009, 04:50
I was about to post some of them but you're the fastest. Good job. :mrgreen:

ConnorMcLeod
02-05-2009, 12:46
armoury_entity

34 - iItem


This is already implemented in cstrike module ;)

35 - iCount (number of items)

vittu
02-05-2009, 13:54
It's nice that you guys are all doing this, I as well as others do appreciate it, but it's kinda scattered all about. Wouldn't be easier to collaborate your efforts in the amwiki? It'd be easier to look/search thru and easier to maintain.

Arkshine
02-05-2009, 14:05
I've started to put all known offset together in a file ( excel ) and I can create a pdf ; but using the wiki would me convenient, indeed. Hope someone will start the page. :mrgreen:

YamiKaitou
02-05-2009, 14:49
PM me if you want a page created in the wiki for this. Just let me know where to create it and I will do it for you.

Exolent[jNr]
02-05-2009, 15:57
It's nice that you guys are all doing this, I as well as others do appreciate it...

I love their work, also.
I would try to, but I don't know what KeyValues to set and check for when testing certain entities.

EDIT:

The offsets/values in that post are quite specialized and empirical. I can't guarantee that 96/114 grenade offsets holds an actual grenade type. It may be some different grenade data that game mod is use for different purposes. The fact that we can differentiate grenades with that method doesn't necessarily mean that we doing a direct grenade type check.

What would be the most reliable way to get a grenade type?

Dores
02-05-2009, 16:57
Try checking out mapping sites for keyvalues.

Arkshine
02-05-2009, 19:49
For an entities list ; see : http://twhl.co.za/wiki.php?cat=1 ( Valve ERC Collective seems dead )

jim_yang
02-05-2009, 21:41
C4

105 - beep interval
110 - beep type

XxAvalanchexX
02-05-2009, 23:05
jim_yang: Is the interval a float or an int? Do you know what it's measured in? Also, what exactly is the beep type?

jim_yang
02-05-2009, 23:39
jim_yang: Is the interval a float or an int? Do you know what it's measured in? Also, what exactly is the beep type?
the interval is float
means the interval between c4 two beep sound
beep type is int, descripe the beep's interval length
sorry for my English

type - interval - soundname
0 - 1.5 - "weapons/c4_beep1.wav"
1 - 1.0 - "weapons/c4_beep2.wav"
2 - 0.8 - "weapons/c4_beep3.wav"
3 - 0.5 - "weapons/c4_beep4.wav"
4 - 0.2 - "weapons/c4_beep5.wav"

XxAvalanchexX
02-05-2009, 23:56
Cool, thanks!

And your English is very good. I always feel bad for anyone that has to learn it as a second language. Hang in there! ;)

Arkshine
02-06-2009, 06:52
About C4 , but some parts I'm not sure :


99 - m_flDefuseCountDown ?
100 - m_flC4Blow
101 - m_fAttenu
102 - m_flNextBeep
103 - m_flNextFreq
104 - m_sBeepName
105 - m_flNextFreqInterval
106 - m_flNextBlink
107 - m_flDefuseCountDown ?
108 - m_bJustBlew
109 - ?
110 - ? ( found like jim_yang but don't know the name )


Others names related to the class CGrenade :

m_bIsC4
m_bStartDefuse
m_pentCurBombTarget
m_SGSmoke
m_bLightSmoke
m_usEvent

ConnorMcLeod
02-07-2009, 09:46
"player"

m_rgItems
254 - item_antidote
255 - item_security

258 - m_fNextSuicideTime

Bugsy
02-11-2009, 00:57
Do you guys think it is safe to call get_pdata_int(victim, m_bitsDamageType) in a HamKilled forward. I am trying to detect how the victim was killed (DMG_BULLET, DMG_GRENADE, or DMG_SLASH). My overall objective is to block if the victim is killed by any means other than a primary\secondary weapon. In my tests, it does work but I want it to be 100% stable. If this isn't a good way to go I can just make a global variable and save the bitDamage from my HamTakeDamage forward and reset it on each roundstart. I would prefer the below method since my HamTakeDamage forward isn't enabled at the time I need the dmg info.

Using the below I get the following result, it works although not 100% accurate.

Kill with knife - returns dmg bullet
Kill with any gun - returns dmg bullet
Kill with grenade - returns dmg grenade


public fw_HamKilled(victim, killer, shouldgib)
{
if( !( 1 <= killer <= g_MaxPlayers ) )
return HAM_IGNORED

new i = get_pdata_int(victim , m_bitsDamageType)

if( i & DMG_BULLET )
client_print( 0 , print_chat, "dmg = bullet" )

if( i & DMG_GRENADE)
client_print( 0 , print_chat, "dmg = grenade" )

if( i & DMG_SLASH )
client_print( 0 , print_chat, "dmg = knife" )

Arkshine
02-11-2009, 03:20
Is the forward register as post ? Because if you look in the HLSDK, it works like that ( If I'm right ) :

- In CBasePlayer::TakeDamage, the damage bits is saved into a var. ( top for function )
- Next, CBaseMonster::TakeDamage is called, and you see damage bits are accumulated : "m_bitsDamageType |= bitsDamageType"
- Next, in CBasePlayer::UpdateClientData non-time-based damage is clear off ; "m_bitsDamageType &= DMG_TIMEBASED;"
- Then in CBasePlayer::TakeDamage, the original value is saved again : "m_bitsDamageType |= bitsDamageType;"

That's why I'm asking if you have register as post, it should work as post. Since you want to block, it's most likely than you will have to use a global var.

jim_yang
02-11-2009, 03:58
hostage_entity's useless offsets
106 -> 108 origin = pev->origin
109 -> 111 angle = pev->angle

Bugsy
02-11-2009, 10:17
Is the forward register as post ? Because if you look in the HLSDK, it works like that ( If I'm right ) :

- In CBasePlayer::TakeDamage, the damage bits is saved into a var. ( top for function )
- Next, CBaseMonster::TakeDamage is called, and you see damage bits are accumulated : "m_bitsDamageType |= bitsDamageType"
- Next, in CBasePlayer::UpdateClientData non-time-based damage is clear off ; "m_bitsDamageType &= DMG_TIMEBASED;"
- Then in CBasePlayer::TakeDamage, the original value is saved again : "m_bitsDamageType |= bitsDamageType;"

That's why I'm asking if you have register as post, it should work as post. Since you want to block, it's most likely than you will have to use a global var.

g_Ham_Killed_Player = RegisterHam( Ham_Killed ,"player" , "fw_HamKilled" )

I did look through the SDK but couldn't see where the bitsDamageType was reset. This is why I am reluctant to call if after the client died because I'm not sure if it is returning valid data just out of timing\luck. Or possibly bitsDamageType is not reset until spawn\round-start, which would be perfect. I will look through the SDK more today and try to figure it out. When I said block I didn't mean block the damage from happening; I want to block the code just in my function. (return HAM_IGNORED)

Arkshine
02-11-2009, 10:27
m_bitsDamageType is reset at spawn.

Bugsy
02-11-2009, 22:07
My next problem is that the bitdamage for knife and bullet damage is returning the same. If I print out the damagebits as an integer, it prints 4098 for both DMG_SLASH and DMG_BULLET.

According to hlsdk, this means the damage has flags DMG_ALWAYSGIB | DMG_BULLET for knife and bullet damage. This isn't a huge issue because I can always use get_user_weapon but I would rather not use an extra function.

#define DMG_BULLET (1<<1) // Shot
#define DMG_SLASH (1<<2) // Cut, clawed, stabbed
#define DMG_ALWAYSGIB (1<<13) // With this bit OR'd in, any damage type can be made to gib victims upon death.

DMG_ALWAYSGIB | DMG_BULLET = 0001 0000 0000 0010

This occurs both on the bitdamage returned in my ham_takedamage forward and with get_pdata_int( victim , m_bitsDamageType)

Also, can anyone explain what gib is?

Arkshine
02-12-2009, 02:32
4098 = DMG_NEVERGIB (4096) | DMG_BULLET (2)

Don't know why in cs Knife use DMG_BULLET too.

Gib = click here (http://www.urbandictionary.com/define.php?term=gib)

ConnorMcLeod
02-12-2009, 13:59
;756363']I don't know what KeyValues to set and check for when testing certain entities.

jim_yang
02-16-2009, 05:54
player

191 - game time a player can use the radio command again(need a good name)
192 - total times a player can use the radio command(need a good name)

jim_yang
02-20-2009, 00:37
already found by VEN and connor

210 - m_flNextRadarUpdateTime
211 -> 213 - m_vecLastPosition

update freq is 1 second
when time is up, compare player's current position to last position to decide whether send radar msg to clients for this player

PS:
update freq offset is 0xFC660(win32), data type is double

xPaw
02-20-2009, 14:11
i know here posting offsets, but anyone know keyvalus for env_rain?

ConnorMcLeod
02-20-2009, 15:08
origin, spawnflags

xPaw
02-21-2009, 03:02
what about type, quantity & sprite?

ConnorMcLeod
02-21-2009, 14:31
weapon_c4

78 - plant state ? : (1<<0) when planting, (1<<0)|(1<<8 ) when it's time to create the planted bomb
79 - planted time


player
cstrike.h :
#define OFFSET_NVGOGGLES 129
#define HAS_NVGOGGLES ( 1<<0 )

->
#define NVGOGGLES_ON ( 1<<8 )

ConnorMcLeod
03-01-2009, 10:01
game_player_equip

#define MAX_EQUIP 32
35 - 66 m_weaponNames[MAX_EQUIP] ( use glb_pStringBase to retrieve, EngFunc_AllocString to set )
67 - 98 m_weaponCount[MAX_EQUIP]


You can set it on the fly, but you have to spawn it during precache, unless you set the spawnflag SF_PLAYEREQUIP_USEONLY and you want that players get normal weapons.

Exolent[jNr]
03-01-2009, 13:51
What is the difference between EngFunc_SzFromIndex and glb_pStringBase ?

ConnorMcLeod
03-01-2009, 14:25
I really don't know.

new iVal = get_pdata_int(iEnt, 35, 4)
new szS[128]
engfunc(EngFunc_SzFromIndex, iVal, szS, charsmax(szS))
server_print(szS)
global_get(glb_pStringBase, iVal, szS, charsmax(szS))
server_print(szS)

This prints exactly the same.

Arkshine
03-01-2009, 14:38
HLSDK says that pStringBase should be used on constant string.
Also, It seems that SzFromIndex is not used. ( The macro is commented in favor of pStringBase )

ConnorMcLeod
03-02-2009, 15:04
player

100 - next gametime a button is usable to switch view/player in spec mode
raise it can prevent a player from using mouse1/2 and jump
lower it can allow player to use jump faster but no mouse1/2
default delay seems to be 0.20sec
useless oO

101 - spectated player CSW_ID
102 - spectated player has bomb
103 - spectated player has defuse kit
104 - spec view (4 when not spectator)

108 - fPainShock
109 ?? last curweapon zoomshot fov (scout & awp)
111 ?? last shot time (scout & awp)

-Edit-
offset 125 seems to be taken in account only when players are dead
-Edit-
125 - &( 1<<8 ):cant_changed_team_if_dead

198 - next fGameTime a player can be sent a HudTextArgs message

220 - fGametime of last weapon attack, including nade trhow and c4 start planting

ot_207
03-24-2009, 09:34
Are there offsets of weapon_ entities that offer the possibility to manipulate the reload time?

Ex: The ak47 reloads in 2 seconds is it possible to make it 1 second?

ConnorMcLeod
03-24-2009, 12:19
Are there offsets of weapon_ entities that offer the possibility to manipulate the reload time?

Ex: The ak47 reloads in 2 seconds is it possible to make it 1 second?

Search ? :mrgreen:
http://forums.alliedmods.net/showthread.php?p=782035#post782035
Don't know if it's possible to alter the animation though.


For instant reload, see http://forums.alliedmods.net/showthread.php?p=553846

ot_207
03-24-2009, 13:04
Search ? :mrgreen:
http://forums.alliedmods.net/showthread.php?p=782035#post782035
Don't know if it's possible to alter the animation though.


For instant reload, see http://forums.alliedmods.net/showthread.php?p=553846

Thanks a ton! +k for this.
I tried searching for this but didn't came up with anything.

VEN
03-25-2009, 11:26
Oh, hello. Of course wiki page should be created because for now we have a lot of offsets info. Someone please create it in AMWiki, thanks. And thanks to all for your contributions!

Arkshine
03-25-2009, 13:01
Hi VEN.

I'm working on it. I will give the link later here.

ot_207
03-25-2009, 14:24
Hi VEN.

I'm working on it. I will give the link later here.

Great idea! I also suggest adding the module offsets like cstrike for example. It would be very useful for all of us :).

Exolent[jNr]
03-25-2009, 16:16
http://forums.alliedmods.net/showthread.php?t=87574

Like the replies say, it's better to use the CStrike module, but those are the offsets for how to do it.

Arkshine
03-25-2009, 16:55
There are no reasons to not add them but I will add a note to tell that these offsets are used in the Cstrike module and better to use it.

vittu
03-25-2009, 23:53
Hi VEN.

I'm working on it. I will give the link later here.
You could probably follow a format similar to this Natural Selection one I came across:
http://zerot.nhlrebel.com/wiki/CBasePlayer
http://zerot.nhlrebel.com/wiki/Category:Offsets

Arkshine
03-26-2009, 05:47
Thanks for the suggestion!

Actually I was started to put all together with the class tree. The menu looks a bit weird and I was wondering how I should arrange that. I like and I will follow your suggestion.

Arkshine
03-28-2009, 19:10
Alright. Here we go.

The current CS Class List (http://wiki.alliedmods.net/Category:CS_Class_List) attached to the Scripting section (http://wiki.alliedmods.net/Category:Scripting_(AMX_Mod_X)).

I know it's quite ugly the page name in the category page but I had to do that since there are already some pages for Source. If someome knows how to use piped link in this case, tell me.

As notes, I've not finished. There are few classes to add yet and others to complete like CBasePlayer.

I post here to know if you have some comments, suggestions or others while I'm still working on it.


EDIT : New links, will explain more anothe day.

ConnorMcLeod
03-28-2009, 20:33
"weapon_*"

Nades only :

#define m_flLaunchedTime 30
#define m_flPinPulledOutTime 31 // translator for french verb tells me "to put the pin out"

Exolent[jNr]
03-28-2009, 20:58
@arkshine
Holy shit.. that's... good job!

AntiBots
03-28-2009, 21:53
Alright. Here we go.

The current CS offset list (http://wiki.alliedmods.net/Category:CS_Offset_List) attached to the Scripting section (http://wiki.alliedmods.net/Category:Scripting_%28AMX_Mod_X%29).

I know it's quite ugly the page name in the category page but I had to do that since there are already some pages for Source. If someome knows how to use piped link in this case, tell me.

As notes, I've not finished. There are few classes to add yet and others to complete like CBasePlayer.

I post here to know if you have some comments, suggestions or others while I'm still working on it.

Good Job.

Dores
03-28-2009, 23:50
Nice one, arkshine. :)

ot_207
03-29-2009, 03:57
Alright. Here we go.

The current CS offset list (http://wiki.alliedmods.net/Category:CS_Offset_List) attached to the Scripting section (http://wiki.alliedmods.net/Category:Scripting_(AMX_Mod_X)).

I know it's quite ugly the page name in the category page but I had to do that since there are already some pages for Source. If someome knows how to use piped link in this case, tell me.

As notes, I've not finished. There are few classes to add yet and others to complete like CBasePlayer.

I post here to know if you have some comments, suggestions or others while I'm still working on it.

Good! The Offset wikipedia is online!

xPaw
03-29-2009, 05:00
good job arkshine!

VEN
04-10-2009, 14:34
arkshine: very nice work, thank you!

jim_yang
06-23-2009, 06:02
OFFSET_SPECMODE 104

ConnorMcLeod
06-23-2009, 10:41
OFFSET_SPECMODE 104


Already found on #68 (http://forums.alliedmods.net/showpost.php?p=772510&postcount=68)

xPaw
07-05-2009, 14:25
someone found m_globalstate for func_button ?

EDIT:
41 - m_globalstate
Tested with Ham_Use
if( get_pdata_int( iEntity, BUTTON_GLOBAL_STATE ) != 1 )
return HAM_IGNORED;
So for me it seems right :mrgreen:

ConnorMcLeod
08-06-2009, 08:18
About c4, offset 105 seems to be the sound attenuation and not the beep interval.

xPaw
08-27-2009, 15:00
Someone found m_ls.sUnlockedSound ? (CBaseButton), in wiki its empty :(

ConnorMcLeod
08-27-2009, 17:25
Someone found m_ls.sUnlockedSound ? (CBaseButton), in wiki its empty :(

Try around 76

Arkshine
08-27-2009, 18:32
Someone found m_ls.sUnlockedSound ? (CBaseButton), in wiki its empty :(

I've updated a bit http://wiki.alliedmods.net/CBaseButton_(CS).

I'm almost sure for 73 -> 79 and 86. Others not sure.

So m_ls.sUnlockedSound is 78 here. ( tested )

Exolent[jNr]
08-27-2009, 23:13
About the m_ls.sUnlockedSound:
xPaw showed me some code about it, and it is the string allocated:
m_ls.sUnlockedSound = ALLOC_STRING(pszSound);
Therefore, the value is an integer. I don't know if it's the same as using EngFunc_AllocString, but shouldn't the string be retrieved with global_get( glb_pStringBase, ... ) ?

ConnorMcLeod
08-28-2009, 00:42
;914984']About the m_ls.sUnlockedSound:
xPaw showed me some code about it, and it is the string allocated:
m_ls.sUnlockedSound = ALLOC_STRING(pszSound);
Therefore, the value is an integer. I don't know if it's the same as using EngFunc_AllocString, but shouldn't the string be retrieved with global_get( glb_pStringBase, ... ) ?

Exactly, or also : eng_get_string(_string, _returnString[], _len)

Exolent[jNr]
08-28-2009, 01:36
Exactly, or also : eng_get_string(_string, _returnString[], _len)

I wasn't aware of that function. It isn't even in the funcwiki on amxmodx.org

xPaw
08-28-2009, 04:49
Its engine function.

/* Converts a string offset into a real string. Some of the forwards in fakemeta
uses string offsets. (FM_CreateNamedEntity) */
native eng_get_string(_string, _returnString[], _len);

ot_207
09-02-2009, 10:02
If it can hepls you, that's how i found ambien_generic offsets values :

Create a ambient_generic entity with specifi values that will be easy to identify later.
Then, dump all offsets values after Spawn forward.
At last, compare the dumped file with values i've set, look at HLSDK (dlls/sound.cpp) for offsets names.
/* Copyright © 2009, ConnorMcLeod

Ambien Generic Test is free software;
you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Ambien Generic Test; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/

#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define PLUGIN "Ambien Generic Test"
#define AUTHOR "ConnorMcLeod"
#define VERSION "0.0.1"

public plugin_precache()
{
register_plugin(PLUGIN, VERSION, AUTHOR)

RegisterHam(Ham_Spawn, "ambien_generic", "CAmbientGeneric_Spawn")

create_ambient()

}

stock create_ambient()
{
new iEnt

iEnt = engfunc( EngFunc_CreateNamedEntity, engfunc( EngFunc_AllocString , "ambient_generic" ) )

set_pev(iEnt, pev_message, "ambience/lv_jubilee.wav")


SetKeyValue(iEnt, "preset", "0", "ambient_generic")

SetKeyValue(iEnt, "pitch", "95", "ambient_generic")
SetKeyValue(iEnt, "pitchstart", "91", "ambient_generic")
SetKeyValue(iEnt, "spinup", "13", "ambient_generic")
SetKeyValue(iEnt, "spindown", "17", "ambient_generic")

SetKeyValue(iEnt, "health", "9", "ambient_generic")
SetKeyValue(iEnt, "volstart", "8", "ambient_generic")
SetKeyValue(iEnt, "fadein", "24", "ambient_generic")
SetKeyValue(iEnt, "fadeout", "26", "ambient_generic")

SetKeyValue(iEnt, "lfotype", "3", "ambient_generic")
SetKeyValue(iEnt, "lforate", "777", "ambient_generic")

SetKeyValue(iEnt, "lfomodpitch", "71", "ambient_generic")
SetKeyValue(iEnt, "lfomodvol", "69", "ambient_generic")

SetKeyValue(iEnt, "cspinup", "4", "ambient_generic")

SetKeyValue(iEnt, "spawnflags", "32", "ambient_generic")



ExecuteHamB(Ham_Spawn, iEnt)
}

/*#define AMBIENT_SOUND_STATIC 0 // medium radius attenuation
#define AMBIENT_SOUND_EVERYWHERE 1
#define AMBIENT_SOUND_SMALLRADIUS 2
#define AMBIENT_SOUND_MEDIUMRADIUS 4
#define AMBIENT_SOUND_LARGERADIUS 8
#define AMBIENT_SOUND_START_SILENT 16
#define AMBIENT_SOUND_NOT_LOOPING 32*/

public CAmbientGeneric_Spawn( iEnt )
{
dump( iEnt )
}

dump( iEnt )
{
static logfile[192], fp
if(logfile[0] == 0)
{
new basedir[64], date[16]
get_localinfo("amxx_basedir", basedir, charsmax(basedir))
get_time("%m%d", date, charsmax(date))
formatex(logfile, charsmax(logfile), "%s/logs/CAmbientGeneric_%s.log", basedir, date)
}

fp = fopen(logfile, "a")

static Float:flTime ; flTime = get_gametime()

static szBuffer[64], iOffSet, iCbase, Float:flOffset, n, szOffset[128]
for(new i=0; i<=1024; i++)
{
n = 0
iOffSet = get_pdata_int(iEnt,i)
iCbase = get_pdata_cbase_safe(iEnt, i)
flOffset = get_pdata_float(iEnt,i)
get_pdata_string(iEnt, i, szOffset, 127, 1, 4)

n += formatex(szBuffer[n], charsmax(szBuffer)-n, "^nEnt(%d) #%i: ", iEnt, i)


if( iCbase > -1 )
{
n += formatex(szBuffer[n], charsmax(szBuffer)-n, "Cbase<%d>", iCbase)
}

n += formatex(szBuffer[n], charsmax(szBuffer)-n, "Int<%d>", iOffSet)

n += formatex(szBuffer[n], charsmax(szBuffer)-n, "Float<%f><%.3f>", flOffset, flTime)

n += formatex(szBuffer[n], charsmax(szBuffer)-n, "<%s>", szOffset)

fprintf(fp, szBuffer)
}
fclose(fp)
}

stock SetKeyValue(iEnt, const szKey[], const szValue[], const szClassName[])
{
set_kvd(0, KV_ClassName, szClassName)
set_kvd(0, KV_KeyName, szKey)
set_kvd(0, KV_Value, szValue)
set_kvd(0, KV_fHandled, 0)
dllfunc(DLLFunc_KeyValue, iEnt, 0)
}

Connor, I have used this code to check the offsets of "grenade" entity but no luck. I did the proper modifications and when I throw a nade it basically crashes the server. Is there another method to find offsets?

Arkshine
09-02-2009, 10:15
Just do a dump of all offsets at the time you want on the grenade class.

ot_207
09-02-2009, 10:26
Just do a dump of all offsets at the time you want on the grenade class.

I did that by hooking with Ham_Spawn or with FM_SetModel. Will try more...

xPaw
09-09-2009, 12:20
env_explosion ( CEnvExplosion )

m_iMagnitude - 96
m_spriteScale - 97

ConnorMcLeod
09-09-2009, 12:30
I did that by hooking with Ham_Spawn or with FM_SetModel. Will try more...

If i remember well, nades are not already set @ spawn and at setmodel, if i remember well i tried to set dmgtime to gametime in those 2 forwards, result was nades explodes as flashbang nades for all kind of nades (see VEN's offset about nade types).

Arkshine
09-09-2009, 12:44
so 97 is probably m_spriteScale

xPaw
09-09-2009, 12:54
so 97 is probably m_spriteScale

Hm.. need to test, the result should be as this

float flSpriteScale;
flSpriteScale = ( m_iMagnitude - 50) * 0.6;

if ( flSpriteScale < 10 )
{
flSpriteScale = 10;
}

EDIT: Ok tested, yes its 97.

AntiBots
09-13-2009, 17:46
Ent speed is 58, 142?

Arkshine
09-13-2009, 17:52
"Ent speed" ?

AntiBots
09-13-2009, 17:58
"Ent speed" ?

Max Speed From an Ent.

ConnorMcLeod
09-14-2009, 01:05
pev_maxspeed ?

AntiBots
09-14-2009, 12:43
pev_maxspeed ?

Thanks, But I solved with an Array of Speed, Because I am want to get the speed from an ent. That Give X Weapon :D in Item deploy.

So I Get Weapon Number :D

Thanks.

I use v.maxpeed but no work. So I do:

int Func_VM_Item_Deploy_Player(Hook *hook, void *pthis)
{
int origret=0;

#if defined _WIN32
origret=reinterpret_cast<int (__fastcall*)(void*,int)>(hook->func)(pthis,0);
#elif defined __linux__
origret=reinterpret_cast<int (*)(void*)>(hook->func)(pthis);
#endif

static const char *WeaponRealNames[] = { "", "P228 Compact", "Shield", "Schmidt Scout", "He Grenade", "XM1014 M4", "C4",
"Ingram MAC-10", "Steyr AUG A1", "Smoke Grenade", "Dual Elite Berettas", "FiveseveN", "UMP 45", "SG-550 Auto-Sniper",
"IMI Galil", "Famas", "USP .45 ACP Tactical", "Glock 18C", "AWP Magnum Sniper", "MP5 Navy",
"M249 Para Machinegun", "M3 Super 90", "M4A1 Carbine", "Schmidt TMP", "G3SG1 Auto-Sniper", "FlashBang",
"Desert Eagle .50 AE", "SG-552 Commando", "AK-47 Kalashnikov", "Knife", "ES P90" };
static const int WeaponRealSpeed[30] = { 0, 250, 0, 260, 250, 240, 250, 250, 240, 250, 250, 250, 250, 210, 240, \
240, 250, 250, 210, 250, 220, 230, 230, 250, 210, 250, 250, 235, 221, 250 };

#if defined _WIN32
int index = PrivateToIndex( *( (void **)( (int *)PrivateToEdict(pthis)->pvPrivateData + 41) ) );
int weapon = *((int *)PrivateToEdict(pthis)->pvPrivateData + 43);
#elif defined __linux__
int index = PrivateToIndex( *( (void **)( (int *)PrivateToEdict(pthis)->pvPrivateData + 45) ) );
int weapon = *((int *)PrivateToEdict(pthis)->pvPrivateData + 47);
#endif

if( !isValidPlayer1(index) || !isValidPlayer2(index) )
return origret;

KzPlayer *temp = getPlayerPointerI(index);

if( !temp->isAlive() )
return origret;

KZUTIL_HudMessage( temp, 255, 0, 0, -1.0, 0.90, 3.0, KZ_HUD_CHANNEL, "Current Weapon: %s | MaxSpeed: %d", WeaponRealNames[weapon], WeaponRealSpeed[weapon] );

return origret;
}


Yes i use. temp->pEdict->v.maxspeed :D

ConnorMcLeod
09-15-2009, 14:05
We are offtopic, but correct forward to get weapons maxspeed is :

/**
* Description: Gets the maximum speed for whenever a player has the item deployed.
* Forward params: function(this);
* Return type: Float, byrefed in execute.
* Execute params: ExecuteHam(Ham_CS_Item_GetMaxSpeed, this, Float:output);
*/
Ham_CS_Item_GetMaxSpeed,

Starsailor
09-28-2009, 20:23
Player

211 & 503 - fOriginX
212 & 504 - fOriginY
213 & 505 - fOriginZ

506 - fCrosshairPitch (min 0 - max 255) IDK if this is the right name
507 - fCrosshairYaw Something related to crosshair :mrgreen: (I'm not sure, I'm Testing, If someone can help me)

Example usage:


new Float:fCrosshairPitch = get_pdata_float(id,506)

if(fCrosshairPitch >= 240.0)
client_print(id,print_chat,"You are aiming at the floor")

else if(fCrosshairPitch >= 0.0 && fCrosshairPitch <= 15.0)
client_print(id,print_chat,"You are aiming at the top")



client_print(id,print_chat,"Coords: X = %f Y = %f Z = %f",get_pdata_float(id,503),get_pdata_float(id,5 04),get_pdata_float(id,505))

Exolent[jNr]
09-28-2009, 21:14
211 - fOriginX
212 - fOriginY
213 - fOriginZ

And

503 - fOriginX
504 - fOriginY
505 - fOriginZ
506 - fCrosshairPitch (min 0 - max 255) IDK if this is the right name
507 - fCrosshairYaw IDK if this is the right name

Please supply the classnames for the entities.

Starsailor
09-28-2009, 21:43
Done, example added

ConnorMcLeod
09-29-2009, 00:30
211 -> 213 - m_vecLastPosition

Were already found : http://forums.alliedmods.net/showthread.php?p=765078#post765078

I had the other ones in my list :
486 - m_flNextDecalTime
503 - flOrigin.x
504 - flOrigin.y
505 - flOrigin.z
506 - flAngles.x ?
507 - flAngles.y ?
508 - horizontal speed / 100

Arkshine
09-29-2009, 08:16
Useless offsets.

SnoW
09-29-2009, 10:17
But the goal is to get them all, not depending their uselessness.

Arkshine
09-29-2009, 10:26
I know otherwise I would not put them all on the wiki. Just to say it's not something useful, nothing more.

ot_207
09-29-2009, 12:09
I am wondering if something like EEL (http://forums.alliedmods.net/showthread.php?p=681712) would be done for offsets would help.

MPNumB
10-21-2009, 01:49
Any ideas what m_chTextureType actually is? I tested ones from 339 to 345 where it should be... But no results.

Arkshine
10-21-2009, 02:09
It should return the current texture type. m_szTextureName or m_chTextureType ; I've tried them some times ago and without success too.

joropito
11-08-2009, 08:24
Is there a way to get/set values in private offsets using engine or amxx natives? I think not but I need to be sure.

Thanks

Arkshine
11-08-2009, 08:32
You don't like the fakemeta natives ? :mrgreen:

joropito
11-08-2009, 09:09
You don't like the fakemeta natives ? :mrgreen:

Sure, I like it. But I'm helping someone and that plugin doesn't use FM and I was only trying to not add another module.

I know some other plugins could make FM loaded, but I only wanna know :lol:

Arkshine
11-08-2009, 09:15
AFAIK, there are only fakemeta which do that. "that plugin doesn't use FM" ; it's idiot.

joropito
11-08-2009, 09:42
"that plugin doesn't use FM" ; it's idiot.

I don't think so.
He's new with scripting so he want to understand everything of engine now.
Then he will go to learn others options

SnoW
11-08-2009, 11:16
I don't think so.
He's new with scripting so he want to understand everything of engine now.
Then he will go to learn others options
it's idiot.

ConnorMcLeod
12-15-2009, 08:10
204 - bitHudTextArgsDontResend
1<<0
1<<1 #Hint_press_buy_to_purchase
1<<2 #Hint_prevent_hostage_rescue T #Hint_rescue_the_hostages CT
1<<3 #Hint_press_use_so_hostage_will_follow CT
1<<4 #Hint_lead_hostage_to_rescue_point CT
1<<5 #Hint_careful_around_hostages
1<<6 #Hint_lost_money (hostage killed)
1<<7 #Hint_spotted_a_friend
1<<8 #Hint_spotted_an_enemy
1<<9
1<<10 #Hint_careful_around_teammates
1<<11 #Hint_win_round_by_killing_enemy
1<<12 #Hint_you_have_the_bomb
1<<13
1<<14
1<<15 #Hint_out_of_ammo
1<<16 #Hint_you_are_in_targetzone
1<<17 #Hint_hostage_rescue_zone CT
1<<18
1<<19 #Hint_ct_vip_zone #Hint_terrorist_vip_zone
1<<20
1<<21 #Only_CT_Can_Move_Hostages T
1<<22 #Spec_Duck

jim_yang
08-26-2010, 01:25
player

365 - m_iNumSpawns

Arkshine
08-26-2010, 05:07
Already found. :twisted: Though I've named differently.

Used in :
- CBasePlayer::Spawn() : where it's incremented,
- CHalfLifeMultiplay::FPlayerCanRespawn() : A check at start, so you can't respawn if you don't have spawn at least one time.
- CHalfLifeMultiplay::RestartRound() : reseted.
- ClientPutInServer() : reseted.

Hey Jim, give us new stuff ! :mrgreen:

Around 100 and 200, if you know, like 116/117/118, 120->128, 130->137, 139->189, 194->196, 199->203. If you find some of them, I would be happy. :p

jim_yang
08-26-2010, 05:53
wow, already found ?
Man, I believe that you have already searched every single byte of the game lib. And what you have done is much more meaningful, cs-sdk.
Don't tell me that you did it only by decompiling the game dll and guessing, matching, comparing from the hlsdk, if so, you are so talent.

ConnorMcLeod
08-26-2010, 06:03
Don't tell me that you did it only by decompiling the game dll and guessing, matching, comparing from the hlsdk, if so, you are so talent.

He did it just like you said, it took ages though :mrgreen:

Arkshine
08-26-2010, 06:46
Not sure why you react like that, but I'm using IDA with the decompiler which does 80% of the work. When you read severals times the same function again and again, you start to be used of the generated output. Using the search tool, you can easily see where the offset is used. You can also add some structures to help greatly. About cs-sdk, with the help of HLSDK and HLSSDK (some references to cs:s), by searching/comparing a lot ( output .dll and output .so ), most of small functions or functions without too much checks, it's "easy" to decompile, though it requires always a lot of times. So yes, I do always that. But I have no talent and I am probably an idiot. You have just no idea how much time I'm spending because of my lack of knowledge. All I do is to observing/checking/comparing/guessing a lot.

Anyway, my post above was not ironic or whatever, I know you have far, far [...] more knowledge than me, and it's because of that, I was waiting new stuffs like you do always and I admit, having a bit disappointed when you've posted something already found. That's all. Sorry if I was rude or something.

jim_yang
08-26-2010, 07:01
I understand that.
I just laughed at myself that I'm so out of date. -_-!!
Besides you did quite a lot of jobs.

ConnorMcLeod
05-19-2012, 09:05
Updated players offsets list :
Thanks to VEN, Arkshine, Joropito and Jim_Yang :)

Stocks [g/s]set_pdata_[char/bool/short/vector] :
#if defined _pdatas_stocks_included
#endinput
#endif
#define _pdatas_stocks_included

#include <fakemeta>

#define SHORT_BYTES 2
#define INT_BYTES 4
#define BYTE_BITS 8

stock get_pdata_char(ent, charbased_offset, intbase_linuxdiff = 5)
{
return ( get_pdata_int(ent, charbased_offset / INT_BYTES, intbase_linuxdiff)>>>((charbased_offset % INT_BYTES) * BYTE_BITS) ) & 0xFF
}

stock bool:get_pdata_bool(ent, charbased_offset, intbase_linuxdiff = 5)
{
return !!( get_pdata_int(ent, charbased_offset / INT_BYTES, intbase_linuxdiff) & (0xFF<<((charbased_offset % INT_BYTES) * BYTE_BITS)) )
}

stock set_pdata_char(ent, charbased_offset, value, intbase_linuxdiff = 5)
{
value &= 0xFF
new int_offset_value = get_pdata_int(ent, charbased_offset / INT_BYTES, intbase_linuxdiff)
new bit_decal = (charbased_offset % INT_BYTES) * BYTE_BITS
int_offset_value &= ~(0xFF<<bit_decal) // clear byte
int_offset_value |= value<<bit_decal
set_pdata_int(ent, charbased_offset / INT_BYTES, int_offset_value, intbase_linuxdiff)
return 1
}

stock set_pdata_bool(ent, charbased_offset, bool:value, intbase_linuxdiff = 5)
{
set_pdata_char(ent, charbased_offset, _:value, intbase_linuxdiff)
}

stock get_pdata_short(ent, shortbased_offset, intbase_linuxdiff = 5)
{
return ( get_pdata_int(ent, shortbased_offset / SHORT_BYTES, intbase_linuxdiff)>>>((shortbased_offset % SHORT_BYTES) * BYTE_BITS) ) & 0xFFFF
}

stock set_pdata_short(ent, shortbased_offset, value, intbase_linuxdiff = 5)
{
value &= 0xFFFF
new int_offset_value = get_pdata_int(ent, shortbased_offset / SHORT_BYTES, intbase_linuxdiff)
new bit_decal = (shortbased_offset % SHORT_BYTES) * BYTE_BITS
int_offset_value &= ~(0xFFFF<<bit_decal) // clear byte
int_offset_value |= value<<bit_decal
set_pdata_int(ent, shortbased_offset / SHORT_BYTES, int_offset_value, intbase_linuxdiff)
return 1
}

stock get_pdata_vector(ent, const vec_offsets[3], Float:dest[3], intbase_linuxdiff)
{
static i
for(i=0; i<3; i++)
{
dest[i] = get_pdata_float(ent, vec_offsets[i], intbase_linuxdiff)
}
}

stock set_pdata_vector(ent, const vec_offsets[3], const Float:vec[3], intbase_linuxdiff)
{
static i
for(i=0; i<3; i++)
{
set_pdata_float(ent, vec_offsets[i], vec[i], intbase_linuxdiff)
}
}

// If you pass only 1st offset of a vec :
stock get_pdata_vec2(ent, vec_offset, Float:dest[3], intbase_linuxdiff)
{
static i
for(i=0; i<3; i++)
{
dest[i] = get_pdata_float(ent, vec_offsets + i, intbase_linuxdiff)
}
}

stock set_pdata_vec2(ent, vec_offsets, const Float:vec[3], intbase_linuxdiff)
{
static i
for(i=0; i<3; i++)
{
set_pdata_float(ent, vec_offsets + i, vec[i], intbase_linuxdiff)
}
}

Misc stocks (GetGrenadeType, GetWeaponBoxProps, RemoveUserShield, GiveUserShield):
GetGrenadeType( ent, bool:bCheckClass = true )
{
if( bCheckClass )
{
new class[9]
pev(ent, pev_classname, class, charsmax(class))
if( !equal(class, "grenade") )
{
return 0
}
}

if( get_pdata_bool(ent, m_bIsC4) )
{
return CSW_C4
}

new usEvent = get_pdata_short(ent, m_usEvent_Grenade)
if( !usEvent )
{
return CSW_FLASHBANG
}

static m_usHgrenExplo // , m_usSmokeExplo
if( !m_usHgrenExplo )
{
m_usHgrenExplo = engfunc(EngFunc_PrecacheEvent, 1, "events/createexplo.sc")
// m_usSmokeExplo = engfunc(EngFunc_PrecacheEvent, 1, "events/createsmoke.sc")
}

return usEvent == m_usHgrenExplo ? CSW_HEGRENADE : CSW_SMOKEGRENADE
}

GetWeaponBoxProps( ent, &weapon, &weaponType, &ammoCount, ammoName[], len )
{
for(new i = 1; i<= 5; i++)
{
weapon = get_pdata_cbase(ent, m_rgpPlayerItems_CWeaponBox[i], XO_CWEAPONBOX);
if( weapon > 0 )
{
break;
}
}

if( weapon > 0 )
{
weaponType = get_pdata_int(weapon, m_iId, XO_CBASEPLAYERWEAPON);
}
else
{
weaponType = 0;
}

ammoCount = get_pdata_int(ent, m_rgAmmo_CWeaponBox[1], XO_CWEAPONBOX);
if( ammoCount )
{
global_get(glb_pStringBase, get_pdata_int(ent, m_rgiszAmmo[1], XO_CWEAPONBOX), ammoName, len);
}
}

GiveUserShield( id )
{
set_pdata_bool(id, m_bHasShield, true)
set_pdata_int(id, m_fHasPrimary, 1)
new iActiveItem = get_pdata_cbase(id, m_pActiveItem)
if( iActiveItem > 0 )
{
new ammoIndex = get_pdata_int(iActiveItem, m_iPrimaryAmmoType, XO_CBASEPLAYERWEAPON)
if( ammoIndex > 0 && get_pdata_int(id, m_rgAmmo_CBasePlayer[ ammoIndex ] > 0 ) )
{
ExecuteHamB(Ham_Item_Holster, iActiveItem, 0)
}
if( !ExecuteHamB(Ham_Item_Deploy, iActiveItem) )
{
ExecuteHamB(Ham_Weapon_RetireWeapon, iActiveItem)
}
}
set_pev(id, pev_gamestate, 0)
}

RemoveUserShield( id )
{
if ( get_pdata_bool(id, m_bHasShield) )
{
set_pdata_bool(id, m_bHasShield, false)
set_pdata_int(id, m_fHasPrimary, 0)
set_pdata_bool(id, m_bUsesShield, false)
set_pev(id, pev_gamestate, 1)
new iHideHUD = get_pdata_int(id, m_iHideHUD)
if( iHideHUD & HUD_HIDE_CROSS )
{
set_pdata_int(id, m_iHideHUD, iHideHUD & ~HUD_HIDE_CROSS)
}
}
}

CBaseEntity
// CBaseEntity // LINUX DIFF 0

stock const vtbl = 0;

stock const _pev = 1;
stock const m_pGoalEnt = 2;
stock const m_pLink = 3;

stock const m_pfnThink = 4; // linux diff 0

stock const m_pfnThink_Flag_LINUX = 5; // linux only, diff 0

stock const m_pfnTouch = 5; // LINUX DIFF 1

stock const m_pfnTouch_Flag_LINUX = 7; // linux only, diff 0

stock const m_pfnUse = 6; // LINUX DIFF 2

stock const m_pfnUse_Flag_LINUX = 9; // linux only, diff 0

stock const m_pfnBlocked = 7; // LINUX DIFF 3

stock const m_pfnBlocked_Flag_LINUX = 11; // linux only, diff 0

// LINUX DIFF 4
stock const ammo_buckshot_TAB = 11;
stock const ammo_9mm_TAB = 13;
stock const ammo_556nato_TAB = 15;
stock const ammo_556natobox_TAB = 17;
stock const ammo_762nato_TAB = 19;
stock const ammo_45acp_TAB = 21;
stock const ammo_50ae_TAB = 23;
stock const ammo_338magnum_TAB = 25;
stock const ammo_57mm_TAB = 27;
stock const ammo_357sig_TAB = 29;

stock const m_flStartThrow = 30;
stock const m_flReleaseThrow = 31;
stock const m_chargeReady = 32;
stock const m_fInAttack = 33;


// CBaseEntity -> CArmoury
// Linux + 4
stock const XO_CARMOURY = 4;

stock const m_iItem = 34; // weapon ID defined in fgd
stock const m_iCount = 35; // item count before entity desappear
stock const m_iSaveCount = 36; // saved m_iCount value at Spawn
stock const m_bRestoreCount = 148; // if true [g/s]et_pdata_bool[/CODE]
CBaseDelay :
// Linux +4
#define m_flDelay 34
#define m_iszKillTarget 35
CBaseAnimating :
// Linux +4
#define m_flFrameRate 36
#define m_flGroundSpeed 37
#define m_flLastEventCheck 38
#define m_fSequenceFinished 39
#define m_fSequenceLoops 40
CBaseToggle :
// CBaseEntity -> CBaseDelay -> CBaseAnimating -> CBaseToggle
// Linux + 4
stock const XO_CBASETOGGLE1 = 4;

stock const m_toggle_state = 41;
stock const m_flActivateFinished = 42;
stock const m_flMoveDistance = 43;
stock const m_flWait = 44;
stock const m_flLip = 45;
stock const m_flTWidth = 46;
stock const m_flTLength = 47;
stock const m_vecPosition1[3] = {48,49,50};
stock const m_vecPosition2[3] = {51,52,53};
stock const m_vecAngle1[3] = {54,55,56};
stock const m_vecAngle2[3] = {57,58,59};
stock const m_cTriggersLeft = 60;
stock const m_flHeight = 61;
stock const m_hActivator_pent = 248; // linux + 16 // get_pdata_ent is (char) based // 62
stock const m_hActivator_serialnumber = 63; // 63
stock const m_pfnCallWhenMoveDone = 64;

// Linux +5
stock const XO_CBASETOGGLE2 = 5;

stock const m_pfnCallWhenMoveDone_Flag_LIN = 69; // linux only, diff 0
stock const m_vecFinalDest[3] = {65,66,67};
stock const m_vecFinalAngle[3] = {68,69,70};
stock const m_bitsDamageInflict = 71;
stock const m_sMaster = 72;
CBaseMonster :
// CBaseEntity -> CBaseDelay -> CBaseAnimating -> CBaseToggle -> CBaseMonster
// Linux +5
#define m_Activity 73
#define m_IdealActivity 74
#define m_LastHitGroup 75
#define m_bitsDamageType 76


// NOT OFFSETS LOL
#define itbd_Paralyze 0
#define itbd_NerveGas 1
#define itbd_Poison 2
#define itbd_Radiation 3
#define itbd_DrownRecover 4
#define itbd_Acid 5
#define itbd_SlowBurn 6
#define itbd_SlowFreeze 7
#define CDMG_TIMEBASED 8
stock const m_rgbTimeBasedDamage[CDMG_TIMEBASED] = {308,309,...}
// Usage get_pdata_char(id, m_rgbTimeBasedDamage[ itbd_DrownRecover ] )
// set_pdata_char(id, m_rgbTimeBasedDamage[ itbd_Poison ] , 200)

#define m_MonsterState 79
#define m_IdealMonsterState 80
#define m_afConditions 81
#define m_afMemory 82
#define m_flNextAttack 83
#define m_hEnemy_pent 336 // linux +20 // get_pdata_ent is (char) based // 84
#define m_hEnemy_serialnumber 85
#define m_hTargetEnt_pent 344 // linux +20 // get_pdata_ent is (char) based // 86
#define m_hTargetEnt_serialnumber 87
#define m_flFieldOfView 88
#define m_bloodColor 89
#define m_HackedGunPos_x 90
#define m_HackedGunPos_y 91
#define m_HackedGunPos_z 92
stock const m_vecEnemyLKP[3] = {93,94,95}
CBasePlayer :
// CBaseEntity -> CBaseDelay -> CBaseAnimating -> CBaseToggle -> CBaseMonster -> CBasePlayer
// Linux +5

#define random_seed 96 // See that is shared between client & server for shared weapons code
// 97 unknown
#define m_hSpectatedTarget_pent 392 // linux +20 // m_hSpectatedTarget takes 98 and 99 normally // get_pdata_ent, no set
#define m_hSpectatedTarget_serialnumber 99
#define m_flNextSpecButtonTime 100
#define m_iSpectatedPlayerWeaponId 101
#define m_fHasSpectatedPlayerC4 102
#define m_fHasSpectatedPlayerDefuseKit 103
#define m_iObserverMode 104
#define m_flAnimationTimeDummy 105
// 106 unknown
#define m_fHasTakenHighDamage 107 // Last damage > 60 ?
#define m_flPainShock 108
#define m_iLastZoom 109
#define m_fResumeZoom 110
#define m_flEjectBrass 111
#define m_iKevlarType 112
#define m_fHasSurvivedLastRound 113
#define m_iTeam 114
#define m_iAccount 115
#define m_fHasPrimary 116
// int _dummy_117 // animation // 117 unknown
#define m_iAnimationInCaseDie 118 // set according to hitplace and random values // used when dies to set some properties (velocity, that kind of stuff)
#define m_flNextChatTime 119
// #define m_bHasReceivedDefItems 120 // (1<<0)
#define m_bHasReceivedDefItems 480 // [g/s]et_pdata_bool
#define m_iJoinedState 121
#define m_pLastCamera 122
#define m_flNextCameraTime 123
#define m_flLastActivityTime 124
// #define m_bools125 125 // m_bHasBeenShownBriefing (1<<0) // m_bHasChangeTeamThisRound (1<<8)
#define m_bHasBeenShownBriefing 500 // [g/s]et_pdata_bool
#define m_bHasChangeTeamThisRound 501 // [g/s]et_pdata_bool
#define m_iInternalModel 126
#define m_iTeamMateKills 127
#define m_iIgnoreMessages 128
// #define m_boolsNVG 129 // m_bGotNVG (1<<0) // m_bIsNVGSwitchedOn (1<<8)
#define m_bGotNVG 516 // [g/s]et_pdata_bool
#define m_bIsNVGSwitchedOn 517 // [g/s]et_pdata_bool
// BIG HOLE
#define m_flNextIdleCheckTime 190
#define m_flNextRadioGameTime 191
#define m_iRadiosLeft 192
// #define m_bools193 193 // m_bHasSilentRadio (1<<0) // m_bHasC4 (1<<8) // m_bHasDefuser (1<<16) // m_bBlastDamaged (1<<24)
#define m_bHasSilentRadio 772 // [g/s]et_pdata_bool
#define m_bHasC4 773 // [g/s]et_pdata_bool
#define m_bHasDefuser 774 // [g/s]et_pdata_bool
#define m_bBlastDamaged 775 // [g/s]et_pdata_bool
stock const m_vecRelativeInflictorOrigin[3] = {194,195,196}
#define m_bTruOnHeDamage 197 // CBasePlayer::SetAnimation
#define m_fNextHudTextArgsGameTime 198
// LITTLE HOLE HudTextArgs RELATED
#define m_bitHudTextArgsDontResend 204
#define m_iMenu 205
// 206 unknown
// 207 unknown
#define m_fIsVIPRescued 208
// #define m_boolsAsEscape 209 // m_bHasReachRescueEscapePoint (1<<0) // m_bIsVip (1<<8)
#define m_bHasReachRescueEscapePoint 836 // [g/s]et_pdata_bool
#define m_bIsVip 837 // [g/s]et_pdata_bool
#define m_flNextRadarUpdateTime 210
stock const m_vecLastPosition[3] = {211,212,213}
#define m_iVoteKickUserId 214
#define m_flNextVote 215 // votemap votekick
#define m_iTeamKills 216
#define m_iHostageKills 217
#define m_iVotedMapIndex 218
#define m_bIsPrimaryFireAllowed 219
#define m_flLastAttackTime 220 // not sure
#define m_flNextTeammateAttackAlert 221
// #define m_boolsKilled 222 // m_bKilledByHeadShot (1<<0) // m_bKilledBecauseTeamKill (1<<8) // m_bNotReceivingMoneyNextRound (1<<16)
#define m_bKilledByHeadShot 888 // [g/s]et_pdata_bool
#define m_bKilledBecauseTeamKill 889 // [g/s]et_pdata_bool
#define m_bNotReceivingMoneyNextRound 890 // [g/s]et_pdata_bool
#define m_flNextTimeleft 223
#define m_boolChangeNameAtRespawn 896 // [g/s]et_pdata_bool
#define m_szNewName 897 // (224*4 + 1) [g/s]et_pdata_string // char m_szNewName[32]
#define m_fBombDefusing 232 // m_bBombDefusing (1<<8)
#define m_flNextMapZoneTime 233
#define m_fMapZone 234
#define m_fClientMapZone 235
#define m_pentBombTarget 236
#define m_iPlayerSound 237 // the index of the sound list slot reserved for this player
#define m_iTargetVolume 238 // ideal sound volume.
#define m_iWeaponVolume 239 // how loud the player's weapon is right now.
#define m_iExtraSoundTypes 240 // additional classification for this weapon's sound
#define m_iWeaponFlash 241 // brightness of the weapon flash
#define m_flStopExtraSoundTime 242 //
#define m_flFlashLightTime 243 // Time until next battery draw/Recharge
#define m_iFlashBattery 244 // Flashlight Battery Draw
#define m_afButtonLast 245
#define m_afButtonPressed 246
#define m_afButtonReleased 247
#define m_pentSndLast 248 // last sound entity to modify player room type
#define m_flSndRoomtype 249 // last roomtype set by sound entity
#define m_flSndRange 250 // dist from player to sound entity
#define m_flFallVelocity 251

// constant items
#define ITEM_HEALTHKIT 1
#define ITEM_ANTIDOTE 2
#define ITEM_SECURITY 3
#define ITEM_BATTERY 4
#define MAX_ITEMS 5 // hard coded item types
stock const m_rgItems[MAX_ITEMS] = { 252 , 253 , ... }

#define m_afPhysicsFlags 257 // physics flags - set when 'normal' physics should be revisited or overriden
#define m_fNextSuicideTime 258 // the time after which the player can next use the suicide command
#define m_flTimeStepSound 259 // when the last stepping sound was made
#define m_flTimeWeaponIdle_PLAYER 260 // when to play another weapon idle animation.
#define m_flSwimTime 261 // how long player has been underwater
#define m_flDuckTime 262 // how long we've been ducking
#define m_flWallJumpTime 263 // how long until next walljump
#define m_flSuitUpdate 264 // when to play next suit update
stock const m_rgSuitPlayList[4] = {265,266,...} //[CSUITPLAYLIST] // next sentencenum to play for suit update
#define m_iSuitPlayNext 269 // next sentence slot for queue storage
stock const m_rgiSuitNoRepeat[32] = {270,271,...} // [32] //[CSUITNOREPEAT] // suit sentence no repeat list
stock const m_rgflSuitNoRepeatTime[32] = {302,303,...} // [32] //[CSUITNOREPEAT] // how long to wait before allowing repeat
#define m_lastDamageAmount 334 // Last damage taken
#define m_tbdPrev 335 // Time-based damage timer
#define m_flgeigerRange 336 // range to nearest radiation source
#define m_flgeigerDelay 337 // delay per update of range msg to client
#define m_igeigerRangePrev 338
#define m_iStepLeft 339 // alternate left/right foot stepping sound
#define m_szTextureName 1360 // 440*4 m_szTextureName[19 char] //HL 13 [CBTEXTURENAMEMAX] // current texture name we're standing on
#define m_chTextureType 1379 // current texture type // may be use 344 instead
#define m_idrowndmg 345 // track drowning damage taken
#define m_idrownrestored 346 // track drowning damage restored
#define m_bitsHUDDamage 347 // Damage bits for the current fame. These get sent to
#define m_fInitHUD 348 // True when deferred HUD restart msg needs to be sent
#define m_fGameHUDInitialized 349
#define m_iTrain 350 // Train control position
#define m_fWeapon 351 // Set this to FALSE to force a reset of the current weapon HUD info
#define m_pTank_pent 1408 // linux + 20 // 352 // the tank which the player is currently controlling, NULL if no tank
#define m_pTank_serialnumber 353 // the tank which the player is currently controlling, NULL if no tank
#define m_fDeadTime 354 // the time at which the player died (used in PlayerDeathThink())
#define m_fNoPlayerSound 355 // a debugging feature. Player makes no sound if this is true.
#define m_fLongJump 356 // does this player have the longjump module?
#define m_tSneaking 357
#define m_iUpdateTime 358 // stores the number of frame ticks before sending HUD update messages
#define m_iClientHealth 359 // the health currently known by the client. If this changes, send a new
#define m_iClientBattery 360 // the Battery currently known by the client. If this changes, send a new
#define m_iHideHUD 361 // the players hud weapon info is to be hidden
#define m_iClientHideHUD 362
#define m_iFOV 363 // field of view
#define m_iClientFOV 364 // client's known FOV
#define m_iSpawnCount 365
#define m_pLinkedEntity 366
stock const m_rgpPlayerItems_CBasePlayer[6] = { 367 , 368 , ... }
#define m_pActiveItem 373
#define m_pClientActiveItem 374 // client version of the active item
#define m_pLastItem 375
stock const m_rgAmmo_CBasePlayer[32] = {376,377,...} // 376 // [MAX_AMMO_SLOTS]
stock const m_rgAmmoLast[32] = {408,409,...} // [MAX_AMMO_SLOTS]
stock const m_vecAutoAim[3] = {440,441,442}
#define m_fOnTarget 443
#define m_iDeaths 444
#define m_iRespawnFrames 445 // used in PlayerDeathThink() to make sure players can always respawn
#define m_izSBarState_0 446 // [SBAR_END]
#define m_izSBarState_1 447 // [SBAR_END]
#define m_izSBarState_2 448 // [SBAR_END]
#define m_flNextSBarUpdateTime 449
#define m_flStatusBarDisappearDelay 450
#define m_SbarString0 1804 // [SBAR_STRING_SIZE] // 128
#define m_lastx 483
#define m_lasty 484 // 483 484 // These are the previous update's crosshair angles, DON"T SAVE/RESTORE
#define m_nCustomSprayFrames 485 // Custom clan logo frames for this player
#define m_flNextDecalTime 486 // next time this player can spray a decal // 382
#define m_szTeamName 1948 // m_szTeamName[16]
#define g_szModelIndexPlayer 491 // psz
#define m_szShieldAnimExt 1968 // m_szShieldAnimExt[32]
#define m_iGaitSequence 500
#define m_flGaitFrame 501
#define m_flGaitYaw 502
#define m_flPrevGaitOrigin_x 503
#define m_flPrevGaitOrigin_y 504
#define m_flPrevGaitOrigin_z 505
#define m_flPitch 506
#define m_flYaw 507
#define m_flGaitMovement 508
#define m_fAutoWeaponSwitch 509
// #define m_boolsUserPrefsAndShield 510 // m_bHasVGUIMenus (1<<0) // m_bHasAutoHelp (1<<8) // m_bUsesShield (1<<16) // m_bHasShield (1<<24)
#define m_boolsUserPrefsAndShield 2040 // [g/s]et_pdata_bool
#define m_bHasAutoHelp 2041 // [g/s]et_pdata_bool
#define m_bUsesShield 2042 // [g/s]et_pdata_bool
#define m_bHasShield 2043 // [g/s]et_pdata_bool
#define m_fObserverHasTarget 511
#define m_flFindNextPlayerTime 512
#define m_flDtMultiplier 513
#define m_flFlashedUntil 514
#define m_flFlashedAt 515
#define m_flFlashHoldTime 516
#define m_flFlashDuration 517
#define m_iFlashAlpha 518
#define m_flNextAutoFollowTime 519
#define m_szAutoBuyData[256] 2080 // m_szAutoBuyData[256]
#define m_pSomeRebuyPointer 584 // Rebuy stuff CBasePlayer::Rebuy CBasePlayer::RebuyInitData ClientPutInServer
#define m_iRebuyLastPrimaryItemId 585
#define m_iRebuyLastPrimaryItemAmmo 586
#define m_iRebuyLastSecondaryItemId 587
#define m_iRebuyLastSecondaryItemAmmo 588
#define m_iRebuyHEGrenadeAmmo 589
#define m_iRebuyFlashbangAmmo 590
#define m_iRebuySmokeGrenadeAmmo 591
#define m_iRebuyDefuseKit 592
#define m_iRebuyNVGoggles 593
#define m_iRebuyKevlar 594
#define m_bRebuyStructBuilt 595
#define m_flNextLocationUpdateTime 596
#define m_szLocation 2388 // 597-604 m_szLocation[28]
#define m_flProgressBarStartTime 605
#define m_flProgressBarEndTime 606
#define m_boolsObserver607 607 // m_bObserverAutoDirector (1<<0) // m_bCanSwitchObserverModes (1<<8)
#define m_bObserverAutoDirector 2428 // [g/s]et_pdata_bool
#define m_bCanSwitchObserverModes 2429 // [g/s]et_pdata_bool
// 608
#define m_flIntense 609 win // ?void? CBasePlayer::Intense() { m_flIntense = gpGlobals->time }
// 610
// 611
#define m_flNextSayTime 612
#define m_flNextSayTeamTime 613
#define m_flNextFullUpdateTime 614
#define m_flNextVoteTimeCmd 615
#define m_flNextVoteMapTime 616
#define m_flNextListMapsTime 617
#define m_flNextListPlayersTime 618
#define m_flNextNightVisionTime 619

CGrenade :
// CBaseEntity -> CBaseDelay -> CBaseAnimating -> CBaseToggle -> CBaseMonster -> CGrenade

#define m_bStartDefuse 384 // [g/s]et_pdata_bool
#define m_bIsC4 385 // [g/s]et_pdata_bool
#define m_hDefuser_pent 388 // LINUX + 20 // offset 97
#define m_hDefuser_serial 98
#define m_flDefuseCountDown 99
#define m_flC4Blow 100
#define m_flNextFreqInterval 101
#define m_flNextBeep 102
#define m_flNextFreq 103
#define m_sBeepName 104
#define m_fAttenu 105
#define m_flNextBlink 106
#define m_flNextDefuseCheck 107
#define m_bJustBlew 108
#define m_iGrenadeTeam 109
#define m_iC4Hurry 110
#define m_pentCurBombTarget 444 // LINUX + 20 get_pdata_ent
#define m_SGSmoke 112

// int _dummy_113; // unknown offset

#define m_usEvent_Grenade 228 // [g/s]et_pdata_short
#define m_bLightSmoke 458 // [g/s]et_pdata_bool
// bool m_b459; // set to 1 on smoke explode

stock const m_vecAngles[3] = {115,116,117}

#define m_iRebundsCount 118
#define m_fSoundSet 119

CBasePlayerItem + CBasePlayerWeapon + Specific Weapons :
#if defined _cbaseplayerweapon_included
#endinput
#endif
#define _cbaseplayerweapon_included

#tryinclude "cstrike_pdatas/cbaseanimating_offsets.inc"

// CBaseEntity -> CBaseDelay -> CBaseAnimating -> CBasePlayerItem
// Linux +4
stock const XO_CBASEPLAYERITEM = 4;

// CBasePlayerItem
stock const m_pPlayer = 41;
stock const m_pNext = 42;
stock const m_iId = 43;

// CBaseEntity -> CBaseDelay -> CBaseAnimating -> CBasePlayerItem -> CBasePlayerWeapon
// Linux +4
stock const XO_CBASEPLAYERWEAPON = 4;

// CBasePlayerWeapon
stock const m_iPlayEmptySound = 44;
stock const m_fFireOnEmpty = 45; // True when the gun is empty and the player is still holding down the attack key
stock const m_flNextPrimaryAttack = 46; // soonest time ItemPostFrame will call PrimaryAttack
stock const m_flNextSecondaryAttack = 47; // soonest time ItemPostFrame will call SecondaryAttack
stock const m_flTimeWeaponIdle = 48; // soonest time ItemPostFrame will call WeaponIdle
stock const m_iPrimaryAmmoType = 49; // "primary" ammo index into players m_rgAmmo[]
stock const m_iSecondaryAmmoType = 50; // "secondary" ammo index into players m_rgAmmo[]
stock const m_iClip = 51; // number of shots left in the primary weapon clip, -1 it not used
stock const m_iClientClip = 52; // the last version of m_iClip sent to hud dll
stock const m_iClientWeaponState = 53; // the last version of the weapon state sent to hud dll (is current weapon, is on target)
stock const m_fInReload = 54; // Are we in the middle of a reload;
stock const m_fInSpecialReload = 55; // Are we in the middle of a reload for the shotguns
stock const m_iDefaultAmmo = 56; // how much ammo you get when you pick up this weapon as placed by a level designer.
stock const m_iShellLate = 57;
stock const m_flWeaponSpeed = 58; // used for guns to restore after shield
stock const m_bDelayFire = 236;

stock const m_iDirection = 60; // The current lateral kicking direction ; 1 = right, 0 = left.

stock const m_flAccuracy = 62;
stock const m_flLastFire = 63;
stock const m_iShotFired = 64;

stock const m_iszViewModel = 68;
stock const m_flGlock18Shoot = 69;
stock const m_iGlock18ShotsFired = 70;
stock const m_flFamasShoot = 71;
stock const m_iFamasShotsFired = 72;
stock const m_flFamasBurstSpread = 73;
stock const m_fWeaponState = 74;
enum ( <<=1 )
{
WEAPONSTATE_USP_SILENCED = 1,
WEAPONSTATE_GLOCK18_BURST_MODE,
WEAPONSTATE_M4A1_SILENCED,
WEAPONSTATE_ELITE_LEFT,
WEAPONSTATE_FAMAS_BURST_MODE,
WEAPONSTATE_SHIELD_DRAWN
}

stock const m_flNextReload = 75;
stock const m_flDecreaseShotsFired = 76;
stock const m_usGlock18Event = 154; // [g/s]et_pdata_short
stock const m_usFamasEvent = 155; // [g/s]et_pdata_short

// Weapon Specific :
// Linux +4

// CC4
stock const m_bArming = 312; // offset 82 linux
stock const m_bInArmingAnimation = 313; // offset 82
// bool _dummy_bool_330;
// bool _dummy_bool_331;

stock const m_flArmedTime = 79; // offset 83 linux
// int _dummy_80; // offset 84 linux // set to 1 when deployed and player has shield ?

// CHEGrenade
stock const m_usExplo_HEGREN = 156;

// CAK47
stock const m_iShell_AK47 = 78;
stock const m_fIsDeployed_AK47 = 79;
stock const m_usEvent_AK47 = 160;

// CAUG
stock const m_iShell_AUG = 78;
stock const m_fIsDeployed_AUG = 79;
stock const m_usEvent_AUG = 160;

// CDEAGLE
stock const m_iShell_DEAGLE = 78;
stock const m_usEvent_DEAGLE = 158;

// CELITE
stock const m_iShell_ELITE = 78;
stock const m_usEventLeft_ELITE = 158;
stock const m_usEventRigth_ELITE = 159;

// CFiveSeven
stock const m_iShell_FiveSeven = 78;
stock const m_usEvent_FiveSeven = 158;

// CM249
stock const m_iShell_CM249 = 78;
stock const m_fIsDeployed_CM249 = 79;
stock const m_usEvent_CM249 = 160;

// CM4A1
stock const m_iShell_M4A1 = 78;
stock const m_fIsDeployed_M4A1 = 79;
stock const m_usEvent_M4A1 = 160;

// CMAC10
stock const m_iShell_MAC10 = 78;
stock const m_fIsDeployed_MAC10 = 79;
stock const m_usEvent_MAC10 = 160;

// CMP5N
stock const m_iShell_CMP5N = 78;
stock const m_fIsDeployed_CMP5N = 79;
stock const m_usEvent_CMP5N = 160;

// CP228
stock const m_iShell_P228 = 78;
stock const m_usEvent_P228 = 158;

// CP90
stock const m_iShell_P90 = 78;
stock const m_fIsDeployed_P90 = 79;
stock const m_usEvent_P90 = 160;

// CSG552
stock const m_iShell_SG552 = 78;
stock const m_fIsDeployed_SG552 = 79;
stock const m_usEvent_SG552 = 160;

// CTMP
stock const m_iShell_TMP = 78;
stock const m_fIsDeployed_TMP = 79;
stock const m_usEvent_TMP = 160;

// CUMP45
stock const m_iShell_UMP45 = 78;
stock const m_fIsDeployed_UMP45 = 79;
stock const m_usEvent_UMP45 = 160;

// CUSP
stock const m_iShell_USP = 78;
stock const m_usEvent_USP = 158;

// CGalil
stock const m_iShell_Galil = 78;
stock const m_fIsDeployed_Galil = 79;
stock const m_usEvent_Galil = 160;

// CFamas
stock const m_iShell_Famas = 78;
stock const m_fIsDeployed_Famas = 79;

// CGLOCK18
stock const m_iShell_GLOCK18 = 78;
stock const m_fIsDeployed_GLOCK18 = 79;

// CSmokeGrenade
stock const m_usSmokeExplo = 156;

// CSCOUT
stock const m_iShell_SCOUT = 78;
stock const m_usEvent_SCOUT = 158;

// CAWP
stock const m_iShell_AWP = 78;
stock const m_usEvent_AWP = 158;

// CSG550
stock const m_iShell_SG550 = 78;
stock const m_usEvent_SG550 = 158;

// CG3SG1
stock const m_iShell_G3SG1 = 78;
stock const m_usEvent_G3SG1 = 158;

// CFlashbang // no private data

// CXM1014
stock const m_iShell_XM1014 = 78;
stock const m_flPumpTime_XM1014 = 79;
stock const m_usEvent_XM1014 = 160;

// CM3
stock const m_iShell_CM3 = 78;
stock const m_flPumpTime_CM3 = 79;
stock const m_usEvent_CM3 = 160;

// CC4
stock const m_bArming_C4 = 312;
stock const m_bInArmingAnimation_C4 = 313;
stock const m_flArmedTime_C4 = 79;

// CKnife
stock const m_fAllSolid_CKnife = 78;
stock const m_fStartSolid_CKnife = 79;
stock const m_fInOpen_CKnife = 80;
stock const m_fInWater_CKnife = 81;
stock const m_flFraction_CKnife = 82;
stock const m_vecEndPos_CKnife = {83,84,85};
stock const m_flPlaneDist_CKnife = 86;
stock const m_vecPlaneNormal_CKnife[3] = {87,88,89};
stock const m_pHit_CKnife = 90;
stock const m_iHitgroup_CKnife = 91;
stock const m_usEvent_CKnife = 184;

// CWeaponCycler
stock const m_iszModel_WeaponCycler = 78;
stock const m_iModel_WeaponCycler = 79;


CWeaponBox :
[PHP]// CBaseEntity -> CWeaponBox
// Linux +4
#define XO_CWEAPONBOX 4

stock const m_rgpPlayerItems_CWeaponBox[6] = { 34 , 35 , ... }
// Usage get_pdata_cbase(weaponbox, m_rgpPlayerItems_CWeaponBox[ 1 ], 4)

stock const m_rgiszAmmo[32] = { 40 , 41 , ... }
stock const m_rgAmmo_CWeaponBox[32] = { 72 , 73 , ... }
#define m_cAmmoTypes 104

CArmoury:
// CBaseEntity -> CArmoury
// Linux + 4
#define XO_CARMOURY 4

#define m_iItem 34 // weapon ID defined in fgd
#define m_iCount 35 // item count before entity desappear
#define m_iSaveCount 36 // saved m_iCount value at Spawn
#define m_bRestoreCount 148 // if true [g/s]et_pdata_bool

CRuleEntity (+ CGamePlayerEquip):
#if defined _cruleentity_included
#endinput
#endif
#define _cruleentity_included

#tryinclude "/cstrike_pdatas/cbaseentity_offsets.inc"

// CBaseEntity -> CRuleEntity
// Linux +4
stock const XO_CRULEENTITY = 4;

stock const m_iszMaster = 34;


// CBaseEntity -> CRulePointEntity
// No Pdatas

// CBaseEntity -> CRulePointEntity -> CGamePlayerEquip
stock const XO_CGAMEPLAYEREQUIP = 4;

stock const m_weaponNames[32] = {35,36,...};
stock const m_weaponCount[32] = {67,68,...};


If you use those includes, you can include them like this :
#tryinclude <cstrike_pdatas>

#if !defined _cbaseentity_included
#assert Cstrike Pdatas and Offsets library required! Read the below instructions: \
1. Download it at forums.alliedmods.net/showpost.php?p=1712101#post1712101 \
2. Put it into amxmodx/scripting/include/ folder \
3. Compile this plugin locally, details: wiki.amxmodx.org/index.php/Compiling_Plugins_%28AMX_Mod_X%29 \
4. Install compiled plugin, details: wiki.amxmodx.org/index.php/Configuring_AMX_Mod_X#Installing
#endif

meTaLiCroSS
05-19-2012, 13:59
#define m_bools125 125

Damn, no one knows what's the name of that offset? :(

ConnorMcLeod
05-19-2012, 14:14
Names could be m_bHasBeenShownBriefing and m_bHasChangeTeamThisRound, but as there is relation between them, it's difficult to choose a name for the cell that contains them.

meTaLiCroSS
05-19-2012, 22:09
Names could be m_bHasBeenShownBriefing and m_bHasChangeTeamThisRound, but as there is relation between them, it's difficult to choose a name for the cell that contains them.

Cleaning the (1<<8) bitsum to that offset will unlock player from choosing a team more than 1 time per round

set_pdata_int(iId, 125, get_pdata_int(iId, 125) & ~(1<<8)) // allow team change

So the more appropiated name would be m_bHasChangeTeamThisRound ?

hornet
05-20-2012, 02:28
Anyone know what the deal is with the m_f constants? They look like they'd be the same as m_b* bools right?

ConnorMcLeod
05-20-2012, 02:32
bool that have been declared as BOOL (int) in sdk, so consider integer.

tei1995
05-20-2012, 10:31
How do m_iShell work?

Arkshine
05-20-2012, 10:51
It contains just the model index of the shell model.

Saved in the precache function of a weapon, like : m_iShell = PRECACHE_MODEL( "models/rshell.mdl" );

ConnorMcLeod
06-03-2012, 12:57
#define m_bools125 125

Damn, no one knows what's the name of that offset? :(

Now updated with good offsets name.

Added CGrenade offsets.

Added following stocks :
get_pdata_char
get_pdata_bool
set_pdata_char
set_pdata_bool
get_pdata_short
set_pdata_short

Example with short in Get_Grenade_Type stock.
char :
get_pdata_char(id, m_rgbTimeBasedDamage[ itbd_DrownRecover ])
set_pdata_char(id, m_rgbTimeBasedDamage[ itbd_Poison ], 200)

bool :
set_pdata_bool(id, m_bHasChangeTeamThisRound, false)


Post is here : http://forums.alliedmods.net/showthread.php?p=1712101#post1712101

Edit Jun 4th, 2012 07:10
- Added Weapons offsets

Just ask if you need some missing offsets (gonna add weaponbox later)

Edit 2 Jun 5th, 2012 07:18
Renamed some offsets to avoid same names for different classes offsets (m_flWeaponIdleTime "player" and "weapon_XXX" for example).
Updated .inc files so it can be used in plugins.

Edit 3 Jun 7th, 2012 07: 32
Changed some array offsets, such as :

m_vecLastPosition :
Usage :
new Float:vecLastPosition[3]
for(new i; i<3; i++)
{
vecLastPosition[i] = get_pdata_float(id, m_vecLastPosition[i])
}

Get player primary weapon :
get_pdata_cbase(id, m_rgpPlayerItems_CBasePlayer[1])

Edit 4 Jun 7th, 2012 19:45 GMT+1 :P
Added CArmoury offsets
Fixed 1 static variable having to be stock

Edit 5 Jun 8th, 2012 07:15
Added [g/s]et_pdata_vector

Edit 6 Jun 9th, 2012 16:55
Replace arithmetic right shifts with logical ones, mask was preventing error but code seems more correct like this.

dFF
06-29-2012, 16:12
Thank you Connor :mrgreen:. Also, why you remove the m_rgpPlayerItems_Slots (0..5) offsets ?

ConnorMcLeod
06-29-2012, 16:24
For CBasePlayer class m_rgpPlayerItems pdata, use m_rgpPlayerItems_CBasePlayer[ slot index ]
For CWeaponBox class m_rgpPlayerItems pdata use m_rgpPlayerItems_CWeaponBox[ slot index ]

ConnorMcLeod
10-21-2012, 07:07
Update of offsets files :

- Changed defines into constants
- Added CRuleEntity and CGamePlayerEquip classes pdatas offsets

See http://forums.alliedmods.net/showthread.php?p=1712101#post1712101

ConnorMcLeod
03-25-2013, 19:20
Update since last cs update has moved some offsets (changes only in cbaseentity_offsets.inc and cbasetoggle_offsets.inc).

Still there : http://forums.alliedmods.net/showthread.php?p=1712101#post1712101

meTaLiCroSS
03-26-2013, 20:32
Update since last cs update has moved some offsets (changes only in cbaseentity_offsets.inc and cbasetoggle_offsets.inc).

Still there : http://forums.alliedmods.net/showthread.php?p=1712101#post1712101

Did you overwrote the values? Someones like me still using the old cs server version

ConnorMcLeod
03-27-2013, 01:20
Use old files then, but i think you know that only latest versions are supported on this forum ;)

K.K.Lv
06-06-2013, 22:50
m_fArmedTime seem is 79, not 80 !

ConnorMcLeod
06-07-2013, 00:54
Seems to be 81 win, 85 linux, just wondering how we had missed that, and how offsets can have been correctly aligned before, because it was the case.

There are 2 offsets at the enf of playerweapons class that were not present before, of we hadn't noticed, i don't know, so all specific weapons offsets should be added 2.

Arkshine
06-07-2013, 02:49
CC4 :


bool m_bStartedArming; /* 336 1 */
bool m_bBombPlacedAnimation; /* 337 1 */
float m_fArmedTime; /* 340 4 */
bool m_bHasShield; /* 344 1 */

In comment, full offset linux.

K.K.Lv
06-08-2013, 04:00
don't know any more about the offsets,
but I test the following code and it seem work with my server


Console initialized.
Protocol version 48
Exe version 1.1.2.7 (cstrike)
Exe build: 14:59:51 Feb 13 2013 (5956)
STEAM Auth Server
Server IP address 192.168.1.100:27015
Metamod version 1.20-am Copyright (c) 2001-2006 Will Day <[email protected]>
Metamod comes with ABSOLUTELY NO WARRANTY; for details type `meta gpl'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `meta gpl' for details.

AMX Mod X version 1.8.2 Copyright (c) 2004-2006 AMX Mod X Development Team
AMX Mod X comes with ABSOLUTELY NO WARRANTY; for details type `amxx gpl'.
This is free software and you are welcome to redistribute it under
certain conditions; type 'amxx gpl' for details.

client is steam.

orhpeu 2.5.1


#include <amxmodx>
#include <orpheu>
#include <hamsandwich>
#include <fakemeta>

#define PLUGIN_NAME "NewPlugin"
#define PLUGIN_VERSION "0.1"
#define PLUGIN_AUTHOR "LittleKu-Lv"

const m_bStartedArming = 78;
const m_fArmedTime = 79;
const m_bOnBombZone = 235;
const m_pPlayer = 41;


new g_iBomb;

public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);

RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_c4", "fwBombPlantingPre", false);
}

public fwBombPlantingPre(const bomb)
{
if (!get_pdata_bool(bomb, m_bStartedArming, 4))
{
new id = get_pdata_cbase(bomb, m_pPlayer, 4);
if ( (pev(id, pev_flags) & FL_ONGROUND)
&& ( get_pdata_int(id, m_bOnBombZone, 5) & (1<<1) ) )
{
g_iBomb = bomb;

OrpheuRegisterHook(OrpheuGetFunction("SetProgressBarTime", "CBasePlayer"), "OnSetProgressBarTime");
}
}
}

stock bool:get_pdata_bool(ent, charbased_offset, intbase_linuxdiff = 5)
{
return !!( get_pdata_int(ent, charbased_offset / 4, intbase_linuxdiff) & (0xFF<<((charbased_offset % 4) * 8)) )
}

public OrpheuHookReturn:OnSetProgressBarTime(id, iTime)
{
set_pdata_float(g_iBomb, m_fArmedTime, get_gametime() + 12, 4);
OrpheuSetParam(2, 12);
return OrpheuIgnored;
}

and I use

const m_fArmedTime = 79;

Arkshine
06-08-2013, 04:35
Not sure why you say it's working, but offset is for sure wrong.

bibu
11-27-2013, 05:07
Can those natives be added to the official release of next amxx version?

[g/s]set_pdata_[char/bool/short/vector]

Arkshine
11-27-2013, 06:15
It has been already added.

I suggest you take a look to the changelog since 1.8.2 : http://hg.alliedmods.net/amxmodx-central/shortlog

11922911
01-01-2014, 08:57
m_bStartedArming 312, m_bBombPlacedAnimation 313, m_flArmedTime 79 seems not working for win 6027 build.
I tried to find the new offset, and what I found(by guess) is m_bStartedArming 320, m_bBombPlacedAnimation 321, m_flArmedTime 81, I've tested it and working fine (so far), but is that the really correct offset?

I was wondering how did they find the offsets? any tools or something else?

ConnorMcLeod
01-01-2014, 09:36
Yes, there are 2 new pdatas at the end of CBasePlayerWeapon

m_flPrevPrimaryAttack 78
m_flLastFireTime 79

So all specific weapons pdata are displaced from 2 (2*4 for bools)

11922911
01-01-2014, 10:43
Yes, there are 2 new pdatas at the end of CBasePlayerWeapon

m_flPrevPrimaryAttack 78
m_flLastFireTime 79

So all specific weapons pdata are displaced from 2 (2*4 for bools)
Oh! Thank you for telling me that!:)
Now I see when some weapons pdata are not working, I can try with what you said.

NiHiLaNTh
01-01-2014, 11:32
Anyone knows m_flDisplayHistory offset value? I tried to find it on list in page 14, but either its missing or named differently :?

ConnorMcLeod
01-01-2014, 14:24
const m_flDisplayHistory = 204;

artist
09-15-2014, 08:58
Is it possible to create a module that displays a table of all offsets?

Or is he just going to intercept registered in memory...

Simply nowhere to be found these offsets:

bool m_bMapHasBombTarget;
bool m_bMapHasBombZone;
bool m_bMapHasBuyZone;
bool m_bMapHasRescueZone;
bool m_bMapHasEscapeZone;

HamletEagle
09-15-2014, 09:22
Look here: https://forums.alliedmods.net/showthread.php?t=123078&page=1 ( note that there are full offsets, so you will need to use orpheu/do some math to be able to use them with [g/s]et_pdata_[int/float] )

artist
09-15-2014, 12:59
Ok, thank you )

Fr33m@n
01-19-2015, 18:46
https://github.com/Arkshine/CSSDK/blob/98bb4d0b7b71f4077f4bcfc30c3746b5276457bb/multiplayer/dlls/player.h

How can i "transform" offset numbers from here to an amxmodx working version ?

Current list from connor have outdated offset, so i'm asking.

Arkshine
01-19-2015, 19:42
These are linux full offsets.

To get windows offset, depending the natives/stocks you're using:

- If it says it uses full offset or offset is char-based, then you just need to care about extra offset: "windows full offset = linux full offset - extra_full_offset". extra_full_offset is either 20 (aka 5 * 4) if related to player, or 16 (aka 4 * 4) if related to weapon. So yes the usual extra offset * 4. E.g: "random_seed" is 404. Windows full offset = 404 - 20 = 384.

- If it says nothing, it's probably int-based, so you need to do: "windows offset = (linux full offset - extra_full_offset) / 4". E.g: "random_seed" is 404. Windows offset = (404 - 20) / 4 = 96.


If you retrieve value where the data type are for example bool, short, etc (so not based on 4 bytes), to avoid to play with flags (because conversion gives you a floating point number), use the full offset with the connor's stock or 1.8.3 new natives.

Zer0_CooL
02-25-2016, 23:29
Please, any one show example how to use m_fIsDeployed_AK47 offset ?

meTaLiCroSS
02-26-2016, 18:00
Please, any one show example how to use m_fIsDeployed_AK47 offset ?

Tell first what are you trying to do. There can be a better solution for it.

Zer0_CooL
02-26-2016, 23:21
I just want to know, how to use this offset.


stock some_function(iPlayer)
{
new iWeapon = fm_get_user_weapon_entity(iPlayer);

// isAk47Deployed - always 0. Why?
new isAk47Deployed = get_pdata_int(iWeapon, m_fIsDeployed_AK47, XO_CBASEPLAYERWEAPON);
}