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

Catching when a player switches a team in CS.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Zenith77
Veteran Member
Join Date: Aug 2005
Old 04-22-2007 , 01:02   Catching when a player switches a team in CS.
Reply With Quote #1

I thought of one way to do it, but I wanted to see if anybody else had an idea on how to do this (I've already searched, several different queries).

My method involves hooked the FM_SetModel event, doing some checks to make a player, and since I can't really rely on a model I'd check their current team, from the last time we updated their team.

So for example:
Code:
public FM_SetModel(ent, model) {     if (!is_user_connected(ent))         return FMRES_IGNORED;     new CsTeams:currentTeam = cs_get_user_team(ent);     if (lastCheckedTeam != currentTeam)        // omg we changed team.     return FMRES_HANDLED; }
Note: just a code snippet to help explain what I want to do.

Thanks for help.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
Ryu2877
Member
Join Date: Sep 2006
Location: China
Old 04-22-2007 , 01:44   Re: Catching when a player switches a team in CS.
Reply With Quote #2

http://wiki.amxmodx.org/Half-Life_1_...vents#TeamInfo

PHP Code:
register_event("TeamInfo""e_TeamInfo_ChangeTeam","a"/*"2!UNASSIGNED", "2!SPECTATOR"*/
is that?

Last edited by Ryu2877; 04-22-2007 at 01:47.
Ryu2877 is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 04-22-2007 , 06:56   Re: Catching when a player switches a team in CS.
Reply With Quote #3

Only Team or Class? Anyway i can tell you that SetModel way isn't accurate enough. So i'd not recommend to use it.
VEN is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 04-22-2007 , 07:11   Re: Catching when a player switches a team in CS.
Reply With Quote #4

He had said team.
__________________
Brad is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 04-22-2007 , 08:08   Re: Catching when a player switches a team in CS.
Reply With Quote #5

Of course but model isn't set on team change so i had a thought that he talking about class choosing.

Last edited by VEN; 04-22-2007 at 08:14.
VEN is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 04-22-2007 , 10:57   Re: Catching when a player switches a team in CS.
Reply With Quote #6

No I mean team. Ryu2877, didn't know about that. I'll look into it (the Wiki is actually useful now ).
Also, my method doesn't compare any models if you notice. It stores their team id, then checks if it changed when they set a model, so we can assume the reason why their model was chaning was because they were switching teams, but I think I'm going to use the team even Ryu listed.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred

Last edited by Zenith77; 04-22-2007 at 11:03.
Zenith77 is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 04-22-2007 , 11:35   Re: Catching when a player switches a team in CS.
Reply With Quote #7

My point was that you can choose a team but still never choose a model/class.
VEN 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 23:34.


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