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

[FAKEMETA] Invalid entity set_pev


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 05-05-2020 , 18:33   [FAKEMETA] Invalid entity set_pev
Reply With Quote #1

I create a C4 game that can be seen and hovered in the air at UNITS distance, but while being shot or touched it disappears
Code:
L 05/06/2020 - 00:03:43: [FAKEMETA] Invalid entity
L 05/06/2020 - 00:03:43: [AMXX] Displaying debug trace (plugin "take_away_bomb.amxx", version "1.0")
L 05/06/2020 - 00:03:43: [AMXX] Run time error 10: native error (native "set_pev")
L 05/06/2020 - 00:03:43: [AMXX]    [0] take_away_bomb.sma::HandleUpdateOwnerTask (line 294)
Question * If anyone can add me as I shoot it, it will fly in the FLOAT air?
Code:
public pfnSetModel_Post(this, const szModel[])
{
	if (!g_bTakeAwayBomb)
		return;

	if (!FClassnameIs(this, "weaponbox"))
		return;

	new pItem = GetWeaponBoxItem(this);

	if (pItem == -1)
		return;

	if (cs_get_weapon_id(pItem) != CSW_C4)
		return;

	new iColor[3], pOwner;

	pOwner = pev(this, pev_owner);

	if (pOwner != g_pGuard && pOwner != g_pPrisoner)
		return;

	engfunc(EngFunc_SetSize, this, Float:{ -5.22, -2.94, 0.0 }, Float:{ 5.22, 2.94, 6.85 });
	
	set_pev(this, pev_takedamage, DAMAGE_YES);
	set_pev(this, pev_solid, SOLID_BBOX);
	set_pev(this, pev_iuser4, pOwner);

	switch (get_user_team(pOwner))
	{
		case 1:
			iColor = { 200, 0, 0 };

		case 2:
			iColor = { 0, 0, 200 };
	}

	set_rendering(this, kRenderFxGlowShell, iColor[0], iColor[1], iColor[2], kRenderNormal, 25);

	set_task(0.1, "HandleUpdateOwnerTask", this);
}

public HandleUpdateOwnerTask(this) // error here
{
	set_pev(this, pev_owner, 0);
}

Last edited by Fuck For Fun; 05-05-2020 at 18:34.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
Natsheh
Veteran Member
Join Date: Sep 2012
Old 05-05-2020 , 22:29   Re: [FAKEMETA] Invalid entity set_pev
Reply With Quote #2

Basically the entity is getting killed give it godmode and increase its health
__________________
@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 05-05-2020 , 22:52   Re: [FAKEMETA] Invalid entity set_pev
Reply With Quote #3

Quote:
Originally Posted by Natsheh View Post
Basically the entity is getting killed give it godmode and increase its health
something like that? no take damage of ent
Code:
set_pev(this, pev_owner, pev_takedamage, 0.0);
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
Smilex_Gamer
Senior Member
Join Date: Apr 2017
Location: Portugal
Old 05-06-2020 , 05:09   Re: [FAKEMETA] Invalid entity set_pev
Reply With Quote #4

Quote:
Originally Posted by Fuck For Fun View Post
something like that? no take damage of ent
Code:
set_pev(this, pev_owner, pev_takedamage, 0.0);
I think this is how you set it to take no damage:

Code:
set_pev(this, pev_takedamage, DAMAGE_NO);
Check if the entity is invalid:

Code:
public HandleUpdateOwnerTask(this)
{
	if(!pev_valid(this)) return FMRES_IGNORED;

	set_pev(this, pev_owner, 0);
}
Smilex_Gamer is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 05-06-2020 , 05:23   Re: [FAKEMETA] Invalid entity set_pev
Reply With Quote #5

@Smilex_Gamer
Quote:
L 05/06/2020 - 12:27:23: [FAKEMETA] Invalid entity
L 05/06/2020 - 12:27:23: [AMXX] Displaying debug trace (plugin "jb_lr_take_away_bomb.amxx", version "1.0")
L 05/06/2020 - 12:27:23: [AMXX] Run time error 10: native error (native "set_pev")
L 05/06/2020 - 12:27:23: [AMXX] [0] jb_lr_take_away_bomb.sma::HandleUpdateOwnerTa sk (line 294)
Code:
public HandleUpdateOwnerTask(this)
{
	if(!pev_valid(this)) return FMRES_IGNORED; // error
	//set_pev(this, pev_owner, 0);
	set_pev(this, pev_takedamage, DAMAGE_NO);
	
	return HAM_IGNORED;
}

Last edited by Fuck For Fun; 05-06-2020 at 05:24.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
Smilex_Gamer
Senior Member
Join Date: Apr 2017
Location: Portugal
Old 05-06-2020 , 05:35   Re: [FAKEMETA] Invalid entity set_pev
Reply With Quote #6

