This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

[L4D] Cannot read entity properties about the player. Help pls.


Post New Thread Reply   
 
Thread Tools Display Modes
pRED*
Join Date: Dec 2006
Old 07-16-2009 , 01:31   Re: [L4D] Cannot read entity properties about the player. Help pls.
Reply With Quote #11

Arrays like this are a little more complicated, SourceMod doesn't have a way of working out the offset for you.

First you need to get the offset of m_iAmmo using FindSendPropOffset (or FindDatamapOffset in the case of datamaps).

Then we look at the sendprop dump to work out the offsets to each row.

Sub-Class Table (3 Deep): m_iAmmo
-Member: 000 (offset 0) (type integer) (bits 10)
-Member: 001 (offset 4) (type integer) (bits 10)
-Member: 002 (offset (type integer) (bits 10)

The offset x section shows us that each line +4 from the previous.

So to get 006 we'd have to do: offset (from FindSendPropInfo) + (6*4)

Then we can use this new offset with the ent prop functions. Usually this would be SetEntData* (slightly confusing as the data in this case has no relation to Prop_Data/datamap types).

In the case of m_iAmmo each ammo type used in the game occupies a different in this table. This is entirely game specific so you might need to play around tracking the values while shooting guns to figure out which one relates to what.
pRED* is offline
Thraka
AlliedModders Donor
Join Date: Aug 2005
Old 07-16-2009 , 12:49   Re: [L4D] Cannot read entity properties about the player. Help pls.
Reply With Quote #12

Thank you very much Red, I'll play around with it. +Karma 4 u!
Thraka is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:20.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode