Monthly Target: $400 Donations: $
 0% 

[TF2] Increase Max Health of Player?


Post New Thread Reply   
 
Thread Tools Display Modes
ReFlexPoison
☠☠☠
Join Date: Jul 2011
Old 03-05-2013 , 16:48   Re: [TF2] Increase Max Health of Player?
Reply With Quote #21

Quote:
Originally Posted by Marcus101RR View Post
I hate SDKHooks so much
Are you okay?
__________________
ReFlexPoison is offline
11530
Veteran Member
Join Date: Sep 2011
Location: Underworld
Old 03-05-2013 , 17:15   Re: [TF2] Increase Max Health of Player?
Reply With Quote #22

Quote:
Originally Posted by Marcus101RR View Post
I hate SDKHooks so much
If you hate SDKHooks, then you're doing it wrong. Whatever it is.
__________________
11530 is offline
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 03-05-2013 , 17:16   [TF2] Increase Max Health of Player?
Reply With Quote #23

Quote:
Originally Posted by 11530 View Post
If you hate SDKHooks, then you're doing it wrong. Whatever it is.
Aye.
__________________
Dr. McKay is offline
Marcus101RR
Veteran Member
Join Date: Aug 2009
Location: Florida, Tampa
Old 03-07-2013 , 20:02   Re: [TF2] Increase Max Health of Player?
Reply With Quote #24

That's not even the quote from my post...who on earth are you quoteing?
__________________
Marcus101RR is offline
Send a message via AIM to Marcus101RR Send a message via Skype™ to Marcus101RR
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 03-07-2013 , 20:09   Re: [TF2] Increase Max Health of Player?
Reply With Quote #25

https://forums.alliedmods.net/showpo...5&postcount=20
__________________
hleV is offline
Afronanny
Veteran Member
Join Date: Aug 2009
Old 03-08-2013 , 09:04   Re: [TF2] Increase Max Health of Player?
Reply With Quote #26

Quote:
Originally Posted by Oshizu View Post
I'm trying to add attribute to player using signature
CTFPlayer::AddPlayerAttribute(CEconItemAttrib ute *)
but i'm not sure what value i'm suppose to add or how it should look like
PHP Code:
#include <sourcemod>
#include <sdktools>
 
new Handle:hGameConf;
new 
Handle:hGiveAttribute;

public 
Plugin:myinfo =
{
    
name "[TF2] Attribute Add",
    
author "Oshizu",
    
description "Test",
    
version "0.1d",
    
url "none"
};
 
public 
OnPluginStart()
{

    
hGameConf LoadGameConfigFile("oshizu.attribute");
    
StartPrepSDKCall(SDKCall_Player);
    
PrepSDKCall_SetFromConf(hGameConfSDKConf_Signature"CTFPlayer::AddPlayerAttribute");
    
PrepSDKCall_AddParameter(SDKType_PlainOldDataSDKPass_Plain);
    
hGiveAttribute EndPrepSDKCall();
 
    
RegConsoleCmd("sm_maxhealth"SetMaxHealth);
}

public 
Action:SetMaxHealth(clientargs)
{
 
SDKCall(hGiveAttributeclient"26 500.0");

Gamedata
PHP Code:
"Games"
{
    
/* Team Fortress 2 */
    
"tf"
    
{
        
"Signatures"
        
{
            
"CTFPlayer::AddPlayerAttribute"
            
{
                
"library"            "server"
                "windows"            "\x55\x8B\xEC\x8B\x45\x08\x85\xC0\x74\x2A\x50\x81\xC1\x04\x0A\x00\x00"
                "linux" "@_ZN9CTFPlayer18AddPlayerAttributeEP18CEconItemAttribute"
                "mac" "@_ZN9CTFPlayer18AddPlayerAttributeEP18CEconItemAttribute"
            
}
        }
    }

Seems to crash my server. Probatly line 'SDKCall(hGiveAttribute, client, "26 500.0");' is incorrectly made.
You can't use that function in an SDKCall. If you look at the linux symbol, the function prototype is actually "CTFPlayer::AddPlayerAttribute(CEconItemAttri bute *)"

The reason that code is crashing your server is because you're trying to pass a string when the function is expecting a CEconItemAttribute* as the argument, which you cannot create in SourcePawn.

Last edited by Afronanny; 03-08-2013 at 09:05.
Afronanny is offline
FlaminSarge
Veteran Member
Join Date: Jul 2010
Old 03-08-2013 , 16:02   Re: [TF2] Increase Max Health of Player?
Reply With Quote #27

You could probably make another SDKCall to create a CEconItemAttribute and then pass its address to AddPlayerAttribute, but in any case that's not necessary.
https://forums.alliedmods.net/showthread.php?t=210221
TF2Attrib_SetByName(client, "max health additive bonus", 500.0);
__________________
Bread EOTL GunMettle will break everything. Don't even ask.

All plugins: Randomizer/GiveWeapon, ModelManager, BetheHorsemann, etc. (+SaxtonHale)
Don't ask me about SourceMod stuff on Steam; instead, post in a thread or send PM here. You will be fed to javalia if you don't.
Psyduck likes replays.
FlaminSarge is offline
Reply


Thread Tools
Display Modes

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 05:46.


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