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

Delete this.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nakashimakun
Senior Member
Join Date: Feb 2010
Location: England
Old 04-27-2010 , 05:41   Delete this.
Reply With Quote #1

Delete this please.

Last edited by nakashimakun; 04-27-2010 at 18:42.
nakashimakun is offline
FaTony
Veteran Member
Join Date: Aug 2008
Old 04-27-2010 , 06:36   Re: Health implimenting.
Reply With Quote #2

1-2 weeks.
FaTony is offline
nakashimakun
Senior Member
Join Date: Feb 2010
Location: England
Old 04-27-2010 , 06:47   Re: Health implimenting.
Reply With Quote #3

Quote:
Originally Posted by FaTony View Post
1-2 weeks.
Pardon?
nakashimakun is offline
Marcus101RR
Veteran Member
Join Date: Aug 2009
Location: Tampa, FL
Old 04-27-2010 , 10:03   Re: Health implimenting.
Reply With Quote #4

Without Mysql this would take 2 Days to code, maybe 3? Here is a easy simple code:

The code below adds (+5 HP) to your Max Health, which would require you to use "Left 4 Dead" and you need to increase your first_aid_kit heal amount. If this is for another game, then Sorry.

PHP Code:
#pragma semicolon 1 

#include <sourcemod> 
#include <sdktools> 
#include <sdktools_functions>
#include <colors>

#define PLUGIN_VERSION "1.0.5"

public Plugin:myinfo =
{
    
name "Survivor MaxHealth",
    
author "Marcus101RR",
    
description "Change the survivor's MaxHealth.",
    
version PLUGIN_VERSION,
    
url "http://forums.alliedmods.net"
}

new 
iKTotal[MAXPLAYERS 1][2];  // Common Zombie Kills Prev Round
new iKills[MAXPLAYERS 1];
new 
iLevel[MAXPLAYERS 1];
new 
iKGoal[MAXPLAYERS 1];

