Raised This Month: $ Target: $400
 0% 

How to change player's team ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wwzw
Member
Join Date: Feb 2009
Old 08-21-2012 , 12:45   How to change player's team ?
Reply With Quote #1

I want to change the player's team, I use cs_set_user_team ().

But:
1: One round can only be change once. This can not be used in CSDM mode .
2: If the player enters the server but did not join the team. This change also make mistakes.
3: When a player chooses a team, but there is no choice models. This is also wrong.

Please help me! Or tell me a perfect plug-in, to achieve the functionality I want!
Thank you very much!
wwzw is offline
claudiuhks
Yam Inside®™℠
Join Date: Jan 2010
Location: Living Randomly
Old 08-21-2012 , 21:52   Re: How to change player's team ?
Reply With Quote #2

PHP Code:
#include < amxmodx >
#include < cstrike >
#include < fakemeta >

ChangeTeamiPlayeriTeamboolbKillboolbUpdateModel )
{
  if( 
pev_validiPlayer ) == // IsNullEnt( Player ) == false && Player -> PrivateData != NULL
  
{
    if( 
iTeam && iTeam )
    {
      !
bUpdateModel set_pdata_intiPlayer114iTeam ) : cs_set_user_teamiPlayeriTeam );

      if( 
bKill )
        
dllfuncDLLFunc_ClientKilliPlayer );
    }

    else if( 
iTeam == && is_user_aliveiPlayer ) && ( get_pdata_intiPlayer114 ) != && get_pdata_intiPlayer114 ) != ) ) // Transfer to spectator only if player is alive -- is more reliable.
    
{
      
set_pdata_intiPlayer114);

      
dllfuncDLLFunc_ClientKilliPlayer );
    }
  }


Last edited by claudiuhks; 08-22-2012 at 04:39.
claudiuhks is offline
Send a message via MSN to claudiuhks Send a message via Yahoo to claudiuhks Send a message via Skype™ to claudiuhks
wwzw
Member
Join Date: Feb 2009
Old 08-22-2012 , 20:51   Re: How to change player's team ?
Reply With Quote #3

Thank you for your help!
I tested this code, but I did not want the results:
1: Monitor is team when a player enters the server First, change the player's team is not complete: the start will not get a knife and weapons, the time is displayed in the top of the screen.
2: When a player enters the server, but do not select the team. The result is not to change the players team.
3: When a player chooses a team, but there is no choice models. You can not change his team. . .
wwzw 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 00:20.


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