| ConnorMcLeod |
02-09-2010 00:53 |
Re: [HELP] m_afPhysicsFlags offset hafl-life player
Try my in real time player offsets printer :
Edit : Seems to be 193
Code:
float m_flSndRange; // dist from player to sound entity
float m_flFallVelocity; //185
int m_rgItems[MAX_ITEMS]; //186-190
int m_fKnownItem; //191 // True when a new item needs to be added
int m_fNewAmmo; //192 // True when a new item has been added
unsigned int m_afPhysicsFlags;//193 // physics flags - set when 'normal' physics should be revisited or overriden
float m_fNextSuicideTime; // the time after which the player can next use the suicide command
PHP Code:
#include <amxmodx> #include <engine> #include <fakemeta> #include <hamsandwich>
new const VERSION[] = "0.1.1"
const MAX_OFFSET_TO_PRINT = 15 const MAX_MSG_LENGTH = 128 * MAX_OFFSET_TO_PRINT
enum _:Types { Type_Int, Type_Float, Type_String, Type_Cbase, Type_Char, Type_Bit }
new g_iOffSet = 1 new g_Type = Type_Int
public plugin_init() { register_plugin("Players Offset Test", VERSION, "ConnorMcLeod" )
register_clcmd("rest", "reset") register_clcmd("augm", "augm") register_clcmd("dimi", "dimi") register_clcmd("goto", "_goto")
register_clcmd("say /int", "intType") register_clcmd("say /float", "floatType") register_clcmd("say /str", "stringType") register_clcmd("say /cbase", "cbaseType") register_clcmd("say /char", "charType") register_clcmd("say /bit", "bitType") }
public intType( id ) { g_Type = Type_Int }
public floatType( id ) { g_Type = Type_Float }
public stringType( id ) { g_Type = Type_String }
public cbaseType( id ) { g_Type = Type_Cbase }
public charType( id ) { g_Type = Type_Char }
public bitType( id ) { g_Type = Type_Bit }
public client_PreThink(id) { if( pev_valid(id) != 2 || is_user_bot(id) ) { return }
static Float:flOffset//[MAX_OFFSET_TO_PRINT] static i, iOffset//[MAX_OFFSET_TO_PRINT] static szOffSet[128]
static szMsg[MAX_MSG_LENGTH] static n ; n = 0
for(i=0; i<MAX_OFFSET_TO_PRINT; i++) { switch( g_Type ) { case Type_Int: { iOffset = get_pdata_int(id, g_iOffSet+i) n += formatex(szMsg[n], charsmax(szMsg)-n, "^n%d: %d", g_iOffSet + i, iOffset) } case Type_Float: { flOffset = get_pdata_float(id, g_iOffSet+i) n += formatex(szMsg[n], charsmax(szMsg)-n, "^n%d: %.3f", g_iOffSet + i, flOffset) } case Type_String: { szOffSet[0] = 0 get_pdata_string(id, g_iOffSet+i, szOffSet, charsmax(szOffSet), 1, 5) n += formatex(szMsg[n], charsmax(szMsg)-n, "^n%d: %s", g_iOffSet + i, szOffSet) } case Type_Cbase: { iOffset = get_pdata_cbase_safe(id, g_iOffSet+i, 5) n += formatex(szMsg[n], charsmax(szMsg)-n, "^n%d: %d", g_iOffSet + i, iOffset) } case Type_Char: { iOffset = get_pdata_int(id, g_iOffSet+i) if( 33 <= iOffset <= 126 ) { n += formatex(szMsg[n], charsmax(szMsg)-n, "^n%d: %c", g_iOffSet + i, iOffset) } else { n += formatex(szMsg[n], charsmax(szMsg)-n, "^n%d: NULL", g_iOffSet + i) } } case Type_Bit: { // new szFlags[128] = "00000000000000000000000000000000" iOffset = get_pdata_int(id, g_iOffSet+i) if( iOffset ) { n += formatex(szMsg[n], charsmax(szMsg)-n, "^n%i %i (", g_iOffSet + i, iOffset) for(new j = 31; j >= 0; j--) { if(iOffset & (1<<(j))) { n += formatex(szMsg[n], charsmax(szMsg)-n, "%i ", j) // szFlags[j] = '1' } } szMsg[n-1] = ')' // server_print("pev_weapons = %u (%s)", iOffset, szFlags) // n += formatex(szMsg[n], charsmax(szMsg)-n, "^n%i (%s)", g_iOffSet + i, szFlags) } else { n += formatex(szMsg[n], charsmax(szMsg)-n, "^n%i %i", g_iOffSet + i, iOffset) } } } }
client_print_center(id, "%s^n%f", szMsg, get_gametime())
}
client_print_center(id, msg[], any:...) { static szMsg[MAX_MSG_LENGTH] vformat(szMsg, charsmax(szMsg), msg, 3) engfunc(EngFunc_ClientPrintf, id, 1, szMsg) }
public _goto(id) { new arg[32] read_argv(1, arg, 31) g_iOffSet = str_to_num(arg) return PLUGIN_HANDLED }
public reset(id) { g_iOffSet = 0 return PLUGIN_HANDLED }
public augm(id) { g_iOffSet += MAX_OFFSET_TO_PRINT return PLUGIN_HANDLED }
public dimi(id) { if( g_iOffSet > 0 ) --g_iOffSet return PLUGIN_HANDLED }
|