Raised This Month: $ Target: $400
 0% 

[css] What is GetSlot offset?


Post New Thread Reply   
 
Thread Tools Display Modes
altex
Veteran Member
Join Date: May 2009
Location: Russia
Old 07-17-2010 , 00:43   Re: [css] What is GetSlot offset?
Reply With Quote #11

Quote:
Originally Posted by p3tsin View Post
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);

works perfectly!
__________________

Last edited by altex; 07-17-2010 at 03:38.
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 20:58.


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