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

Team Change Event ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Balck
Senior Member
Join Date: Apr 2013
Location: Kosova-Mitrovica
Old 07-18-2014 , 10:00   Team Change Event ?
Reply With Quote #1

Hi i'm making a plugin and i need to check when a player is changing the team and i mean like this for example if i'm on CT team and i change the team with cs_set_user_team to T how can i check that i have change the team and yes i have test it with register_event( "TeamInfo", "event_team_info", "a" ); but it doesn't work.

PHP Code:
register_clcmd("say /changeteam""changeteam")

public 
changeteam(id)
{
cs_set_user_team(id) == CS_TEAM_T);

Sorry for my bad english
__________________

Last edited by Balck; 07-18-2014 at 10:00.
Balck is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-18-2014 , 10:41   Re: Team Change Event ?
Reply With Quote #2

Create a new bool and set it to true when someone is changing team, then reset it when you need ( without more info we can't know what you are trying to do ).
HamletEagle is offline
FrOZeN F1rE
Junior Member
Join Date: Mar 2014
Location: Reality..!!
Old 07-18-2014 , 10:47   Re: Team Change Event ?
Reply With Quote #3

Quote:
Originally Posted by Balck View Post
PHP Code:

public changeteam(id)
{
cs_set_user_team(id) == CS_TEAM_T);

Try This
PHP Code:
#include <cstrike>

public plugin_init() 
         {
         
register_clcmd("say /changeteam""changeteam")
         }

register_clcmd("say /changeteam""changeteam")

public 
changeteam(id)

if(!
cs_get_user_team(id) == CS_TEAM_T)
{
         
cs_set_user_team(idCS_TEAM_CT)
         
client_print(id"You Were Transferred To The CT's Team!");
}
else
{
         
cs_set_user_team(idCS_TEAM_T)
         
client_print(id"You Were Transferred To The T's Team!");

__________________

FreezeTag Mod + Shop + Items!
Need Some Help !!!! Please PM me

Last edited by FrOZeN F1rE; 07-18-2014 at 10:49. Reason: mistake edit
FrOZeN F1rE is offline
Balck
Senior Member
Join Date: Apr 2013
Location: Kosova-Mitrovica
Old 07-18-2014 , 11:06   Re: Team Change Event ?
Reply With Quote #4

you dont understand i only want to know how to check when a player is changing the team

PHP Code:
new makesomething[33];

public 
plugin_init()
{
    
register_clcmd(say /team", "changeteam");
    register_event("
EventTeamChange", "eventteamchange");
}

public changeteam(id)
{
    cs_set_user_team(id) == CS_TEAM_T);
}

public eventteamchange(id)
{
    if(get_user_team(id) == 1)
    {
        makesomething[id] == false;
    }

__________________
Balck is offline
Kz1.0
Senior Member
Join Date: Jan 2013
Location: Vietnam
Old 07-18-2014 , 13:19   Re: Team Change Event ?
Reply With Quote #5

Why don't u try to search ?

Kz1.0 is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 07-18-2014 , 14:07   Re: Team Change Event ?
Reply With Quote #6

Because what you posted won't work for him, as you cannot hook the change via cs_set_user_team() with TeamInfo. You'll be able to hook the TeamInfo fired at next spawn though.
mottzi is offline
Send a message via MSN to mottzi
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-18-2014 , 14:47   Re: Team Change Event ?
Reply With Quote #7

If you are changing someone team with a plugin, you already know when they change teams (when you execute the function; which you are not doing correctly BTW).

If you want helpful advice, you should explain in detail of what you are actually trying to do.
__________________
fysiks is offline
Kz1.0
Senior Member
Join Date: Jan 2013
Location: Vietnam
Old 07-18-2014 , 15:46   Re: Team Change Event ?
Reply With Quote #8

Quote:
Originally Posted by mottzi View Post
Because what you posted won't work for him, as you cannot hook the change via cs_set_user_team() with TeamInfo. You'll be able to hook the TeamInfo fired at next spawn though.
Sorry, beacause his question is not clear for me .
Kz1.0 is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 07-18-2014 , 15:55   Re: Team Change Event ?
Reply With Quote #9

How would you detect the change without adding custom natives or forwards when you, lets pretend, dont have acess (again: let's just pretend this) to the changing-team plugins sma?
mottzi is offline
Send a message via MSN to mottzi
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-18-2014 , 16:24   Re: Team Change Event ?
Reply With Quote #10

Quote:
Originally Posted by mottzi View Post
How would you detect the change without adding custom natives or forwards when you, lets pretend, dont have acess (again: let's just pretend this) to the changing-team plugins sma?
Get the source code or get a different plugin that you have access to the source code.
__________________
fysiks 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 18:33.


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