搜索
查看: 3090|回复: 11

源码中的一小段 关于teamjoined

[复制链接]
发表于 2006-8-15 10:53:26 | 显示全部楼层 |阅读模式 来自 中国–湖北–襄阳
编译时提示同一行出错:

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]
发表于 2006-8-15 22:24:22 | 显示全部楼层 来自 中国–广东–深圳–罗湖区

回复: 源码中的一小段 关于teamjoined

new teamjoined[33] //定义teamjoined
里面有很多多余的东西,已经注释掉了
你是只要teamjoin信息提示把
[php]
#include <amxmod>
#include <amxmisc>
//#include <fun>
#include <csstats>
//#define TE_GLOWSPRITE 23
//#define Maxsounds 1
//new playerkilled[33] ,
new 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]
回复

使用道具 举报

发表于 2006-8-15 22:26:36 | 显示全部楼层 来自 中国–广东–深圳–罗湖区

回复: 源码中的一小段 关于teamjoined

删减其他无用之后
[php]
#include <amxmod>
#include <amxmisc>
#include <csstats>
new teamjoined[33]
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_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("TeamInfo","team_join","a","2!UNASSIGNED") // Team Joining
}  

[/php]
回复

使用道具 举报

发表于 2006-8-16 11:04:02 | 显示全部楼层 来自 中国–河南–南阳–新野县

回复: 源码中的一小段 关于teamjoined

成功了没如花~:sexy_girl

我编译后怎么不是彩色提示的啊! :confused:

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注个册吧

×
回复

使用道具 举报

 楼主| 发表于 2006-8-16 22:30:25 | 显示全部楼层 来自 中国–湖北–襄阳

回复: 源码中的一小段 关于teamjoined

能把编译好的 sma 发上来吗 我在1.75下还是编译不成功啊...
回复

使用道具 举报

发表于 2006-8-17 09:53:12 | 显示全部楼层 来自 中国–河南–南阳–新野县

回复: 源码中的一小段 关于teamjoined

我这个可以编译成功!:spiderman
回复

使用道具 举报

 楼主| 发表于 2006-8-17 10:32:46 | 显示全部楼层 来自 中国–湖北–襄阳

回复: 源码中的一小段 关于teamjoined

哇 多谢
你把你的删了吧 没有保存为UTF-8 ...
我把我的发上来 嘿嘿
我的是彩色显示的 ^^
我用在1.75下的

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注个册吧

×
回复

使用道具 举报

发表于 2006-8-17 11:09:51 | 显示全部楼层 来自 中国–河南–南阳–新野县

回复: 源码中的一小段 关于teamjoined

删了~现在我去编译一下你的去:sexy_girl
回复

使用道具 举报

发表于 2006-8-17 11:22:52 | 显示全部楼层 来自 中国–河南–南阳–新野县

回复: 源码中的一小段 关于teamjoined

发现一个问题 用2738 客户端 不显示彩色 是默认的土黄 用2834以上 就可以正常显示!:sexy_girl
回复

使用道具 举报

发表于 2006-8-17 11:24:52 | 显示全部楼层 来自 中国–湖北–襄阳

回复: 源码中的一小段 关于teamjoined

嗯 估计是这样 ...
我用的是2834
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表