Raised This Month: $ Target: $400
 0% 

where did I wrong ?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
newcomer
Member
Join Date: Aug 2011
Old 03-10-2013 , 13:37   where did I wrong ?
Reply With Quote #1

I have try make limit players join team if have limit then they will get auto change team, but it's not work, I don't know why. Please teach me

Quote:
#include <amxmisc>
#include <cs_team_changer>
#define PLUGIN "Limit players"
#define VERSION "1.0"
#define AUTHOR "Test"

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event( "TeamInfo", "join_team", "a")
}

public join_team()
{
new victim = read_data(1)
if(!is_user_connected(victim)) return PLUGIN_CONTINUE
new user_team[32]
new tplayers[32], ctplayers[32], tnum, ctnum;
get_players(tplayers, tnum, "e", "TERRORIST");
get_players(ctplayers, ctnum, "e", "CT");
read_data(2, user_team, 31)
switch(user_team[0])
{
case 'C':
{

if((ctnum >= 5) && (tnum < 5))
{
cs_set_team(victim, CSTEAM_TERRORIST)
}
else if((ctnum >= 5) && (tnum >= 5))
{
cs_set_team(victim, CSTEAM_SPECTATOR )
}

}
case 'T':
{
if((tnum >= 5) && (ctnum < 5))
{
cs_set_team(victim, CSTEAM_CT)
}
else if((tnum >= 5) && (ctnum >= 5))
{
cs_set_team(victim, CSTEAM_SPECTATOR)
}
}
}
return PLUGIN_CONTINUE
}
newcomer is offline
 



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 21:46.


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