Quote:
Originally Posted by dirka_dirka
you only posted a tiny bit of code, so your probably only checking client 0 which is the server.
you need to check for all clients and make sure they are valid.. something like:
Code:
for(client = 1; client <= MaxClients; client++) {
if(IsClientInGame(client) && !IsFakeClient(client)) {
if (GetClientTeam(client) != 2) continue;
....
}
}
the clientteam check makes sure its only survivors.. dont want to boost infected health that way do ya? there are cvars to change their health.
now you might want to include bots so remove the isfakeclient check (i just copied/pasted from another source)..
|
Quote:
Originally Posted by fronjohn
Code:
new ClientHealth = RoundFloat((GetEntProp(client,Prop_Send,"m_iHealth")
ClientHealth = ClientHealth + 9001
SetEntProp(client,Prop_Send,"m_iHealth",ClientHealth);
SetEntProp(client,Prop_Send,"m_iMaxHealth",ClientHealth);
I found this code from a thread that AtomicStryker posted about the health for survivors is there any actual plug in for this?
|
PHP Code:
for(client = 1; client <= MaxClients; client++) {
if(IsClientInGame(client) && !IsFakeClient(client)) {
if (GetClientTeam(client) != 2) continue;
new ClientHealth = RoundFloat((GetEntProp(client,Prop_Send,"m_iHealth")
ClientHealth = ClientHealth + 9001
SetEntProp(client,Prop_Send,"m_iHealth",ClientHealth);
SetEntProp(client,Prop_Send,"m_iMaxHealth",ClientHealth);
}
}
Bam.
If you want something like sm_sethealth <playername> <hp>, it will take much more than this. (Targeting system IIRC, etc.)
Or just read people's replies....
https://forums.alliedmods.net/showthread.php?t=73994 <------------------------