搜索
查看: 4178|回复: 17

關於Nimo的 csmodip插件

[复制链接]
发表于 2008-4-8 09:56:11 | 显示全部楼层 |阅读模式 来自 香港
為什麼我開服時報錯
unknown function ("csmod_ip") 叫我檢查modules.ini文件

下面是我的ip.sma
[PHP]#include <amxmodx>
#include <amxmisc>
#include <csstats>
#include <GetIP>
#define PLUGIN "ShowIP"
#define VERSION "1.0"
#define AUTHOR "Shock.V"
new Show_Player[32][256]
//new SayText
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)

register_event("TextMsg","team_join","a","1=1","2&Game_join_te","2&Game_join_ct")

//SayText=get_user_msgid("SayText")
}
public client_putinserver(id)
{
ShowIP(id)
}
public ShowIP(id)
{
if ( !is_user_connected(id))
  return PLUGIN_HANDLED
  
new playerip[17]

get_user_ip(id, playerip, 16, 1)

csmod_ip(playerip,Show_Player[id],255)

return PLUGIN_CONTINUE
}
public team_join()
{
new UserID[32]
read_data(3,UserID,31)
new id = get_user_index(UserID)

if ( !is_user_connected(id))
  return PLUGIN_CONTINUE
  
set_task(5.0,"ShowMessage",id)

return PLUGIN_CONTINUE
}
public ShowMessage(id)
{
if ( !is_user_connected(id))
  return PLUGIN_CONTINUE
new name[32]
//,message[256]
new playerip2[32]
new izStats[8], izBody[8]
new iRankPos, iRankMax
iRankPos = get_user_stats( id, izStats, izBody )
iRankMax = get_statsnum()
get_user_name(id, name, 31)
get_user_ip(id, playerip2, 31)
set_hudmessage(255, 0, 0, 0.52, 0.5, 2, 3.0, 5.0, 0.1, 0.2, 0)
show_hudmessage(0, "姓名: %s^n目前所在地: %s^nIP登陸: %s^n排名[ %s / %s ]",  name, Show_Player[id], playerip2, iRankPos,iRankMax)
//format(message, 255, "^x01歡迎^x03 %s ^x01來自:^x04 %s^n",  name, Show_Player[id])
//message_begin(MSG_ALL,SayText)
//write_byte(id)
//write_string(message)
//message_end()

return PLUGIN_CONTINUE
}[/PHP]
发表于 2008-4-8 13:54:19 | 显示全部楼层 来自 广东深圳

回复: 關於Nimo的 csmodip插件

没有加载必须的模块~
modules.ini 文件上面加载
2、addons/amxmodx/configs/modules.ini打开,添加CSMODIP_amxx.dll,可加参数,见下说明
回复

使用道具 举报

 楼主| 发表于 2008-4-8 15:31:00 | 显示全部楼层 来自 香港

回复: 關於Nimo的 csmodip插件

Post by baili1258
没有加载必须的模块~
modules.ini 文件上面加载
難道我沒看教學麼..
已加載為內存模式啊......查看載內模組已經掛載CSMODIP..但就是報錯...想問問
CSMODIP_amxx.dll 1

另外插件編寫有沒有問題?
回复

使用道具 举报

发表于 2008-4-8 15:37:55 | 显示全部楼层 来自 广东深圳

回复: 關於Nimo的 csmodip插件

大概看了下
代码貌似没有问题
估计是没有加载到必须的模块
回复

使用道具 举报

 楼主| 发表于 2008-4-8 15:50:10 | 显示全部楼层 来自 香港

回复: 關於Nimo的 csmodip插件

Post by baili1258
大概看了下
代码貌似没有问题
估计是没有加载到必须的模块
但模块的確是加載了

