Raised This Month: $51 Target: $400
 12% 

[L4D]How do u modify the max HP/Ammo, or Is it a plugin?


Post New Thread Reply   
 
Thread Tools Display Modes
fronjohn
Junior Member
Join Date: Apr 2010
Old 04-17-2010 , 22:31   Re: [L4D]How do u modify the max HP/Ammo, or Is it a plugin?
Reply With Quote #11

so how do i put that code in to l4d to make the clients work?
fronjohn is offline
fronjohn
Junior Member
Join Date: Apr 2010
Old 05-15-2010 , 14:37   Re: [L4D]How do u modify the max HP/Ammo, or Is it a plugin?
Reply With Quote #12

sorry for reposting this but i really want to know how to put that code in to l4d to make the clients work? Thanks
fronjohn is offline
HL-SDK
Member
Join Date: Jan 2009
Old 05-15-2010 , 16:33   Re: [L4D]How do u modify the max HP/Ammo, or Is it a plugin?
Reply With Quote #13

Quote:
Originally Posted by dirka_dirka View Post
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 View Post
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 1client <= MaxClientsclient++) {
    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 <------------------------
HL-SDK is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:56.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode