Nice job for your first released plugin.
Some things I noticed.
PHP Code:
new ent = -1;
new prev = 0;
while ((ent = FindEntityByClassname(ent, "hostage_entity")) != -1)
{
if (prev) Hostage(prev);
prev = ent;
}
if (prev) Hostage(prev);
You can simplify this. You just need ent since prev isn't going to be deleted (like the example you saw)
PHP Code:
new ent = -1;
while ((ent = FindEntityByClassname(ent, "hostage_entity")) != -1)
{
if (ent) Hostage(ent);
}
PHP Code:
public Event_HostageFollows(Handle:event, const String:name[], bool:dontBroadcast)
{
new client = GetClientOfUserId(GetEventInt(event, "userid"));
new hostage = GetEventInt(event, "hostage");
new health = GetEntProp(hostage, Prop_Data, "m_iHealth", 1);
if(GetConVarInt(cvar_showhp) == 1 && GetConVarInt(cvar_god) == 0)
{
PrintToChat(client, "\x01Hostage health \x04%i\x01HP", health);
}
}
Since you don't always need client, hostage or health you should check the cvars first then grab them if you need to.
Everything else looks good. Once the changes are made ill approve it.