View Single Post
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 09-30-2018 , 11:06   Re: Top Flags [27/09/2018]
Reply With Quote #23

With the current implementation, stats will only get reset on servers where the map never changes. I understand this may be by design but if you fix this one thing, it can be used on any server. You should then re-check everyone on round start or something, instead of spawn:
PHP Code:
set_task(86400.0"CheckDate", .flags "b"
These should be constants or use #define:
PHP Code:
new PLUGIN [] = "Top Flags"
new VERSION [] = "1.2"
new AUTHOR [] = "iceeedR" 
Indentation issues:
Code:
if(!isTop[id]) {      client_print_color(id, print_team_red, "^x04[TopFlags]^x03: You are on^x04 TOP%d^x03 and have won the^x04 VIP flags.", get_pcvar_num(VarRank))
    client_print_color(0, print_team_red,"^x04[TopFlags]^x03: %s is in^x04 TOP%d^x03 and won the^x04 VIP flags.", szName, get_pcvar_num(VarRank))   
    remove_user_flags(id, ADMIN_USER)
     set_user_flags(id, flags)
    isTop[id] = true
} public plugin_cfg() {
    auto_exec_config("TopFlags")
}

Slight change, and you should use HAM_ returns in a HamSandwich event.
PHP Code:
public CheckPlayerRank(id)
{
    if(!
is_user_alive(id)) return PLUGIN_HANDLED

    set_task
(1.0"DelayedFlags"id TaskDelay)
    return 
PLUGIN_CONTINUE
}
//to
public CheckPlayerRank(id)
{
    if( 
is_user_aliveid ) ) 
    {
        
set_task(1.0"DelayedFlags"id TaskDelay)
    }

__________________
Bugsy is offline