TF2_GetPlayerResourceData(client, TFResource_MaxHealth);
?
-----
Update, talking to him on steamchat, a long time friend.....he needed a realtime example.
Sorry you newb lol:
Code:
#include <tf2_stocks>
#define LOLDEBUG
public FUHQ(client)
{
new hp = GetEntProp(client, Prop_Send, "m_iHealth");
new hpm = TF2_GetPlayerResourceData(client, TFResource_MaxHealth);
#if defined LOLDEBUG
PrintToChatAll("client#[%i] - HP[%i/%i]",client,hp,hpm);
#endif
if ( hp >= hpm)
{
//do stuff here
}
}
Heres your other block of code you wanted
Code:
if(GetConVarInt(c_Enabled))
{
if(IsPlayerAlive(client))
{
if(GetEntProp(client, Prop_Send, "m_iHealth") >= TF2_GetPlayerResourceData(client, TFResource_MaxHealth))
{
//(g_Location[client][1] != 0)
TeleportEntity(client, g_Location[client], NULL_VECTOR, NULL_VECTOR);
ReplyToCommand (client, "You have been teleported to the skybox!");
}
else
{
PrintToChat(client,"Your health needs to be at max health or higher to use teleport.");
}
}
else
{
ReplyToCommand (client, "You're dead, do you really think its possible to teleport while being dead?");
}
}
Here's the other block:
Code:
stock GetEntityOrigin(entity,Float:fOrigin[3])
{
GetEntPropVector(entity,Prop_Send,"m_vecOrigin",fOrigin);
}
stock FindEntityByTargetname(const String:targetname[], const String:classname[])
{
decl String:namebuf[32];
new index = -1;
namebuf[0] = '\0';
while(strcmp(namebuf, targetname) != 0 && (index = FindEntityByClassname(index, classname)) != -1) GetEntPropString(index, Prop_Data, "m_iName", namebuf, sizeof(namebuf));
return(index);
}
__________________