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

IPlayerInfo alternatives


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mooman2
Member
Join Date: Apr 2007
Old 05-02-2007 , 20:28   IPlayerInfo alternatives
Reply With Quote #1

This is for HL2DM.

In a plugin I took advantage of using IPlayerInfo while listening for "client_activate". To use GetPlayerInfo() to get that, I would pass the "userid" parameter as an int to engine->PEntityOfIndex first. After doing all of that, I would change the player's team using ChangeTeam() under a certain condition. However, when I try this in-game on a linux dedicated server, it crashes the server. After searching around, I found on the hlcoders mailing list that iplayerinfo was not reliable. Does anyone know any alternatives to using IPlayerInfo->GetTeam and IPlayerInfo->ChangeTeam?
mooman2 is offline
BAILOPAN
Join Date: Jan 2004
Old 05-02-2007 , 20:35   Re: IPlayerInfo alternatives
Reply With Quote #2

they are reliable once IServerGameClients::ClientPutInServer is called
__________________
egg
BAILOPAN is offline
mooman2
Member
Join Date: Apr 2007
Old 05-02-2007 , 20:40   Re: IPlayerInfo alternatives
Reply With Quote #3

has the game picked and forced the player onto a team by then?

edit: http://forums.alliedmods.net/showpos...85&postcount=5

i guess that's not current anymore?
mooman2 is offline
BAILOPAN
Join Date: Jan 2004
Old 05-02-2007 , 20:45   Re: IPlayerInfo alternatives
Reply With Quote #4

I don't know, you'd have to test that for yourself. But if it wasn't, given an event for 'player has joined a team', it becomes a counter:

Start counter at 0
If player gets PutInServer, add to counter. If counter is 2, change their team.
If player joins a team, add to counter. If counter is 2, change their tea,.

I'm pretty sure there is such an event.
__________________
egg
BAILOPAN is offline
Keeper
Senior Member
Join Date: Nov 2006
Old 05-02-2007 , 20:47   Re: IPlayerInfo alternatives
Reply With Quote #5

I use all of those without any problems, for HL2DM. Can you post some code? It might just be a simple thing that you're doing (or not doing) that is giving you sporadic results.

EDIT: Sheesh, I was only checking one thing you guys got past me. You want to assign the team before they engine does? To keep from a death being registered?

Last edited by Keeper; 05-02-2007 at 20:50.
Keeper is offline
mooman2
Member
Join Date: Apr 2007
Old 05-02-2007 , 22:03   Re: IPlayerInfo alternatives
Reply With Quote #6

nvm, i got it to work
mooman2 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:38.


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