|
发表于 2009-6-17 20:04:05
|
显示全部楼层
来自 中国–广东–深圳
期待加入!!!!:victory:
eason39 发表于 2009-6-15 03:20
建议用这个第一视角HUD 显示玩家详细信息- /////////////////////////////
- #include <amxmodx>
- #include <GetIP>
- #include <csstats>
- #define PLUGIN "csmodip"
- #define VERSION "1.1"
- #define AUTHOR "Cr@zyTreE"
- new Show_Player[33][256]
- new g_msgid
- new g_SpecMode[33]
- public plugin_init()
- {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- //register_event("TextMsg","team_join","a","2!UNASSIGNED")
- register_event("TextMsg","team_join","a","1=1","2&Game_join_te","2&Game_join_ct")
-
- register_event( "StatusValue", "DisplayInfo", "bd", "1=2");
-
- register_event( "TextMsg", "SetSpecMode", "bd", "2&ec_Mod");
-
- g_msgid = 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 SetSpecMode(id){
-
- new arg[12];
- read_data( 2, arg, 11);
- g_SpecMode[id] = ( arg[10] == '4' );
- }
- public ShowMessage(id)
- {
- if ( !is_user_connected(id))
- return PLUGIN_CONTINUE
-
- new name[32],message[256]
- get_user_name(id,name,31)
-
- format(message, 255, "^x01欢迎^x03 %s ^x01来自:^x04 %s^n", name, Show_Player[id])
- message_begin(MSG_ALL,g_msgid)
- write_byte(id)
- write_string(message)
- message_end()
-
- return PLUGIN_CONTINUE
- }
- public DisplayInfo(id){
-
- if ( is_user_connected(id)&&g_SpecMode[id]){
-
- new player = read_data(2);
- if ( is_user_connected( player)){
- //new szName[32];
- //get_user_name( player, szName, 31);
- new szIP[17]
- get_user_ip( player, szIP, 16, 1);
- //new szSignature[96], HasSignature;
- //HasSignature = dt_getsign( szName, szSignature, 95);
- new izStats[8], izBody[8];
- new iRankPos = get_user_stats( player, izStats, izBody )
- new szMessage[256]
- format(szMessage,255,"排名[第%d名] IP[%s]^n来自[%s]",iRankPos,szIP,Show_Player[player]);
- set_hudmessage( 50,150,255,-1.0, 0.83, 0, 0.0, 3.0, 0.0, 0.0, 3)
- show_hudmessage( id, szMessage);
- }
- }
- }
复制代码 |
|