that should be right
PHP Code:
public void OnPluginStart()
{
#if DEBUG
HookEvent("weapon_fire", Event_Weapon_Fire);
#endif
}
void Event_Weapon_Fire(Event event, const char[] name, bool dontBroadcast)
{
int client = GetClientOfUserId(event.GetInt("userid"));
if(!IsFakeClient(client))
{
CheckStatus();
}
}
void CheckStatus()
{
for(int i =1; i<=MaxClients; i++)
{
if(!IsClientInGame(i) )
continue;
if(GetClientTeam(i) == 2)
{
char name[64];
GetClientName(i, name, sizeof(name) );
int health = GetEntProp(i, Prop_Send, "m_iHealth");
float buffer = GetTempHealth(i);
int count = GetEntProp(i, Prop_Send, "m_currentReviveCount");
PrintToChatAll("%s#HP:%d, TEMP:%f, REV:%d,", name, health, buffer, count);
PrintToServer("%s#HP:%d, TEMP:%f, REV:%d,", name, health, buffer, count);
}
}
}
Code:
L 03/24/2023 - 19:59:23: [SM] Blaming: test.smx
L 03/24/2023 - 19:59:23: [SM] Call stack trace:
L 03/24/2023 - 19:59:23: [SM] [0] Event.GetInt
L 03/24/2023 - 19:59:23: [SM] [1] Line 90, test.sp::Event_Weapon_Fire
Sorry I seem to have forgotten to paste a lot of important stuff
, the problem is only because of "return;"
Anyway thanks.
__________________