Raised This Month: $51 Target: $400
 12% 

[css] What is GetSlot offset?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
altex
Veteran Member
Join Date: May 2009
Location: Russia
Old 07-15-2010 , 17:45   [css] What is GetSlot offset?
Reply With Quote #1

Hi, everybody.
What is the correct GetSlot offset for cstrike?

i use
"GetSlot"
{
"windows" "313"
"linux" "314"
}
and have no luck
Please help
__________________
altex is offline
Peoples Army
SourceMod Donor
Join Date: Mar 2007
Old 07-16-2010 , 00:14   Re: [css] What is GetSlot offset?
Reply With Quote #2

shouldn't you be useing

PHP Code:



GetEntData
Syntax
:
native GetEntData(entityoffsetsize=4); 

Usage
 
entity        Edict index.
 
offset        Offset to use.
 
size            Number of bytes to read (valid values are 12, or 4).
Notes
Peeks into an entity's object data and retrieves the integer value at the given offset. 

Return: 
Value at the given memory location.

Version Added:
1.0.0.1946

On error / Errors: 
Invalid entity or offset out of reasonable bounds. 
PHP Code:

GetEntSendPropOffs
Syntax
:
stock GetEntSendPropOffs(ent, const String:prop[], bool:actual=false

Usage
 
ent            Entity index.
 
prop            Property name.
 
actual        Defaults to false for backwards compatibility. If truethe newer FindSendPropInfo() function is used instead.
Notes
Wrapper function for finding a send property for a particular entity

Return: 
An offset, or -1 on failure.

Version Added:
1.0.0.1946 

PHP Code:


GetEntProp
Syntax
:
native GetEntProp(entityPropType:type, const String:prop[], size=4); 

Usage
 
entity        Entity/edict index.
 
type            Property type.
 
prop            Property name.
 
size            Number of bytes to write (valid values are 12, or 4). This value is auto-detected, and the size parameter is only used as a fallback in case detection fails.
Notes
Retrieves an integer value from an entity's property. This function is considered safer and more robust over GetEntData, because it performs strict offset checking and typing rules. 

Return: 
Value at the given property offset.

Version Added:
1.0.0.1946

On error / Errors: 
Invalid entity or property not found. 
__________________
Peoples Army is offline
altex
Veteran Member
Join Date: May 2009
Location: Russia
Old 07-16-2010 , 06:03   Re: [css] What is GetSlot offset?
Reply With Quote #3

I realy dont know offsets and property names for that
Thanks for wishing to help...
__________________
altex is offline
Peoples Army
SourceMod Donor
Join Date: Mar 2007
Old 07-16-2010 , 07:14   Re: [css] What is GetSlot offset?
Reply With Quote #4

http://wiki.alliedmods.net/Virtual_O..._(Source_Mods)
__________________

Last edited by Peoples Army; 07-16-2010 at 07:22.
Peoples Army is offline
altex
Veteran Member
Join Date: May 2009
Location: Russia
Old 07-16-2010 , 13:38   Re: [css] What is GetSlot offset?
Reply With Quote #5

1) I realy have ho idea how to use it, it was last updated 24 of June, i believe it was changed a couple of times.
2) I do not understand how to use GetEntData, GetEntSendPropOffs, GetEntProp if i want to figure it out what slot does weapon use. Can you give me the link to an example?

i dont even know what is "send" property...
__________________
altex is offline
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 07-16-2010 , 14:47   Re: [css] What is GetSlot offset?
Reply With Quote #6

Quote:
Originally Posted by altex View Post
2) I do not understand how to use GetEntData, GetEntSendPropOffs, GetEntProp if i want to figure it out what slot does weapon use.
That's probably a good thing as virtual functions have nothing to do with entity data. The guy obviously has no idea what he's talking about.

Anyway, here you go:
Code:
"GetSlot"
{
	"windows" "310"
	"linux" "315"
}
__________________
plop
p3tsin is offline
altex
Veteran Member
Join Date: May 2009
Location: Russia
Old 07-16-2010 , 15:04   Re: [css] What is GetSlot offset?
Reply With Quote #7

