Raised This Month: $32 Target: $400
 8% 

[Help] ent


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 12-09-2018 , 12:40   [Help] ent
Reply With Quote #1

Quote:
L 12/09/2018 - 18:28:21: [FAKEMETA] Invalid entity
L 12/09/2018 - 18:28:21: [AMXX] Displaying debug trace (plugin "jailbreak_ball.amxx", version "2.1")
L 12/09/2018 - 18:28:21: [AMXX] Run time error 10: native error (native "pev")
L 12/09/2018 - 18:28:21: [AMXX] [0] jailbreak_ball.sma::FwdTouch (line 89
Code:
public FwdTouch(ent, id) 
{ 
	static szNameEnt[32], szNameId[32] 
	pev(ent, pev_classname, szNameEnt, sizeof szNameEnt - 1) 
	pev(id, pev_classname, szNameId, sizeof szNameId - 1) 
	 
	static Float:fGameTime 
	fGameTime = get_gametime() 
	 
	if(equal(szNameEnt, "JailNet") && equal(szNameId, g_szBallName) && (fGameTime - g_fLastTouch) > 0.1) 
	{ 
		Goal() 
		g_fLastTouch = fGameTime 
	}
}
Should I do a test of pev ENT?

Last edited by Fuck For Fun; 12-09-2018 at 14:06.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 12-09-2018 , 12:57   Re: [Help] ent
Reply With Quote #2

Show how you are registering the touch. If that is good, I would just add a pev_valid() test on ent at the very top.
__________________
Bugsy is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 12-09-2018 , 13:02   Re: [Help] ent
Reply With Quote #3

Quote:
Originally Posted by Bugsy View Post
Show how you are registering the touch. If that is good, I would just add a pev_valid() test on ent at the very top.
ok...
Code:
register_forward(FM_Touch, "FwdTouch", 0)
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
Natsheh
Veteran Member
Join Date: Sep 2012
Old 12-09-2018 , 13:49   Re: [Help] ent
Reply With Quote #4

As bugsy said check if ent and id are greater than 0
__________________
@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
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 12-09-2018 , 14:08   Re: [Help] ent
Reply With Quote #5

Quote:
Originally Posted by Natsheh View Post
As bugsy said check if ent and id are greater than 0
Yes I know, I just wanted to know if that was the way so I wrote it down in the first post under the code.
Quote:
if(!pev_valid(ent))
return FMRES_IGNORED

Last edited by Fuck For Fun; 12-09-2018 at 14:09.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 12-09-2018 , 19:34   Re: [Help] ent
Reply With Quote #6

still error
Code:
public FwdTouch(ent, id) 
{
	if(!pev_valid(ent))
		return FMRES_IGNORED
		
	static szNameEnt[32], szNameId[32] 
	pev(ent, pev_classname, szNameEnt, sizeof szNameEnt - 1) 
	pev(id, pev_classname, szNameId, sizeof szNameId - 1)  // line 902
	 
	static Float:fGameTime 
	fGameTime = get_gametime() 
	 
	if(equal(szNameEnt, "JailNet") && equal(szNameId, g_szBallName) && (fGameTime - g_fLastTouch) > 0.1) 
	{ 
		Goal() 
		g_fLastTouch = fGameTime 
	}
	
	return FMRES_IGNORED
}
Quote:
L 12/10/2018 - 01:16:00: [FAKEMETA] Invalid entity
L 12/10/2018 - 01:16:00: [AMXX] Run time error 10: native error (native "pev")
L 12/10/2018 - 01:16:00: [AMXX] [0] jailbreak_ball.sma::FwdTouch (line 902)
im using 1.9.0 amxx
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 12-09-2018 , 19:59   Re: [Help] ent
Reply With Quote #7

Think about it.. If it is saying the line being called on 'id' is resulting in an invalid entity error, this means you should also put a check on the entity associated with 'id'.
PHP Code:
if ( !pev_valident ) || !pev_validid ) )
        return 
FMRES_IGNORED 
__________________

Last edited by Bugsy; 12-09-2018 at 20:01.
Bugsy 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 21:06.


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