编译时提示同一行出错:
undefined symbol "teamjoined"
expression has no effect
expected token: ";", but found "]"
invalid expression, assumed zero
too many error messages on one line
下面是源码 帮忙看看要怎么修改呢 谢谢 :)
[PHP]#include <amxmod>
#include <amxmisc>
#include <fun>
#include <csstats>
#define TE_GLOWSPRITE 23
#define Maxsounds 1
new playerkilled[33] // ,teamjoined[33]
new g_iRoundEndTriggered
//new g_buffer[512]
public team_join(){
new id=read_data(1)
server_print("Ok, This Team_Join,id:%d",id)
if(teamjoined[id]) return
teamjoined[id]=1
new welcomemsg[129],username[33]
new izStats[8], izBody[8]
new iRankPos, iRankMax
get_user_name(id,username,32)
if (cvar_exists("csstats_reset")){
iRankPos = get_user_stats( id, izStats, izBody )
iRankMax = get_statsnum()
format(welcomemsg,128,"^x01欢迎^x03%s^x01,排名第^x04%d^x01名[共^x04%d^x01名]",username,iRankPos,iRankMax)
}else format(welcomemsg,128,"^x01欢迎^x03%s^x01,无排名",username)
client_color(0,id,welcomemsg)
}
public client_disconnect(id){
/*
new name[32]
get_user_name(id,name,31)
format(g_buffer,511,"%s 离开了服务器.",name)
set_hudmessage(255, 150, 50, 0.10, 0.5, 0, 6.0, 10.0, 0.5, 0.15, 9)
show_hudmessage(0, g_buffer)
*/
playerkilled[id]=0
return PLUGIN_CONTINUE
}
public abs(num){
return (num>=0)?num:-num
}
public client_color(playerid,colorid,msg[]){
new playerslist[32],playerscount//,i
get_players(playerslist,playerscount,"c")
new userid
if(playerid==0){
userid=playerid
message_begin(MSG_ALL, get_user_msgid("SayText"), {0,0,0}, userid)
write_byte(colorid)
write_string(msg)
message_end()
}
else{
userid=playerid
message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, userid)
write_byte(colorid)
write_string(msg)
message_end()
}
}
public plugin_init(){
register_plugin("Enter.Leave","1.1"," Changed by Thriller")
register_event("RoundTime", "new_round", "bc")
#if defined MONEY_REWARD
register_event("DeathMsg","eDeathMsg","a")
#endif
register_event("SendAudio", "eEndRound", "a", "2&%!MRAD_terwin","2&%!MRAD_ctwin","2&%!MRAD_rounddraw")
register_event("TextMsg","eRestart","a","2&#Game_C","2&#Game_w")
register_event("TeamInfo","team_join","a","2!UNASSIGNED") // Team Joining
}
[/PHP] |