Quote:
Originally Posted by Fuck For Fun View Post
@Smilex_Gamer

Code:
public HandleUpdateOwnerTask(this)
{
	if(!pev_valid(this)) return FMRES_IGNORED; // error
	//set_pev(this, pev_owner, 0);
	set_pev(this, pev_takedamage, DAMAGE_NO);
	
	return HAM_IGNORED;
}
I was saying to set it to take no damage inside the function "pfnSetModel_Post".
Also, why are you returning "HAM_IGNORED" when we aren't using hamsandwich?
Smilex_Gamer is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 05-06-2020 , 05:51   Re: [FAKEMETA] Invalid entity set_pev
Reply With Quote #7

Quote:
Originally Posted by Smilex_Gamer View Post
I was saying to set it to take no damage inside the function "pfnSetModel_Post".
Also, why are you returning "HAM_IGNORED" when we aren't using hamsandwich?
I probably forgot to put what I did.
So within "pfnSetModel_Post"


You want me to undo and change DAMAGE YES.
PHP Code:
set_pev(thispev_takedamageDAMAGE_YES); 
->
PHP Code:
set_pev(thispev_takedamageDAMAGE_NO); 
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
Smilex_Gamer
Senior Member
Join Date: Apr 2017
Location: Portugal
Old 05-06-2020 , 06:17   Re: [FAKEMETA] Invalid entity set_pev
Reply With Quote #8

Quote:
Originally Posted by Fuck For Fun View Post
I probably forgot to put what I did.
So within "pfnSetModel_Post"


You want me to undo and change DAMAGE YES.
PHP Code:
set_pev(thispev_takedamageDAMAGE_YES); 
->
PHP Code:
set_pev(thispev_takedamageDAMAGE_NO); 
Yes, within "pfnSetModel_Post" change that and within "HandleUpdateOwnerTask" you need to add that little piece of code before anything in order to check if the entity is valid, preventing errors from appearing when it uses an invalid entity.

P.S: That piece of code I'm talking about is this one:
Code:
if(!pev_valid(this)) return FMRES_IGNORED;

Last edited by Smilex_Gamer; 05-06-2020 at 06:19.
Smilex_Gamer is offline
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 05-06-2020 , 06:24   Re: [FAKEMETA] Invalid entity set_pev
Reply With Quote #9

Quote:
Originally Posted by Smilex_Gamer View Post
Yes, within "pfnSetModel_Post" change that and within "HandleUpdateOwnerTask" you need to add that little piece of code before anything in order to check if the entity is valid, preventing errors from appearing when it uses an invalid entity.

P.S: That piece of code I'm talking about is this one:
Code:
if(!pev_valid(this)) return FMRES_IGNORED;
Got it.
HTML Code:
public pfnSetModel_Post(this, const szModel[])
{
	if (!g_bTakeAwayBomb)
		return;

	if (!FClassnameIs(this, "weaponbox"))
		return;

	new pItem = GetWeaponBoxItem(this);

	if (pItem == -1)
		return;

	if (cs_get_weapon_id(pItem) != CSW_C4)
		return;

	new iColor[3], pOwner;

	pOwner = pev(this, pev_owner);

	if (pOwner != g_pGuard && pOwner != g_pPrisoner)
		return;

	engfunc(EngFunc_SetSize, this, Float:{ -5.22, -2.94, 0.0 }, Float:{ 5.22, 2.94, 6.85 });
	
	//set_pev(this, pev_takedamage, DAMAGE_YES);
	set_pev(this, pev_takedamage, DAMAGE_NO);
	set_pev(this, pev_solid, SOLID_BBOX);
	set_pev(this, pev_iuser4, pOwner);
	

	switch (get_user_team(pOwner))
	{
		case 1:
			iColor = { 200, 0, 0 };

		case 2:
			iColor = { 0, 0, 200 };
	}

	set_rendering(this, kRenderFxGlowShell, iColor[0], iColor[1], iColor[2], kRenderNormal, 25);

	set_task(0.1, "HandleUpdateOwnerTask", this);
}

public HandleUpdateOwnerTask(this)
{
	if(!pev_valid(this)) return FMRES_IGNORED;
	set_pev(this, pev_owner, 0);
}
EDIT: Thanks you, finally It doesn't go away that it touches the wall or I'm standing on it

Last edited by Fuck For Fun; 05-06-2020 at 06:26.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 05-08-2020 , 11:17   Re: [FAKEMETA] Invalid entity set_pev
Reply With Quote #10

Quote:
Originally Posted by Fuck For Fun View Post
Question * If anyone can add me as I shoot it, it will fly in the FLOAT air?
Do you still need the fly float in the air when attacked?
__________________
DJEarthQuake 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 05:38.


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