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

[TF2] Bad entity in IndexOfEdict()


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
thacursedpie
Member
Join Date: May 2008
Old 06-18-2009 , 11:54   [TF2] Bad entity in IndexOfEdict()
Reply With Quote #1

I get the following error when I run my own plugin:
"Bad entity in IndexOfEdict() index -1487468 pEdict 0F0B0FA0 sv.edicts 10D10010"

I know it's the following piece of code that causes this, since it didn't give the error with previous versions (without that piece of code)

Code:
// Global
new Handle:ammoOffset;
new Handle:clipOffset;

public OnPluginStart() {
ammoOffset = FindSendPropInfo("CTFPlayer", "m_iAmmo");
clipOffset = FindSendPropInfo("CTFWeaponBase", "m_iClip1");
}
// The actual piece of code
for(new i=1;i<=MaxClients;i++) {
        if(IsClientConnected(i) && IsClientInGame(i) && IsPlayerAlive(i)) {
for (new n = 1; n < 4; n++)
                {
                    SetEntData(i, ammoOffset + (n * 4), 0);
                }

                // Set their current weapon clips to 1
                if ((GetEntData(GetPlayerWeaponSlot(i, 0), 4)) > 1)    {
                    for (new n = 0; i < n; n++)
                    {
                        SetEntData(GetPlayerWeaponSlot(i, n), clipOffset, 1);
                    }
                }
}
I chopped away all the unnecesary stuff.
}
thacursedpie is offline
CrimsonGT
Veteran Member
Join Date: Oct 2007
Location: Gainesville, FL
Old 06-18-2009 , 16:08   Re: [TF2] Bad entity in IndexOfEdict()
Reply With Quote #2

Put a IsValidEdict(n) inside the for loop.
__________________
CrimsonGT is offline
thacursedpie
Member
Join Date: May 2008
Old 06-19-2009 , 11:40   Re: [TF2] Bad entity in IndexOfEdict()
Reply With Quote #3

That ought to work, thanks a lot!
thacursedpie is offline
Svrale
New Member
Join Date: Apr 2010
Old 04-17-2010 , 11:42   Re: [TF2] Bad entity in IndexOfEdict()
Reply With Quote #4

I need help
I can not find this error on any forum

Bad entity in IndexOfEdict() index 72412021 pEdict 66616544 sv.edicts 100F0010

Please help someone
Svrale 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 07:33.


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