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

Offset 0 Is Invalid..


Post New Thread Reply   
 
Thread Tools Display Modes
retsam
Veteran Member
Join Date: Aug 2008
Location: so-cal
Old 02-06-2010 , 12:45   Re: Offset 0 Is Invalid..
Reply With Quote #11

Could add a debug timer to the plugin or just a PrintToChatAll("Condition is: %d", cond); msg so you can see what conditions are... But that should be the cond for kritz so...
retsam is offline
toazron1
Senior Member
Join Date: Oct 2006
Old 02-06-2010 , 12:46   Re: Offset 0 Is Invalid..
Reply With Quote #12

I'm not sure if it sets cond on bots, the code works, im using it in killers info to check minicrits
__________________
toazron1 is offline
Send a message via AIM to toazron1
retsam
Veteran Member
Join Date: Aug 2008
Location: so-cal
Old 02-06-2010 , 12:51   Re: Offset 0 Is Invalid..
Reply With Quote #13

When people say its safer to use getentprop, why? and how? Ive always used offsets with for example: g_condOffset = FindSendPropInfo("CTFPlayer","m_nPlayerCond") ;

new cond = GetEntData(client, g_condOffset);
retsam is offline
Cooltad
Veteran Member
Join Date: Apr 2008
Old 02-06-2010 , 13:15   Re: Offset 0 Is Invalid..
Reply With Quote #14

Eh, I'll figure it out eventually I guess. Weird..
On a side note, might as well use this thread for yet another purpose.
I use a code to deliver fake crit-hit sounds to normal hit sounds, and here is the 'if's of it..
Code:
    if (IsValidEntity(inflictor))
    {
        GetEdictClassname(inflictor, classname, sizeof(classname));
        if (attacker >0 && attacker <=MaxClients &&
        victim >0 && victim <=MaxClients &&
        attacker !=victim &&
        IsClientInGame(attacker) && IsClientInGame(victim) &&
        !(IsFakeClient(attacker) ||
        (damagetype & (DMG_ACID | DMG_BURN)) ||
        StrEqual(classname, "obj_sentrygun")))
        {
Now then, a singular thing wrong with this, is that when using the rocket launcher on a member of your own team you get the sound, even though your own team probably obviously isn't a victim. Any ideas? I think it only happens when firing at a bot.

And yes, to remove all errors rare or not, I did have to use all those conditions.
__________________
Please, give me some rep if you found what I posted useful. :]

Last edited by Cooltad; 02-06-2010 at 13:18.
Cooltad is offline
toazron1
Senior Member
Join Date: Oct 2006
Old 02-06-2010 , 13:22   Re: Offset 0 Is Invalid..
Reply With Quote #15

Does the same thing happen for demo stickies?
__________________
toazron1 is offline
Send a message via AIM to toazron1
Cooltad
Veteran Member
Join Date: Apr 2008
Old 02-06-2010 , 13:46   Re: Offset 0 Is Invalid..
Reply With Quote #16

Not sure, what if it does?

It does. And for grenades too.
__________________
Please, give me some rep if you found what I posted useful. :]

Last edited by Cooltad; 02-06-2010 at 13:51.
Cooltad is offline
toazron1
Senior Member
Join Date: Oct 2006
Old 02-06-2010 , 14:35   Re: Offset 0 Is Invalid..
Reply With Quote #17

You have to get the owner of the nade/rocket which is attacking the player since its a separate ent
__________________
toazron1 is offline
Send a message via AIM to toazron1
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 02-06-2010 , 15:01   Re: Offset 0 Is Invalid..
Reply With Quote #18

Quote:
Originally Posted by retsam View Post
When people say its safer to use getentprop, why? and how? Ive always used offsets with for example: g_condOffset = FindSendPropInfo("CTFPlayer","m_nPlayerCond") ;

new cond = GetEntData(client, g_condOffset);
Because read the docs for it.
Fyren is offline
Sammy-ROCK!
Senior Member
Join Date: Jun 2008
Location: Near Mrs.Lag
Old 02-06-2010 , 16:10   Re: Offset 0 Is Invalid..
Reply With Quote #19

Quote:
Originally Posted by toazron1 View Post
I think IsClientInGame checks for validity so you don't need to check outside of MaxClients or worldspawn.
It returns errors on invalid client index.
Sammy-ROCK! is offline
toazron1
Senior Member
Join Date: Oct 2006
Old 02-06-2010 , 16:55   Re: Offset 0 Is Invalid..
Reply With Quote #20

Quote:
Originally Posted by Sammy-ROCK! View Post
It returns errors on invalid client index.
Couldn't remember if it did or not. Thanks. So yes, the validity checks are needed
__________________
toazron1 is offline
Send a message via AIM to toazron1
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 11:48.


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