以下為我的無線電插件的sma原始碼
#include <amxmodx>
#include <engine>
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 color_radio(msgid, msgDest, msgEnt){
new argNum = get_msg_args()
if (argNum!=5) return PLUGIN_CONTINUE
if (get_msg_argtype(1)!=ARG_BYTE) return PLUGIN_CONTINUE
new arg1=get_msg_arg_int(1)
if (arg1!=5) return PLUGIN_CONTINUE
new arg3[256]
get_msg_arg_string(3,arg3,255)
if(equal(arg3,"#Game_radio")){
new arg4[33],arg5[129]
get_msg_arg_string(4,arg4,32)
get_msg_arg_string(5,arg5,128)
new saymsg[255]
if(equal(arg5,"#Go_go_go")){//Msg GoGoGo
format(saymsg,192,"^x03%s :^x04 衝啊..!",arg4)
}
else if(equal(arg5,"#Stick_together_team")){
format(saymsg,255,"^x03%s :^x04 一起走吧! 各位..",arg4)
}
else if(equal(arg5,"#Team_fall_back")){
format(saymsg,255,"^x03%s :^x04 快撤退啊!",arg4)
}
else if(equal(arg5,"#Cover_me")){
format(saymsg,255,"^x03%s :^x04 掩護我!",arg4)
}
else if(equal(arg5,"#You_take_the_point")){
format(saymsg,255,"^x03%s :^x04 你去攻佔那個地方。",arg4)
}
else if(equal(arg5,"#Hold_this_position")){
format(saymsg,255,"^x03%s :^x04 各單位保持現在的位置",arg4)
}
else if(equal(arg5,"#Regroup_team")){
format(saymsg,255,"^x03%s :^x04 重新編隊",arg4)
}
else if(equal(arg5,"#Follow_me")){
format(saymsg,255,"^x03%s :^x04 跟我來...",arg4)
}
else if(equal(arg5,"#Taking_fire")){
format(saymsg,255,"^x03%s :^x04 開火啊..需要支援!",arg4)
}
else if(equal(arg5,"#Get_in_position_and_wait")){
format(saymsg,255,"^x03%s :^x04 全隊就定位,等我衝出去時掩護我",arg4)
}
else if(equal(arg5,"#Storm_the_front")){
format(saymsg,255,"^x03%s :^x04 全隊正面快攻!",arg4)
}
else if(equal(arg5,"#Report_in_team")){
format(saymsg,255,"^x03%s :^x04 回報行動是否準備OK",arg4)
}
else if(equal(arg5,"#Affirmative")){
format(saymsg,255,"^x03%s :^x04 收到",arg4)
}
else if(equal(arg5,"#Roger_that")){
format(saymsg,255,"^x03%s :^x04 了解",arg4)
}
else if(equal(arg5,"#Enemy_spotted")){
format(saymsg,255,"^x03%s :^x04 發現敵人",arg4)
}
else if(equal(arg5,"#Need_backup")){
format(saymsg,255,"^x03%s :^x04 我需要支援",arg4)
}
else if(equal(arg5,"#Sector_clear")){
format(saymsg,255,"^x03%s :^x04 此區域安全",arg4)
}
else if(equal(arg5,"#In_position")){
format(saymsg,255,"^x03%s :^x04 我已經就定位",arg4)
}
else if(equal(arg5,"#Reporting_in")){
format(saymsg,255,"^x03%s :^x04 回報行動準備OK",arg4)
}
else if(equal(arg5,"#Get_out_of_there")){
format(saymsg,255,"^x03%s :^x04 炸彈要爆炸了.快走啊!",arg4)
}
else if(equal(arg5,"#Negative")){
format(saymsg,255,"^x03%s :^x04 想的美咧",arg4)
}
else if(equal(arg5,"#Enemy_down")){
format(saymsg,255,"^x03%s :^x04 敵人死了",arg4)
}
else if(equal(arg5,"#Hostage_down")){
format(saymsg,255,"^x03%s :^x04 人質死了= =..",arg4)
}
else if(equal(arg5,"#Fire_in_the_hole")){
format(saymsg,255,"^x03%s :^x04 小心爆炸!",arg4)
}
else {
return PLUGIN_CONTINUE
//format(saymsg,random_num(0,255),"^x03%s : ^x04What are you saying!",arg4)
}
message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, msgEnt)
write_byte(msgEnt)
write_string(saymsg)
message_end()
//client_color(0,msgEnt,saymsg)
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}
public plugin_init(){
register_plugin("TC radio","0.1","kid741010")
register_message(get_user_msgid("TextMsg"),"color_radio")
}
我想知道為什麼啟動此插件後 但在遊戲裏沒有反應呢@@
我認為它的編碼是有問題的@@ 而我是玩non-steam 我很想能新增此插件
希望各位大大能幫我一把 在此致以萬分感激:confused: |