Raised This Month: $ Target: $400
 0% 

Problem with amxx version change.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mikka
Member
Join Date: Dec 2018
Old 11-10-2019 , 14:36   Problem with amxx version change.
Reply With Quote #1

Hello, I have a certain code and it worked on amxx 1.8.3 unfortunately for many reasons I was forced to change the amxx to version 1.9.

[HAMSANDWICH] Wrong data type (data is of type entity)
L 11/10/2019 - 09:05:08: [AMXX] Displaying debug trace (plugin "jbxtreme_wishes.amxx", version "1.00a")
L 11/10/2019 - 09:05:08: [AMXX] Run time error 10: native error (native "SetHamParamFloat")
L 11/10/2019 - 09:05:08: [AMXX] [0] jbxtreme_wishes.sma::vTracerAttack (line 992)
L 11/10/2019 - 09:05:08: [AMXX] [1] jbxtreme_wishes.sma::TraceAttack (line 939)

line 992: SetHamParamFloat(4, 999.0);
line 939: return vTracerAttack(id, attacker, -1);

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;
}
Mikka is offline
iNvectus
Member
Join Date: Sep 2014
Location: Bulgaria
Old 11-10-2019 , 16:21   Re: Problem with amxx version change.
Reply With Quote #2

At
Code:
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;

you have set the second parameter of
Code:
SetHamParamEntity(2, attacker);

as attacker id or entity id aka a player id. It expects a float value, not id of entity.

PS:

Ignore my post... Now that I've read what I've written last night... I apologize. It has nothing to do with it. Probably Natseh is right.
__________________

Last edited by iNvectus; 11-11-2019 at 03:31.
iNvectus is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 11-11-2019 , 01:47   Re: Problem with amxx version change.
Reply With Quote #3

Use only SetHamParam... inside the callback function
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 02:57.


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