Hi,
you cannot set tank hp > 65535 with:
PHP Code:
SetEntProp(entity, Prop_Send, "m_iMaxHealth", 100000);
SetEntProp(entity, Prop_Send, "m_iHealth", 100000);
but you can do it with changing "z_tank_health" ConVar.
Now, how to retrieve actual value of hp?
PHP Code:
public void OnPluginStart()
{
RegAdminCmd("sm_ent", CmdEnt, ADMFLAG_ROOT);
}
public Action CmdEnt(int client, int args)
{
if( !client ) return Plugin_Handled;
int entity = GetClientAimTarget(client, false);
if( entity != -1 )
{
int iMaxHealth = GetEntProp(entity, Prop_Send, "m_iMaxHealth");
int iHealth = GetEntProp(entity, Prop_Send, "m_iHealth");
PrintToChat(client, "\x01Health: \x05%i \x01Max: \x05%i", iHealth, iMaxHealth);
}
return Plugin_Handled;
}
returns wrong result.
Thanks.
__________________