源码中的一小段 关于teamjoined
编译时提示同一行出错:undefined symbol "teamjoined"
expression has no effect
expected token: ";", but found "]"
invalid expression, assumed zero
too many error messages on one line
下面是源码 帮忙看看要怎么修改呢 谢谢 :)
#include <amxmod>
#include <amxmisc>
#include <fun>
#include <csstats>
#define TE_GLOWSPRITE 23
#define Maxsounds 1
new playerkilled // ,teamjoined
new g_iRoundEndTriggered
//new g_buffer
public team_join(){
new id=read_data(1)
server_print("Ok, This Team_Join,id:%d",id)
if(teamjoined) return
teamjoined=1
new welcomemsg,username
new izStats, izBody
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
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=0
return PLUGIN_CONTINUE
}
public abs(num){
return (num>=0)?num:-num
}
public client_color(playerid,colorid,msg[]){
new playerslist,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
}
回复: 源码中的一小段 关于teamjoined
new teamjoined //定义teamjoined里面有很多多余的东西,已经注释掉了
你是只要teamjoin信息提示把
#include <amxmod>
#include <amxmisc>
//#include <fun>
#include <csstats>
//#define TE_GLOWSPRITE 23
//#define Maxsounds 1
//new playerkilled ,
new teamjoined
//new g_iRoundEndTriggered
//new g_buffer
public team_join(){
new id=read_data(1)
server_print("Ok, This Team_Join,id:%d",id)
if(teamjoined) return
teamjoined=1
new welcomemsg,username
new izStats, izBody
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
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=0
return PLUGIN_CONTINUE
}
*/
/*
public abs(num){
return (num>=0)?num:-num
}
*/
public client_color(playerid,colorid,msg[]){
new playerslist,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
}
回复: 源码中的一小段 关于teamjoined
删减其他无用之后#include <amxmod>
#include <amxmisc>
#include <csstats>
new teamjoined
public team_join(){
new id=read_data(1)
server_print("Ok, This Team_Join,id:%d",id)
if(teamjoined) return
teamjoined=1
new welcomemsg,username
new izStats, izBody
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,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
}
回复: 源码中的一小段 关于teamjoined
成功了没如花~:sexy_girl我编译后怎么不是彩色提示的啊! :confused:
回复: 源码中的一小段 关于teamjoined
能把编译好的 sma 发上来吗 我在1.75下还是编译不成功啊...回复: 源码中的一小段 关于teamjoined
我这个可以编译成功!:spiderman回复: 源码中的一小段 关于teamjoined
哇 多谢你把你的删了吧 没有保存为UTF-8 ...
我把我的发上来 嘿嘿
我的是彩色显示的 ^^
我用在1.75下的
回复: 源码中的一小段 关于teamjoined
删了~现在我去编译一下你的去:sexy_girl回复: 源码中的一小段 关于teamjoined
发现一个问题 用2738 客户端 不显示彩色 是默认的土黄 用2834以上 就可以正常显示!:sexy_girl回复: 源码中的一小段 关于teamjoined
嗯 估计是这样 ...我用的是2834
页:
[1]
2