public 
OnPluginStart()
{
    
CreateConVar("sm_maxhealth_version"PLUGIN_VERSION"MaxHealth Changer Version"FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
    
    
HookEvent("player_first_spawn"event_PlayerSpawn);
    
HookEvent("player_death"event_CommonDeath);
    
HookEvent("map_transition"evtRoundEnd);
    
HookEvent("player_transitioned"event_SetStatus);
    
HookEvent("survivor_rescued"event_Rescued);
}

public 
Action:evtRoundEnd(Handle:event, const String:name[], bool:dontBroadcast)
{
    for (new 
1<= GetMaxClients(); i++) 
    if (
IsClientInGame(i))    
    {
        new 
cKills GetEntProp(iProp_Send"m_checkpointZombieKills");
        
iKTotal[i][0] += cKills;
    }
}

public 
event_CommonDeath(Handle:event, const String:name[], bool:Broadcast
{
    
decl String:iName[MAX_NAME_LENGTH];
    new 
client GetClientOfUserId(GetEventInt(event,"attacker"));
    
    
GetClientName(clientiNamesizeof(iName));
                
    
iKills[client] = iKills[client] + 1;

    
//PrintToChatAll("Kills %d", iKills[client]);
    //PrintToChatAll("Global Kills %d by %s", iKTotal[client][0], iName);
    
    
if (iKills[client] > iKGoal[client]&&GetClientTeam(client) == 2)
    {
        if (
iLevel[client] >= 20)
        {
            
iLevel[client] = 20;
            
SetEntData(clientFindDataMapOffs(client"m_iMaxHealth"), GetEntProp(clientProp_Send"m_iMaxHealth"), 4true);
        }
        
        if (
iLevel[client] < 20)
        {
        
iLevel[client] = iLevel[client] + 1;

        
SetEntData(clientFindDataMapOffs(client"m_iMaxHealth"), GetEntProp(clientProp_Send"m_iMaxHealth") + 54true);
        
SetEntData(clientFindDataMapOffs(client"m_iHealth"), GetEntProp(clientProp_Send"m_iHealth") + 54true);
        
iKills[client] = 0;
        
iKGoal[client] = iKGoal[client] + 5;
        
//PrintToChatAll("Increased Health %d", GetEntProp(client, Prop_Send, "m_iMaxHealth"));
        
CPrintToChatAll("{blue}%s {default}has reached {olive}Level %d."iNameiLevel[client]);
        }
    }
}

public 
event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast
{    
    new 
client GetClientOfUserId(GetEventInt(event,"userid"));
    
SetEntData(clientFindDataMapOffs(client"m_iMaxHealth"), GetEntProp(clientProp_Send"m_iMaxHealth") + iLevel[client] * 54true);
}

public 
event_SetStatus(Handle:event, const String:name[], bool:dontBroadcast
{    
    new 
client GetClientOfUserId(GetEventInt(event,"userid"));
    
SetEntData(clientFindDataMapOffs(client"m_iMaxHealth"), GetEntProp(clientProp_Send"m_iMaxHealth") + iLevel[client] * 54true);
}

public 
event_Rescued(Handle:event, const String:name[], bool:dontBroadcast
{    
    new 
client GetClientOfUserId(GetEventInt(event,"victim"));
    
SetEntData(clientFindDataMapOffs(client"m_iMaxHealth"), GetEntProp(clientProp_Send"m_iMaxHealth") + iLevel[client] * 54true);

Marcus101RR is offline
Send a message via AIM to Marcus101RR Send a message via Skype™ to Marcus101RR
nakashimakun
Senior Member
Join Date: Feb 2010
Location: England
Old 04-27-2010 , 12:48   Re: Health implimenting.
Reply With Quote #5

Thank you very much Marcus101RR This looks exactly what I needed. I just needed the base code as I already have the complete level mod and everything set up with mysql and so forth, and I forgot to mention this is for l4d2.

Sorry about that, I'm working on this plugin with hardly any sleep my buddy just came on im working on it with hes gunna look it over and see what happens.

Thanks very much
NakashimaKun

I'll let you know how it works =)
nakashimakun is offline
FaTony
Veteran Member
Join Date: Aug 2008
Old 04-28-2010 , 07:14   Re: Health implimenting.
Reply With Quote #6

Quote:
Originally Posted by FaTony View Post
1-2 weeks.
I'm slow, yeah, I know.
FaTony is offline
nakashimakun
Senior Member
Join Date: Feb 2010
Location: England
Old 04-28-2010 , 07:28   Re: Health implimenting.
Reply With Quote #7

Quote:
Originally Posted by FaTony View Post
I'm slow, yeah, I know.
Confusing much?
nakashimakun is offline
psychonic

BAFFLED
Join Date: May 2008
Old 04-28-2010 , 07:30   Re: Delete this.
Reply With Quote #8

Quote:
Originally Posted by nakashimakun View Post
Hello,

I'm here wondering how hard would it be to code a system to read from a database your level and give you a max health boost for certain levels. Per say,

-Level 10 + 5 hp
-Level 20 + 10 hp
-Level 30 + 15 hp
-Level 40 + 20 hp
-Level 50 + 25 hp
-Level 60 + 30 hp
-Level 70 + 35 hp
-Level 80 + 40 hp
-Level 90 + 45 hp
-Level 100(Max Level) + 50 hp

So for every ten levels you get an extra 5hp added to your total life so by level 100 you'd have 150hp. Would this be difficult to impliment?

Thanks
NakashimaKun
Please do not remove content from your posts after getting help.
psychonic is offline
nakashimakun
Senior Member
Join Date: Feb 2010
Location: England
Old 04-28-2010 , 08:49   Re: Delete this.
Reply With Quote #9

Quote:
Originally Posted by psychonic View Post
Please do not remove content from your posts after getting help.
Sorry Psychonic. Just wanted this thread deleted thats all. Tho I spose its helpfull for others.

Last edited by nakashimakun; 04-28-2010 at 08:53. Reason: Whoops
nakashimakun is offline
psychonic

BAFFLED
Join Date: May 2008
Old 04-28-2010 , 09:03   Re: Delete this.
Reply With Quote #10

Quote:
Originally Posted by nakashimakun View Post
Tho I spose its helpfull for others.
Only the few that bother with the Search link first, but yes
psychonic 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 18:46.


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