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

native error (native "SetHamParamFloat"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
gustavo254
New Member
Join Date: Feb 2022
Old 02-11-2022 , 18:59   native error (native "SetHamParamFloat"
Reply With Quote #1

Problem:
HTML Code:
L 02/06/2022 - 00:50:48: [HAMSANDWICH] Wrong data type (data is of type entity)
L 02/06/2022 - 00:50:48: [AMXX] Displaying debug trace (plugin "jail_zyczenia.amxx", version "1.0.7L")
L 02/06/2022 - 00:50:48: [AMXX] Run time error 10: native error (native "SetHamParamFloat")
L 02/06/2022 - 00:50:48: [AMXX]    [0] jail_zyczenia.sma::vTracerAttack (line 746)
L 02/06/2022 - 00:50:48: [AMXX]    [1] jail_zyczenia.sma::TraceAttack (line 725)
after this server shutting down with this error:
HTML Code:
ERROR : IndexOfEdict: bad entity
Code:
HTML Code:
public TakeDamage(id, ent, attacker, Float:damage, damagebits)
	return vTracerAttack(id, attacker, ent);

public TraceAttack(id, attacker, Float:damage, Float:direction[3], tracehandle, damagebits)
	return vTracerAttack(id, attacker, -1);

vTracerAttack(id, attacker, ent)
{
if(!pojedynek[0] || !is_user_connected(id) || id == attacker)
	return HAM_IGNORED;
	
	if((kandydaci_pojedynek[0] == id || kandydaci_pojedynek[1] == id) && czas_do_pojedynku > 0) {
		return HAM_SUPERCEDE;
	}
	if(pojedynek[0] == id && pojedynek[1] != attacker)
		return HAM_SUPERCEDE;
	
	if(pojedynek[0] == attacker && pojedynek[1] != id)
		return HAM_SUPERCEDE;	
	if(is_user_connected(attacker)) {/*
		if(typ_pojedynku == 1 && get_pdata_int(id, 75, 5) != HIT_HEAD) {
			return HAM_SUPERCEDE;
		}
		*/
		if(typ_pojedynku == 2) {
			SetHamParamFloat(4, 999.0);
			return HAM_HANDLED;
		}
		
		if(bronie_pojedynek == CSW_KNIFE && ent != -1 && !kosy)
		{
			if(ent == attacker)
				return HAM_SUPERCEDE;
			
			new Float:ViewAngle[3], iOrigin[3];
			for(new i=0; i<3; i++) 
				ViewAngle[i] = random_float(-50.0, 50.0);
			
			get_user_origin(id, iOrigin);
			message_begin(MSG_BROADCAST, SVC_TEMPENTITY);
			write_byte(TE_BLOODSPRITE);
			write_coord(iOrigin[0]);
			write_coord(iOrigin[1]);
			write_coord(iOrigin[2]);
			write_short(blood2);
			write_short(blood);
			write_byte(229);
			write_byte(25);
			message_end();
			
			set_pev(id, pev_punchangle, ViewAngle);
			SetHamParamEntity(2, attacker);
			return HAM_IGNORED;
		}
	}
	return HAM_IGNORED;
}
725: return vTracerAttack(id, attacker, -1);
746: SetHamParamFloat(4, 999.0);
* bold text is 725 line and 746 in .sma file (from error log)
gustavo254 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 02-12-2022 , 07:25   Re: native error (native "SetHamParamFloat"
Reply With Quote #2

You can't use SetHamParam* in a function that isn't a ham hook.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
gustavo254
New Member
Join Date: Feb 2022
Old 02-12-2022 , 07:53   Re: native error (native "SetHamParamFloat"
Reply With Quote #3

Quote:
Originally Posted by OciXCrom View Post
You can't use SetHamParam* in a function that isn't a ham hook.
okay, but how i can repair this? any ideas? im a newbie

@edit nevermind, i just delete this from plugin and use code from my friend:
Quote:
public forward_traceline(Float:v1[3], Float:v2[3], noMonsters, pentToSkip)
{
if(!is_user_alive(pentToSkip))
return FMRES_IGNORED

static entity2 ; entity2 = get_tr(TR_pHit)
if(!is_user_alive(entity2))
return FMRES_IGNORED

if(pentToSkip == entity2)
return FMRES_IGNORED

if(get_tr(TR_iHitgroup) != 1) {
set_tr(TR_flFraction,1.0)
return FMRES_SUPERCEDE
}
return FMRES_IGNORED
}

public TakeDamage(id, ent, attacker, Float:damage, damagebits)
return vTracerAttack(id, attacker);

public TraceAttack(id, attacker, Float:damage, Float:direction[3], tracehandle, damagebits)
return vTracerAttack(id, attacker);

vTracerAttack(id, attacker)
{
if(!pojedynek[0] || !is_user_connected(id) || !is_user_connected(attacker) || id == attacker)
return HAM_IGNORED;

if(pojedynek[0] == id && pojedynek[1] != attacker)
return HAM_SUPERCEDE;

if(pojedynek[0] == attacker && pojedynek[1] != id)
return HAM_SUPERCEDE;
return HAM_IGNORED;
}

Last edited by gustavo254; 02-13-2022 at 07:55.
gustavo254 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 00:08.


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