| Debesėlis |
10-25-2013 16:21 |
Top Awards
Doesn't work. Can anyone help to fix it?
All players on top 10 must get T flag. if player is in top10 and gets flag but die many times and his rank dropped to 11 remove T flag for him.
PHP Code:
#include < amxmodx > #include < amxmisc > #include < csstats > #pragma semicolon 1
new cvar_ranks, cvar_flags;
public plugin_init ( ) { register_plugin( "Top Awards", "0.1", "alliedmodders" ); cvar_ranks = register_cvar( "amx_vip_top", "10"); cvar_flags = register_cvar( "amx_vip_flags", "t" ); register_dictionary( "topflags.txt" ); }
public client_authorized ( id ) { new stats[ 8 ], bodyhits[ 8 ], string1[ 16 ], string2[ 16 ]; get_pcvar_string( cvar_flags, string1, 15 ); get_pcvar_string( cvar_ranks, string2, 15 ); new iRank = get_user_stats( id, stats, bodyhits ); new flags = read_flags( string1 ); new ranks = str_to_num( string2 ); new old_flags = get_user_flags( id ); if ( old_flags & ADMIN_MENU ) return; else { if ( 1 <= iRank <= ranks ) { print_color( id, "%L", LANG_SERVER, "VIP_WIN" ); set_user_flags( id, old_flags | flags ); } else remove_user_flags( id, flags ); } }
|