Thank you very much! The windows offset now works correctly. Not tested linux yet.

Dont get me wrong, but, if you could help with the other offsets and signatures, it would be very wonderfull for everybody in this thread

Maybe all is ok already, my server works almost fine, i just want to be sure it's a correct offsets and sigtatures...

oh valve..

Code:
"Games"
{
    "cstrike"
    {
        "Offsets"
        {
            "EndMultiplayerGame"
            {
                "windows"       "118"
                "linux"     "119"
            }

            "GetPrimaryAmmoType"
            {
                "windows"       "322"
                "linux"     "323"
            }

            "GetSlot"
            {
                "windows"       "310"
                "linux"         "315"
            }
        }

        "Signatures"
        {
            "CSWeaponDrop"
            {
                "library"       "server"
                "windows"       "\x81\xEC\x2A\x2A\x2A\x2A\x53\x55\x56\x57\x8B\xBC\x2A\x2A\x2A\x2A\x2A\x32\xDB\x85\xFF\x8B\xF1\x0F"
                "linux"     "@_ZN9CCSPlayer12CSWeaponDropEP17CBaseCombatWeaponbb"
            }

            "RemoveAmmo"
            {
                "library"       "server"
                "windows"       "\x53\x8B\x2A\x2A\x2A\x85\xDB\x56\x8B\xF1\x7E\x2A\x57\x8B\x2A\x2A\x2A\x57\xE8\x2A\x2A\x2A\x2A\x8B\xC8\xE8"
                "linux"     "@_ZN20CBaseCombatCharacter10RemoveAmmoEii"
            }
            
            "UTIL_Remove"
            {
                "library"   "server"
                "windows"       "\x8B\x44\x24\x04\x85\xC0\x74\x2A\x83\x2A\x2A\x89\x2A\x2A\x2A\xE9\x2A\xFF\xFF\xFF"
                "linux"     "@_Z11UTIL_RemoveP11CBaseEntity"
            }
        }
    }
}
__________________
altex is offline
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 07-16-2010 , 16:54   Re: [css] What is GetSlot offset?
Reply With Quote #8

Code:
"GetPrimaryAmmoType"
{
	"windows"	"319"
	"linux"		"324"
}
The rest of the offsets and sigs you have are correct.

You may wanna consider using the netprop CBaseCombatWeapon::m_iPrimaryAmmoType to get the ammo type instead of the virtual function, then you wouldn't need to check the offset after each update.

PHP Code:
new g_iOffs_iPrimaryAmmoType = -1;

public 
OnPluginStart() {
    
g_iOffs_iPrimaryAmmoType FindSendPropInfo("CBaseCombatWeapon","m_iPrimaryAmmoType");
}

GetAmmoType(weapon) {
    return 
GetEntData(weapon,g_iOffs_iPrimaryAmmoType,1);
}

//I like the above better since it doesn't involve repetitive use of strings,
//but you can also do this if you're feeling lazy:
GetAmmoType(weapon) {
    return 
GetEntProp(weapon,Prop_Send,"m_iPrimaryAmmoType",1);

__________________
plop
p3tsin is offline
altex
Veteran Member
Join Date: May 2009
Location: Russia
Old 07-16-2010 , 17:43   Re: [css] What is GetSlot offset?
Reply With Quote #9

Thanks A Lot, p3tsin.
That's a great suggestion about GetEntData(weapon,g_iOffs_iPrimaryAmmoType,1);
__________________
altex is offline
altex
Veteran Member
Join Date: May 2009
Location: Russia
Old 07-16-2010 , 23:42   Re: [css] What is GetSlot offset?
Reply With Quote #10

Peoples Army, please, give me an example of the code or link, or anything else to get me into this. If you wish ofcourse. I'm new to internal data structure of the entities and can not write code like this without examples.
I dont even know where i need to use Prop_Send and where Prop_Data.
__________________

Last edited by altex; 07-16-2010 at 23:47.
altex 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 09:08.


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