[PHP]; CHM 漢化組 Rulzy 漢化
;;;
; 要啟用一個模塊,去掉名字前面的註釋符(;)。
; 如果不在這裡,只需增加它的名字,一行一個。
; 你不需要寫上「_amxx」部分和文件的擴展名。
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; SQL模塊經常需要你手動啟用。你可以同時啟用多個。 ;;
;; 使用sql.cfg中的amx_sql_type來指定默認數據庫類型 ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
mysql
sqlite
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; 將第三方模塊添加到下面。你可以只列出它們的名字, ;;
;; 不要「_amxx」和文件擴展名。                      ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
hamsandwich
CSMODIP_amxx.dll 1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; 這些模塊將會自動檢測並在需要的時候加載,你不需要 ;;
;; 在這裡啟用它們,除非你碰到有問題。               ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
fun
engine
fakemeta
geoip
sockets
;regex
;nvault
cstrike
csx[/PHP]
回复

使用道具 举报

发表于 2008-4-9 09:22:20 | 显示全部楼层 来自 广东深圳

回复: 關於Nimo的 csmodip插件

先把后面的 1 去掉试下
还要去modules文件下去看是否有这个文件
回复

使用道具 举报

 楼主| 发表于 2008-4-9 13:24:19 | 显示全部楼层 来自 香港

回复: 關於Nimo的 csmodip插件

Post by baili1258
先把后面的 1 去掉试下
还要去modules文件下去看是否有这个文件
那個問題現在解決了...但信息沒顯示出來?
能不能幫我測試一下
回复

使用道具 举报

发表于 2008-4-9 13:55:43 | 显示全部楼层 来自 广东深圳

回复: 關於Nimo的 csmodip插件

上面代码写的是你进入游戏,加入队伍5秒后显示信息的~!
你试过没?
回复

使用道具 举报

 楼主| 发表于 2008-4-9 16:46:34 | 显示全部楼层 来自 香港

回复: 關於Nimo的 csmodip插件

等了很久信息也沒出來....想問問是不是寫錯了?
回复

使用道具 举报

发表于 2008-4-9 17:20:02 | 显示全部楼层 来自 广东深圳

回复: 關於Nimo的 csmodip插件

[php]#include <amxmodx>
#include <amxmisc>
#include <csstats>
#include <GetIP>
#define PLUGIN "ShowIP"
#define VERSION "1.0"
#define AUTHOR "Shock.V"
new Show_Player[32][256]
//new SayText
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)

//register_event("TextMsg","team_join","a","1=1","2&Game_join_te","2&Game_join_ct")

//SayText=get_user_msgid("SayText")
}
public client_putinserver(id)
{
ShowIP(id)
}
public ShowIP(id)
{
if ( !is_user_connected(id))
return PLUGIN_HANDLED

new playerip[17]

get_user_ip(id, playerip, 16, 1)

csmod_ip(playerip,Show_Player[id],255)
set_task(5.0,"ShowMessage",id)

return PLUGIN_CONTINUE
}
/*public team_join()
{
new UserID[32]
read_data(3,UserID,31)
new id = get_user_index(UserID)

if ( !is_user_connected(id))
return PLUGIN_CONTINUE

set_task(5.0,"ShowMessage",id)

return PLUGIN_CONTINUE
}*/
public ShowMessage(id)
{
if ( !is_user_connected(id))
return PLUGIN_CONTINUE
new name[32]
//,message[256]
new playerip2[32]
new izStats[8], izBody[8]
new iRankPos, iRankMax
iRankPos = get_user_stats( id, izStats, izBody )
iRankMax = get_statsnum()
get_user_name(id, name, 31)
get_user_ip(id, playerip2, 31)
set_hudmessage(255, 0, 0, 0.52, 0.5, 2, 3.0, 5.0, 0.1, 0.2, 0)
show_hudmessage(0, "姓名: %s^n目前所在地: %s^nIP登陸: %s^n排名[ %s / %s ]", name, Show_Player[id], playerip2, iRankPos,iRankMax)
//format(message, 255, "^x01歡迎^x03 %s ^x01來自:^x04 %s^n", name, Show_Player[id])
//message_begin(MSG_ALL,SayText)
//write_byte(id)
//write_string(message)
//message_end()

return PLUGIN_CONTINUE
} [/php]

你这样试下!
还不行就查下后台有没有报错!
回复

使用道具 举报

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

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