|
楼主 |
发表于 2012-3-22 13:17:38
|
显示全部楼层
来自 中国–湖南–长沙
我这里有个类似的源码 但是有问题- #include <amxmodx>
- #include <csstats>
- #include <li_geoip>
- #include <cstrike>
- #include <fakemeta>
- #include <signs>
- #define PLUGIN_NAME "Show_IP"
- #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 szName[32]
- new g_msgid
- new rank[16]
- new iRankPos
- public plugin_init(){
-
- register_plugin( PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
-
- register_event( "TeamInfo", "EventJoinedTeam", "a", "2!UNASSIGNED");
-
- register_forward(FM_PlayerPreThink, "FwdPlayerPreThink")
-
- 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;
- get_user_name( id, szName, 31);
-
- new szIP[16], szCountry[40], szArea[64];
- get_user_ip( id, szIP, 15, 1);
- get_ipinfo( szIP, szCountry, szArea, 39, 63);
-
- new izStats[8], izBody[8];
- new iRankMax;
- new szMessage[192];
- iRankPos = get_user_stats( id, izStats, izBody);
- iRankMax = get_statsnum();
- if(get_user_flags(id)&ADMIN_USER){
- format( szMessage, 191, "^x01欢迎^x04【%s】^x01^x03%s^x01^x03【^x01排名^x04%d^x01共^x03%d^x01名^x03】^x01^x04来自:^x01%s%s",iRank(),szName,iRankPos, iRankMax,szCountry, szArea);
- display_chat( szMessage);
- }
- if(get_user_flags(id)&ADMIN_RESERVATION){
- format( szMessage, 191, "^x01欢迎^x4【%s】^x03%s^x04【管理员】^x03【^x01 排名^x04%d^x01共^x03%d^x01名^x03】^x01^x04来自:^x01%s%s",iRank(), szName, iRankPos, iRankMax, szCountry, szArea);
- display_chat( szMessage);
- }
- if(get_user_flags(id)&ADMIN_KICK){
- format( szMessage, 191, "^x01欢迎^x04【%s】^x03%s^x04【贵宾】^x03 【^x01排名^x04%d^x01共^x03%d^x01名^x03】^x01^x04来自:^x01%s%s",iRank(), szName, iRankPos, iRankMax, szCountry, szArea);
- display_chat( szMessage);
- }
- if(get_user_flags(id)&ADMIN_LEVEL_A){
- format( szMessage, 191, "^x01欢迎^x04【%s】^x03%s^x04【督察】^x03【^x01排名^x04%d^x01共^x03%d^x01名^x03】^x01^x04来自:^x01%s%s",iRank(), szName, iRankPos, iRankMax, szCountry, szArea);
- display_chat( szMessage);
- }
- if(get_user_flags(id)&ADMIN_LEVEL_B){
- format( szMessage, 191, "^x01欢迎^x04【%s】^x03%s^x04【MM】^x03【^x01排名^x04%d^x01共^x03%d^x01名^x03】^x01^x04来自:^x01%s%s",iRank(), szName, iRankPos, iRankMax, szCountry, szArea);
- display_chat( szMessage);
- }
- if(get_user_flags(id)&ADMIN_LEVEL_C){
- format( szMessage, 191, "^x01欢迎^x04【%s】^x03%s^x04【会员】^x03【^x01排名^x04%d^x01共^x03%d^x01名^x03】^x01^x04来自:^x01%s%s",iRank(), szName, iRankPos, iRankMax, szCountry, szArea);
- display_chat( szMessage);
- }
- format( szMessage, 191, "^x01欢迎^x04%s^x01排名^x01%d/%d^x01^x01%s ^x01来自^x01%s %s",szName,iRankPos, iRankMax,iRank(),szCountry, szArea);
- display_chat( szMessage);
- }
- new szSignature[96];
- if( dt_getsign( szName, szSignature, 95)){
- format( szMessage, 191, "^x04【签名】^x01%s", szSignature);
- display_chat( szMessage);
- }
- }
- public FwdPlayerPreThink(client){
-
- if( is_user_alive(client) ) return
-
- static ent
- ent = pev(client, pev_iuser2)
-
- new szName[32];
- get_user_name( ent, szName, 31);
-
- new szIP[16], szCountry[40], szArea[64];
- get_user_ip( ent, szIP, 15, 1);
- get_ipinfo( szIP, szCountry, szArea, 39, 63);
-
- new izStats[8], izBody[8];
- new iRankMax;
- iRankPos = get_user_stats( ent, izStats, izBody);
- iRankMax = get_statsnum();
-
- new szSignature[96], HasSignature;
- HasSignature = dt_getsign( szName, szSignature, 95);
-
- new szMessage[256];
- if ( (get_user_flags(ent)&ADMIN_IMMUNITY) )
- format( szMessage, 255, "【管理员|%s】%s ^n 排名: %d共%d名^n 杀敌: %d 死亡: %d 爆头: %d ^n 来自: %s%s^n【签名】%s",
- iRank(),
- szName,
- iRankPos,
- iRankMax,
- izStats[STATS_KILLS],
- izStats[STATS_DEATHS],
- izStats[STATS_HS],
- szCountry,
- szArea,
- (HasSignature == 0)?"裝B者欠揍之而不宜慣乎!":szSignature
- );
- else if ( (get_user_flags(ent)&ADMIN_KICK) )
- format( szMessage, 255, "【贵宾|%s】%s ^n 排名: %d共%d名^n 杀敌: %d 死亡: %d 爆头: %d ^n 来自: %s%s^n【签名】%s",
- iRank(),
- szName,
- iRankPos,
- iRankMax,
- izStats[STATS_KILLS],
- izStats[STATS_DEATHS],
- izStats[STATS_HS],
- szCountry,
- szArea,
- (HasSignature == 0)?"需要OP和VIP的加群8193454":szSignature
- );
- else if ( (get_user_flags(ent)&ADMIN_LEVEL_A) )
- format( szMessage, 255, "【督察|%s】%s ^n 排名: %d共%d名^n 杀敌: %d 死亡: %d 爆头: %d ^n 来自: %s%s^n【签名】%s",
- iRank(),
- szName,
- iRankPos,
- iRankMax,
- izStats[STATS_KILLS],
- izStats[STATS_DEATHS],
- izStats[STATS_HS],
- szCountry,
- szArea,
- (HasSignature == 0)?"需要OP和VIP的加群8193454":szSignature
- );
- else if ( (get_user_flags(ent)&ADMIN_LEVEL_B) )
- format( szMessage, 255, "【MM|%s】%s ^n 排名: %d共%d名^n 杀敌: %d 死亡: %d 爆头: %d ^n 来自: %s%s^n【签名】%s",
- iRank(),
- szName,
- iRankPos,
- iRankMax,
- izStats[STATS_KILLS],
- izStats[STATS_DEATHS],
- izStats[STATS_HS],
- szCountry,
- szArea,
- (HasSignature == 0)?"需要OP和VIP的加群8193454":szSignature
- );
- else if ( (get_user_flags(ent)&ADMIN_LEVEL_C) )
- format( szMessage, 255, "【MM|%s】%s ^n 排名: %d共%d名^n 杀敌: %d 死亡: %d 爆头: %d ^n 来自: %s%s^n【签名】%s",
- iRank(),
- szName,
- iRankPos,
- iRankMax,
- izStats[STATS_KILLS],
- izStats[STATS_DEATHS],
- izStats[STATS_HS],
- szCountry,
- szArea,
- (HasSignature == 0)?"需要OP和VIP的加群8193454":szSignature
- );
- else if ( (get_user_flags(ent)&ADMIN_USER) )
- format( szMessage, 255, "【%s】%s ^n 排名: %d共%d名 ^n 杀敌: %d 死亡: %d 爆头: %d ^n 来自: %s%s^n【签名】%s",
- iRank(),
- szName,
- iRankPos,
- iRankMax,
- izStats[STATS_KILLS],
- izStats[STATS_DEATHS],
- izStats[STATS_HS],
- szCountry,
- szArea,
- (HasSignature == 0)?"需要OP和VIP的加群8193454":szSignature
- );
- if ( (get_user_flags(ent)&ADMIN_IMMUNITY) )//OP权限 a
- set_hudmessage( 255, 0, 0, 0.6, 0.75, 0, 6.0, 1.1, 0.0, 0.0, 5) ;
- else if ( (get_user_flags(ent)&ADMIN_LEVEL_C) )//MM权限 o
- set_hudmessage( 255, 255, 0, 0.6, 0.75, 0, 6.0, 1.1, 0.0, 0.0, 5) ;
- else if ( (get_user_flags(ent)&ADMIN_LEVEL_D) )//贵宾权限q
- set_hudmessage( 0, 90, 255, 0.6, 0.75, 0, 6.0, 1.1, 0.0, 0.0, 5) ;
- else
- set_hudmessage( 0, 255, 120, 0.6, 0.75, 0, 6.0, 1.1, 0.0, 0.0, 5);
- show_hudmessage( client, szMessage);
- }
- get_ipinfo( szIP[], szCountry[], szArea[], clen, alen){
-
- //可能 li_geoip 模块将 192.168.*.* 网段固定为"内网用户", 这里提供修改的办法.
- if( strfind( szIP, "192.168.") == 1){
-
- /*修改成你自己的网吧的地区名*/
- copy( szCountry, clen, "战龙极速");
-
- /*修改成你自己的网吧的名称*/
- copy( szArea, alen, "总部");
- }
- 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<=30)
- rank = "少将"
- else
- {
- if(iRankPos<=50)
- rank = "大校"
- else
- {
- if(iRankPos<=50)
- rank = "中校"
- else
- {
- if(iRankPos<=100)
- rank = "少校"
- else
- {
- if(iRankPos<=200)
- rank = "上尉"
- else
- {
- if(iRankPos<=290)
- rank = "中尉"
- else
- {
- if(iRankPos<=370)
- rank = "少尉"
- else
- {
- if(iRankPos<=460)
- rank = "高级士官"
- else
- rank = "士兵"
- } } } } } } } } }
- return rank
- }
复制代码 |
|