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

2 menu & IsDead() Prob


Post New Thread Reply   
 
Thread Tools Display Modes
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 08-04-2006 , 17:41   Re: 2 menu & IsDead() Prob
Reply With Quote #11

See? That makes it so much easier. You are never setting pInfo.

You need something like
Code:
 pInfo= m_PlayerInfo->GetPlayerInfo(pEntity);
It's crashing because pInfo is null and you are trying to call functions on it.
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
sslice
Senior Member
Join Date: Feb 2005
Location: Texas, USA
Old 08-04-2006 , 22:29   Re: 2 menu & IsDead() Prob
Reply With Quote #12

Hmm, you need a valid pointer to IServerGameClients before using it.
__________________
sslice is offline
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 08-05-2006 , 13:00   Re: 2 menu & IsDead() Prob
Reply With Quote #13

You need a valid pointer to the server game clients interface instead of just creating a pointer that doesn't point anywhere.

First declare a gameclients pointer in your plugin (either a global variable or in your class header):
Code:
IServerGameClients *m_ServerClients;
Then when your plugin loads get a pointer like you do for the engine pointer:
using Metamod: Source
Code:
strcpy(iface_buffer, INTERFACEVERSION_SERVERGAMECLIENTS);
FIND_IFACE(serverFactory, m_ServerClients, num, iface_buffer, IServerGameClients *);
using the Valve Server Plugin interface
Code:
m_ServerClients = (IServerGameClients *)interfaceFactory(INTERFACEVERSION_SERVERGAMECLIENTS,NULL));
EDIT: I haven't tested it, but you might need to use gameServerFactory instead of interfaceFactory. Check for a valid pointer [ if(m_ServerGameClients) ] from each one to determine which is correct.


Then try your test command again:
Code:
if(FStrEq(pcmd,"jean"))
    {
        Warning("deadflag = %d\n", m_ServerClients->GetPlayerState(pEntity)->deadflag);
    }

Last edited by L. Duke; 08-05-2006 at 13:07.
L. Duke 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 04:22.


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