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

Hp bonus compilation problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Divin12
Senior Member
Join Date: Nov 2011
Old 12-04-2016 , 05:31   Hp bonus compilation problem
Reply With Quote #1

PHP Code:
public OnBonusHPChange(Handle:hCvar, const String:oldValue[], const String:newValue[])
{    

    
g_iCvar_HP GetConVarInt(hCvar);
    

I can't compile this I tried in different mods but without succes, error is: Error 147...New-Style declarations are required.
__________________
Divin12 is offline
cravenge
Veteran Member
Join Date: Nov 2015
Location: Chocolate Factory
Old 12-04-2016 , 07:04   Re: Hp bonus compilation problem
Reply With Quote #2

Should be:

PHP Code:
public void OnBonusHPChange(ConVar hCvar, const char[] oldValue, const char[] newValue
{
    
g_iCvar_HP hCvar.IntValue;   

Btw, you're compiling new syntax with old syntax code. Not good.
cravenge is offline
Divin12
Senior Member
Join Date: Nov 2011
Old 12-04-2016 , 10:57   Re: Hp bonus compilation problem
Reply With Quote #3

Thanks! Function for givemoney ex: GiveMoney(int client, int value); is avabile? I tryed to search it but without succes
__________________

Last edited by Divin12; 12-04-2016 at 10:58.
Divin12 is offline
quake84
Junior Member
Join Date: Aug 2014
Location: Poland
Old 12-04-2016 , 11:15   Re: Hp bonus compilation problem
Reply With Quote #4

You'll have to create a new function that will take the current money of the player, add the specified amount and set it back, since there is no such function in SourceMod by default.
__________________
...
quake84 is offline
Divin12
Senior Member
Join Date: Nov 2011
Old 12-04-2016 , 11:21   Re: Hp bonus compilation problem
Reply With Quote #5

Maybe someone can help me with this! Thanks.
__________________
Divin12 is offline
nhnkl159
Senior Member
Join Date: Jul 2012
Location: Israel 3>
Old 12-04-2016 , 13:43   Re: Hp bonus compilation problem
Reply With Quote #6

Quote:
Originally Posted by Divin12 View Post
Maybe someone can help me with this! Thanks.

Code:
void GiveMoney(int client, int money)
{
	int currentmoney = GetEntData(client, FindSendPropInfo("CCSPlayer", "m_iAccount"));
	SetEntData(client, FindSendPropInfo("CCSPlayer", "m_iAccount"), currentmoney+money);
}
You can try this function , I hadn't checked it.
__________________
nhnkl159 is offline
Send a message via Skype™ to nhnkl159
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 04:26.


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