Results 1 to 3 of 3

Thread: ct afk slay

  1. #1
    Junior Member Array
    Join Date
    Dec 2016
    Location
    Beograd
    Karma
    0

    Default ct afk slay

    Pozdrav.Da li je neko voljan da napravi plugin koji slay samo ct posle 90 sekundi ili da prepravi ovaj https://forums.alliedmods.net/showthread.php?t=254131 da radi to isto ?

  2. #2
    Member Array
    Join Date
    Jan 2017
    Location
    Proffessional Coder.
    Age
    33
    Karma
    0

    Default

    koliko sam te ja razumeo, treba ti AFK Slayer Plugin
    koji bi ubijao igrace nakon 90sec, samo ako su CT TIM?

    probaj ovako, nisam siguran da ce raditi...
    PHP Code:
        #include <amxmodx>
    #include <colorchat>

    #define MIN_AFK_TIME 90
    #define CHECK_FREQ 5

    new g_oldangles[33][3]
    new 
    g_afktime[33]
    new 
    bool:g_spawned[33] = {true, ...}

    public 
    plugin_init() {
        
    register_plugin("AFK Slayer""2.0","ReEdit by Nexon"
        
    register_cvar("afk_vreme""90")
        
    set_task(float(CHECK_FREQ),"checkPlayers",_,_,_,"b")
        
    register_event("ResetHUD""playerSpawned""be")
    }

    public 
    checkPlayers() {
        for (new 
    1<= get_maxplayers(); i++) {
            if (
    is_user_alive(i) && is_user_connected(i) && !(get_user_flags(i) & ADMIN_BAN) && !is_user_bot(i) && !is_user_hltv(i) && g_spawned[i]) {
                new 
    newangle[3]
                
    get_user_origin(inewangle)

                if ( 
    newangle[0] == g_oldangles[i][0] && newangle[1] == g_oldangles[i][1] && newangle[2] == g_oldangles[i][2] ) {
                    
    g_afktime[i] += CHECK_FREQ
                    check_afktime
    (i)
                } else {
                    
    g_oldangles[i][0] = newangle[0]
                    
    g_oldangles[i][1] = newangle[1]
                    
    g_oldangles[i][2] = newangle[2]
                    
    g_afktime[i] = 0
                
    }
            }
        }
        return 
    PLUGIN_HANDLED
    }

    check_afktime(id) {
            new 
    maxafktime get_cvar_num("afk_vreme")
            if (
    maxafktime MIN_AFK_TIME) {
                
    maxafktime MIN_AFK_TIME
                set_cvar_num
    ("afk_vreme"MIN_AFK_TIME)
            }
            if ( 
    maxafktime <= g_afktime[id] < maxafktime)    
            {
                if (
    cs_set_user_team(id) == CS_TEAM_CT)    
                {
                new 
    timeleft maxafktime g_afktime[id]
                
    ColorChat(idRED"^4[CT AFK Slayer] ^1Imas ^3%i ^1sekundi, da se pomeris, ili ces bitti ubijen zbog AFK-a."timeleft)
                } else
                return 
    PLUGIN_HANDLED
            
    } else 
            if (
    g_afktime[id] > maxafktime) {
                new 
    name[32]
                
    get_user_name(idname31)
                
    ColorChat(0RED"^4[CT AFK Slayer] ^3%s ^1je ubijen, jer je bio AFK duze od ^3%i ^1sekundi"namemaxafktime)
                
    user_kill(id)
            }
    }

    public 
    client_connect(id) {
        
    g_afktime[id] = 0
        
    return PLUGIN_HANDLED
    }

    public 
    client_putinserver(id) {
        
    g_afktime[id] = 0
        
    return PLUGIN_HANDLED
    }

    public 
    playerSpawned(id) {
        
    g_afktime[id] = 0
        g_spawned
    [id] = false
        
    new sid[1]
        
    sid[0] = id
        set_task
    (0.75"delayedSpawn",_sid1)
        return 
    PLUGIN_HANDLED
    }

    public 
    delayedSpawn(sid[]) {
        
    get_user_origin(sid[0], g_oldangles[sid[0]])
        
    g_spawned[sid[0]] = true
        
    return PLUGIN_HANDLED



    Kontakt:
    Ovde na forumu: [Klik]
    Na Facebook: [Klik]
    E-mail: nexon.gaming97@gmail.com

  3. #3
    Junior Member Array
    Join Date
    Dec 2016
    Location
    Beograd
    Karma
    0

    Default

    Ubacio sam ali nista se ne desava ali hvala za trud u svakom slucaju .

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •