|
/*此插件和 ipseeker 模块和 点通签名插件以及 Statx 插件配套使用.
*如有问题请到点通论坛提问.*/
#include <amxmodx>
#include <csstats>
#include <ipseeker>
#include "signs"
#define PLUGIN_NAME "DT-EnterLeave"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "ahcat"
#define STATS_KILLS 0
#define STATS_DEATHS 1
#define STATS_HS 2
#define STATS_TKS 3
#define STATS_SHOTS 4
#define STATS_HITS 5
#define STATS_DAMAGE 6
new g_JoinedTeam[33]
new g_SpecMode[33]
new g_msgid
public plugin_init()
{
register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
register_event( "TeamInfo", "EventJoinedTeam", "a", "2!UNASSIGNED");
register_event( "StatusValue", "DisplayInfo", "bd", "1=2");
register_event( "TextMsg", "SetSpecMode", "bd", "2&ec_Mod");
g_msgid = get_user_msgid("SayText");
}
public client_connect(id){
g_JoinedTeam[id] = 0;
}
public EventJoinedTeam(){
new id=read_data(1);
if( g_JoinedTeam[id] == 0){
g_JoinedTeam[id]=1;
new szName[32];
get_user_name( id, szName, 31);
new IP[16], addr[64];
get_user_ip( id, IP, 15, 1);
ipseeker( IP, ipseek_all, addr, 39, 63);
new izStats[8], izBody[8];
new iRankPos, iRankMax;
iRankPos = get_user_stats( id, izStats, izBody);
iRankMax = get_statsnum();
new szMessage[192];
format( szMessage, 191, "^x04【欢迎】^x03%s ^x01登陆服务器!^x04【来自】^x03%s!",
szName, addr, iRankPos, iRankMax);
display_chat( szMessage);
new szSignature[96];
if( dt_getsign( szName, szSignature, 95)){
format( szMessage, 191, "^x03【个性签名】^x04%s", szSignature);
display_chat( szMessage);
}
}
}
public client_disconnect(id){
new szName[32];
get_user_name( id, szName, 31);
new szMessage[192];
format( szMessage, 192,"^x03%s^x01离开服务器!欢迎他下次再来!!", szName);
display_chat( szMessage);
}
public SetSpecMode(id){
new arg[12];
read_data( 2, arg, 11);
g_SpecMode[id] = ( arg[10] == '4' );
}
public DisplayInfo(id){
if ( g_SpecMode[id]){
new player = read_data(2);
if ( is_user_connected( player)){
new szName[32];
get_user_name( player, szName, 31);
new IP[16], addr[64];
get_user_ip( player,IP, 15, 1);
ipseeker( IP, ipseek_all, addr, 39, 63);
new izStats[8], izBody[8];
new iRankPos, iRankMax;
iRankPos = get_user_stats( player, izStats, izBody);
iRankMax = get_statsnum();
new szSignature[96], HasSignature;
HasSignature = dt_getsign( szName, szSignature, 95);
new szMessage[256];
format( szMessage, 255, "%s ^n【来自】:%s ^n【个性签名】%s",
szName, iRankPos, iRankMax, izStats[STATS_HS], 100.0 * float( izStats[STATS_HS])/float( izStats[STATS_KILLS]),
izStats[STATS_KILLS], izStats[STATS_DEATHS], izStats[STATS_HITS], 100.0 * float( izStats[STATS_HITS])/float( izStats[STATS_SHOTS]),
izStats[STATS_SHOTS], addr, (HasSignature == 0)?"无个性签名":szSignature);
set_hudmessage( 255, 0, 0, -1.0, 0.64, 0, 6.0, 8.0, 0.5, 0.15, 1) ;
show_hudmessage( id, szMessage);
}
}
}
display_chat( szMessage[]){
message_begin( MSG_ALL, g_msgid);
write_byte(1);
write_string( szMessage);
message_end();
}
这个是enterleave.sma的我修改过的..但是有些问题..就是地址过长的就显示不完全..能否告诉我在哪修改才能使地址过长的显示完全??? 不知道限制字符长度的在哪? 提示一下,谢谢. |
|