-=请高人加下函数=-
/*此插件和 li_geoip 模块和 点通签名插件以及 Statx 插件配套使用.*如有问题请到点通论坛提问.*/
#include <amxmodx>
#include <csstats>
#include "li_geoip"
#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
new g_SpecMode
new szName
new g_msgid
new rank
new iRankPos
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 = 0;
}
public EventJoinedTeam(){
new id=read_data(1);
if( g_JoinedTeam == 0){
g_JoinedTeam=1;
get_user_name( id, szName, 31);
new szIP, szCountry, szArea;
get_user_ip( id, szIP, 15, 1);
get_ipinfo( szIP, szCountry, szArea, 39, 63);
new izStats, izBody;
new iRankMax;
new szMessage;
iRankPos = get_user_stats( id, izStats, izBody);
iRankMax = get_statsnum();
format( szMessage, 191, "^x01* 欢迎【^x04%s^x01】^x03%s^x01 -->>【排名】^x04%d^x01(共^x04%d^x01)【来自】^x04%s^x01 - ^x04%s",iRank(), szName, iRankPos, iRankMax, szCountry, szArea);
display_chat( szMessage);
new szSignature;
if( dt_getsign( szName, szSignature, 95)){
format( szMessage, 191, "^x01* 【^x04个性签名^x01】^x04%s", szSignature);
display_chat( szMessage);
}
}
}
public client_disconnect(id){
get_user_name( id, szName, 31);
new szMessage;
format( szMessage, 128,"^x01* 【^x04%s^x01】^x03%s^x01 离开了游戏", iRank(), szName);
display_chat( szMessage);
}
public SetSpecMode(id){
new arg;
read_data( 2, arg, 11);
g_SpecMode = ( arg == '4' );
}
public DisplayInfo(id){
if ( g_SpecMode){
new player = read_data(2);
if ( is_user_connected( player)){
new szName;
get_user_name( player, szName, 31);
new szIP, szCountry, szArea;
get_user_ip( player, szIP, 15, 1);
get_ipinfo( szIP, szCountry, szArea, 39, 63);
new izStats, izBody;
new iRankMax;
iRankPos = get_user_stats( player, izStats, izBody);
iRankMax = get_statsnum();
new szSignature, HasSignature;
HasSignature = dt_getsign( szName, szSignature, 95);
new szMessage;
format( szMessage, 255, "【%s】%s 排名: %d/%d^n爆头(率): %d(%0.2f) 杀敌: %d 死亡: %d^n命中(率): %d(%0.2f)/子弹: %d^n来自: %s - %s^n【个性签名】%s",
iRank(),
szName,
iRankPos,
iRankMax,
izStats,
100.0 * float( izStats)/float( izStats),
izStats,
izStats,
izStats,
100.0 * float( izStats)/float( izStats),
izStats,
szCountry,
szArea,
(HasSignature == 0)?"无(say $***)":szSignature);
set_hudmessage( 0, 103, 0, -1.0, 0.64, 0, 6.0, 8.0, 0.5, 0.15, 1) ;
show_hudmessage( id, szMessage);
}
}
}
get_ipinfo( szIP[], szCountry[], szArea[], clen, alen){
//可能 li_geoip 模块将 192.168.*.* 网段固定为"内网用户", 这里提供修改的办法.
if( strfind( szIP, "192.168.") == 1){
/*修改成你自己的网吧的地区名*/
copy( szCountry, clen, "***本地***");
/*修改成你自己的网吧的名称*/
copy( szArea, alen, "“伊四”CS服务器");
}
else
geoip_info( szIP, szCountry, szArea, clen, alen);
}
display_chat( szMessage[]){
message_begin( MSG_ALL, g_msgid);
write_byte(1);
write_string( szMessage);
message_end();
}
//进出服务器级别定义开始
public iRank(){
if(iRankPos<=10)
rank = "上将"
else
{
if(iRankPos<=20)
rank = "中将"
else
{
if(iRankPos<=40)
rank = "少将"
else
{
if(iRankPos<=70)
rank = "大校"
else
{
if(iRankPos<=110)
rank = "上校"
else
{
if(iRankPos<=160)
rank = "中校"
else
{
if(iRankPos<=220)
rank = "少校"
else
{
if(iRankPos<=290)
rank = "上尉"
else
{
if(iRankPos<=370)
rank = "中尉"
else
{
if(iRankPos<=460)
rank = "少尉"
else
rank = "列兵"
} } } } } } } } }
return rank
}
在这里加上【在线总时间】
new szMessage;
format( szMessage, 255, "【%s】%s 排名: %d/%d^n爆头(率): %d(%0.2f) 杀敌: %d 死亡: %d^n命中(率): %d(%0.2f)/子弹: %d^n来自: %s - %s^n【个性签名】%s",
iRank(),
szName,
iRankPos,
iRankMax,
izStats,
100.0 * float( izStats)/float( izStats),
izStats,
izStats,
izStats,
100.0 * float( izStats)/float( izStats),
izStats,
szCountry,
szArea,
调用
new playtime = get_user_time(id) 又搞什么东东?? 想完善一下壹号服而已 ````````````````````````````````````` 还没回应!?!? http://www.dt-club.net/forum/forum-41-1.html 还没回应!?!? 晕!你想怎么加吖! 在这里加上【在线总时间】
new szMessage;
format( szMessage, 255, "【%s】%s 排名: %d/%d^n爆头(率): %d(%0.2f) 杀敌: %d 死亡: %d^n命中(率): %d(%0.2f)/子弹: %d^n来自: %s - %s^n【个性签名】%s",
iRank(),
szName,
iRankPos,
iRankMax,
izStats,
100.0 * float( izStats)/float( izStats),
izStats,
izStats,
izStats,
100.0 * float( izStats)/float( izStats),
izStats,
szCountry,
szArea,
调用
new playtime = get_user_time(id) 依旧在往下沉啊····
页:
[1]