Raised This Month: $ Target: $400
 0% 

[FAKEMETA] Invalid entity set_pev


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
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 #1

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 #2

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
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 17:13.


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