Raised This Month: $ Target: $400
 0% 

Changing Teams Help!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kard1nal
Senior Member
Join Date: Dec 2012
Location: Russia
Old 04-15-2013 , 04:23   Re: Changing Teams Help!
Reply With Quote #1

Code:
#include <amxmodx> #include <cstrike> #include <hamsandwich> new bool:T[33], bool:CT[33] public plugin_init() {     RegisterHam(Ham_Killed, "player", "player_killed", 1)     register_logevent("round_start", 2, "0=World triggered", "1=Round_Start") } public player_killed(victim, attacker, shouldgib) {     if(victim == attacker || get_user_team(attacker) != 2 || get_user_team(victim) != 1)         return HAM_IGNORED             T[attacker] = true     CT[victim] = true     return HAM_IGNORED } public client_disconnect(id) {     T[id] = false     CT[id] = false } public round_start() {     new Players[32], num, i     get_players(Players, num, "a")     for(i = 0; i < num; i++)     {         if(T[Players[i]])         {             cs_set_user_team(Players[i], CS_TEAM_T)             T[Players[i]] = false         }         else if(CT[Players[i]])         {             cs_set_user_team(Players[i], CS_TEAM_CT)             CT[Players[i]] = false         }     } }
__________________
Sorry for my English, I'm Russian.

Last edited by Kard1nal; 04-15-2013 at 04:23.
Kard1nal is offline
Send a message via Skype™ to Kard1nal
Leon M.
Senior Member
Join Date: Apr 2009
Location: Germany
Old 04-15-2013 , 06:05   Re: Changing Teams Help!
Reply With Quote #2

And 1 more suggestion basically like yours but with additional information for 3rd party plugins. The main issue was flag "a" into your get_players function. This will skip players

Spoiler
__________________
  • ZapTic - Paintball (Version 7.1.3 b1303)
  • Your #1 CS Paintball Server since 2008
  • 85.131.163.101:27015

Last edited by Leon M.; 04-15-2013 at 06:12.
Leon M. 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 10:54.


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