Raised This Month: $ Target: $400
 0% 

How do i fix those 4 errors caused by the same line of code?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GlobalPlague
Senior Member
Join Date: Feb 2016
Location: Pluto
Old 03-15-2022 , 08:09   How do i fix those 4 errors caused by the same line of code?
Reply With Quote #1

Hello. I'm trying to add health regeneration ability to the Boomer zombie class.

I transferred some codes from the .sma file of the regeneration zombie to the .sma file of the boomer zombie. One of the code causes some problems.

The following errors:

// C:\Mod\cstrike\addons\amxmodx\scripting\zp_zc lass_boomer.sma(107) : error 017: undefined symbol "set_pev"
// C:\Mod\cstrike\addons\amxmodx\scripting\zp_zc lass_boomer.sma(107) : error 001: expected token: ";", but found ")"
// C:\Mod\cstrike\addons\amxmodx\scripting\zp_zc lass_boomer.sma(107) : error 029: invalid expression, assumed zero
// C:\Mod\cstrike\addons\amxmodx\scripting\zp_zc lass_boomer.sma(107) : fatal error 107: too many error messages on one line


Are caused by the line 107 in this code (the line is marked in red):

Code:
public Regenerate(player)
{
	if (!get_pcvar_num(g_zclass_regen_toggle) || !is_user_alive(player) || !zp_get_user_zombie(player))
	return PLUGIN_CONTINUE
	
	if (zp_get_user_zombie_class(player) != g_zclass_Regen)
	return PLUGIN_CONTINUE
	
	new regen_health = get_user_health(player)
	new max_health = zp_get_zombie_maxhealth(player) - regen_health
	
	if (max_health <= get_pcvar_num(g_amount))
	{
		set_pev(player, pev_health, regen_health + float(max_health))
		remove_task(player)
	}
	
	set_pev(player, pev_health, regen_health + get_pcvar_float(g_amount))
	
	return PLUGIN_CONTINUE
}
Can someone explain to me why does this line causes these errors? I don't see anything wrong with the line. It works when used in the Regeneration zombie, but doesn't work when inserted in the .sma file of the Boomer zombie.

Would someone explain to he how to fix this error?

Last edited by GlobalPlague; 03-15-2022 at 08:12.
GlobalPlague is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 03-15-2022 , 08:58   Re: How do i fix those 4 errors caused by the same line of code?
Reply With Quote #2

Include fakemeta
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]
Shadows Adi is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 03-15-2022 , 11:11   Re: How do i fix those 4 errors caused by the same line of code?
Reply With Quote #3

Please start reading the error message.
Please start searching for the errors in the millions of already existing topics.
Please stop opening useless topics that can be answered by one minute of searching.
__________________
HamletEagle 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:15.


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