|
楼主 |
发表于 2007-5-27 02:30:52
|
显示全部楼层
来自 中国–广西–柳州–柳南区
回复: Rulzy老大请进,还是上个的问题,谢谢。
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
new g_teamScore[2]
public plugin_init(){
register_plugin("team","0.1","sanxiao")
register_logevent("team_join",3,"1=joined team","2=TERRORIST","2=CT","2=SPECTATOR")
return PLUGIN_CONTINUE
}
public team_join()
{
new user[128]
read_logargv(0, user, 127)
new name[32], oldteam[12]={0}
parse_loguser(user, name, 31, _, _, _, oldteam, 11)
new id = get_user_index(name)
new newteam[16]
read_logargv(2,newteam, 15)
if(equal(newteam,"TERRORIST")){ //加入T队伍
if(equal(oldteam,"SPECTATOR")){ //从观察员加入T
new team[2]
read_logargv( 1, team, 1 )
g_teamScore[ (team[0]=='C') ? 1 : 0 ] = read_data(2)
if ( g_teamScore[0] > g_teamScore[1] + 5 )
{
new players, Tcount
cs_set_user_team(players,CS_TEAM_T)
Tcount++
}
}else if(equal(oldteam,"CT")){ //从CT加入T
new team[2]
read_logargv( 1, team, 1 )
g_teamScore[ (team[0]=='C') ? 1 : 0 ] = read_data(2)
if ( g_teamScore[0] > g_teamScore[1] + 5 )
{
new players, Tcount
cs_set_user_team(players,CS_TEAM_T)
Tcount++
}
}else if(oldteam[0]==0){ //连接到服务器就加入T或CT
new team[2]
read_logargv( 1, team, 1 )
g_teamScore[ (team[0]=='C') ? 1 : 0 ] = read_data(2)
if ( g_teamScore[0] > g_teamScore[1] + 5 )
{
new players, Tcount
cs_set_user_team(players,CS_TEAM_T)
Tcount++
}
}
}else if(equal(newteam,"CT")){ //加入CT队伍
if(equal(oldteam,"TERRORIST")){ //从T加入CT
new team[2]
read_logargv( 1, team, 1 )
g_teamScore[ (team[0]=='C') ? 1 : 0 ] = read_data(2)
if ( g_teamScore[1] > g_teamScore[0] + 5 )
{
new players, Tcount
cs_set_user_team(players,CS_TEAM_CT)
Tcount++
}
}else if(equal(oldteam,"SPECTATOR")){ //从观察员加入CT
new team[2]
read_logargv( 1, team, 1 )
g_teamScore[ (team[0]=='C') ? 1 : 0 ] = read_data(2)
if ( g_teamScore[1] > g_teamScore[0] + 5 )
{
new players, Tcount
cs_set_user_team(players,CS_TEAM_CT)
Tcount++
}
}else if(oldteam[0]==0){ //连接到服务器就加入CT
new team[2]
read_logargv( 1, team, 1 )
g_teamScore[ (team[0]=='C') ? 1 : 0 ] = read_data(2)
if ( g_teamScore[1] > g_teamScore[0] + 5 )
{
new players, Tcount
cs_set_user_team(players,CS_TEAM_CT)
Tcount++
}
}
}
} 可还是不行,还得请你再看看,谢谢。 |
|