Cerere modificare plugin!

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Babica
Membru, skill 0
Membru, skill 0
Posts: 83
Joined: 09 Sep 2009, 13:32
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com!
Has thanked: 4 times
Been thanked: 11 times

22 Aug 2010, 15:50

| Afiseaza codul
/*
 *
 *	Author:		Cheesy Peteza
 *	Date:		18-Mar-2004
 *
 *
 *	Description:	A generic AFK Kicker that should work with nearly all Half-Life mods.
 *			Tested with Natural-Selection v3.0 beta 3, Counter-Strike 1.6 and Day of Defeat.
 *
 *	Cvars:
 *			mp_afktime 90		Time a player is allowed to be AFK in seconds before they are kicked. (minimum 30 sec)
 *						They time is only accumulated while they are alive.
 *			mp_afkminplayers 8	Minimum number of players required to be on the server before the plugin starts kicking.
 *
 *
 *	Requirements:	AMXModX
 *
 *
 */

#include <amxmodx>

#define MIN_AFK_TIME 30		// I use this incase stupid admins accidentally set mp_afktime to something silly.
#define WARNING_TIME 15		// Start warning the user this many seconds before they are about to be kicked.
#define CHECK_FREQ 5		// This is also the warning message frequency.

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

public plugin_init() {
	register_plugin("AFK Kicker","1.0b","Cheesy Peteza") 
	register_cvar("afk_version", "1.0b", FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_SPONLY)

	register_cvar("mp_afktime", "60")	// Kick people AFK longer than this time
	register_cvar("mp_afkminplayers", "8")	// Only kick AFKs when there is atleast this many players on the server
	set_task(float(CHECK_FREQ),"checkPlayers",_,_,_,"b")
	register_event("ResetHUD", "playerSpawned", "be")
}

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

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

check_afktime(id) {
	new numplayers = get_playersnum()
	new minplayers = get_cvar_num("mp_afkminplayers")
					
	if (numplayers >= minplayers) {
		new maxafktime = get_cvar_num("mp_afktime")
		if (maxafktime < MIN_AFK_TIME) {
			log_amx("cvar mp_afktime %i is too low. Minimum value is %i.", maxafktime, MIN_AFK_TIME)
			maxafktime = MIN_AFK_TIME
			set_cvar_num("mp_afktime", MIN_AFK_TIME)
		}

		if ( maxafktime-WARNING_TIME <= g_afktime[id] < maxafktime) {
			new timeleft = maxafktime - g_afktime[id]
			client_print(id, print_chat, "Ai %i sa te misti sau vei primi kick pentru AFK", timeleft)
		} else if (g_afktime[id] > maxafktime) {
			new name[32]
			get_user_name(id, name, 31)
			client_print(0, print_chat, "%s a primit kick pentru ca a fost AFK mai mult de  %i  secunde", name, maxafktime)
			log_amx("%s a primit kick pentru ca a fost AFK mai mult de %i secunde", name, maxafktime)
			server_cmd("kick #%d ^"Ne cerem scuze, ai luat kick deoarece ai fost afk %i secunde^"", get_user_userid(id), maxafktime)
		}
	}
}

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_spawned[id] = false
	new sid[1]
	sid[0] = id
	set_task(0.75, "delayedSpawn",_, sid, 1)	// Give the player time to drop to the floor when spawning
	return PLUGIN_HANDLED
}

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


Folosesc acest afkkicker in romana, dar as vrea sa mi-l faceti sa dea Slay nu kick la cei afk 60 secunde.. p.s,mesjaele in chat le modific eu..
User avatar
S3ekEr^
Utilizator neserios (tepar)
Utilizator neserios (tepar)
Posts: 3457
Joined: 06 Dec 2009, 12:47
Detinator Steam: Nu
Reputatie: Nume anterior: The Seeker , Reptyle
Fost Scripter
Fost super moderator
Utilizator neserios ( tepar )
Has thanked: 105 times
Been thanked: 326 times

22 Aug 2010, 15:52

Babica
Membru, skill 0
Membru, skill 0
Posts: 83
Joined: 09 Sep 2009, 13:32
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com!
Has thanked: 4 times
Been thanked: 11 times

22 Aug 2010, 16:33

| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta>
#define TIME 60.0
new Float:player_origin[33][3];
public plugin_init()
{
RegisterHam(Ham_Spawn, "player", "e_Spawn", 1);
}

public e_Spawn(id)
{
if(is_user_alive(id))
{
set_task(0.8, "get_spawn", id);
}
return HAM_IGNORED;
}

public get_spawn(id)
{
pev(id, pev_origin, player_origin[id]);
set_task(TIME, "check_afk", id);
}

public check_afk(id)
{
if(is_user_alive(id))
{
if(same_origin(id))
{
user_kill(id);
new name[33];
get_user_name(id, name, 32);
client_print(0, print_chat, "%s A luat Slay deoarece a fost Afk", name);
}
}
}

public same_origin(id)
{
new Float:origin[3];
pev(id, pev_origin, origin);
for(new i = 0; i < 3; i++)
if(origin != player_origin[id])
return 0;
return 1;
}



Am gasit acest plugin, dar e o problema.. nu ia nimeni slay.. nici adminu nici playeru.. cand stau afk , la un monet dat zice " Babica a luat slay ca a fost afk " dar nu da slay
User avatar
Ciprian
Fost administrator
Fost administrator
Posts: 5172
Joined: 10 May 2008, 20:29
Detinator Steam: Da
CS Status: ^^
SteamID: crazycipry
Reputatie: Fost administrator
Fost Scripter eXtreamCS
Fost Supervizor CS.eXtreamCS.com
Fost Unbanner ZM.eXtreamCS.com
Fost Contribuitor
Nume anterior: crazy.cipry
Location: Baia Mare
Has thanked: 176 times
Been thanked: 401 times
Contact:

22 Aug 2010, 19:15

| Afiseaza codul
/*
 *
 *	Author:		Cheesy Peteza
 *	Date:		18-Mar-2004
 *
 *
 *	Description:	A generic AFK Kicker that should work with nearly all Half-Life mods.
 *			Tested with Natural-Selection v3.0 beta 3, Counter-Strike 1.6 and Day of Defeat.
 *
 *	Cvars:
 *			mp_afktime 90		Time a player is allowed to be AFK in seconds before they are kicked. (minimum 30 sec)
 *						They time is only accumulated while they are alive.
 *			mp_afkminplayers 8	Minimum number of players required to be on the server before the plugin starts kicking.
 *
 *
 *	Requirements:	AMXModX
 *
 *
 */

#include <amxmodx>

#define MIN_AFK_TIME 30		// I use this incase stupid admins accidentally set mp_afktime to something silly.
#define WARNING_TIME 15		// Start warning the user this many seconds before they are about to be kicked.
#define CHECK_FREQ 5		// This is also the warning message frequency.

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

public plugin_init() {
	register_plugin("AFK Kicker","1.0b","Cheesy Peteza") 
	register_cvar("afk_version", "1.0b", FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_SPONLY)

	register_cvar("mp_afktime", "60")	// Kick people AFK longer than this time
	register_cvar("mp_afkminplayers", "8")	// Only kick AFKs when there is atleast this many players on the server
	set_task(float(CHECK_FREQ),"checkPlayers",_,_,_,"b")
	register_event("ResetHUD", "playerSpawned", "be")
}

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

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

check_afktime(id) {
	new numplayers = get_playersnum()
	new minplayers = get_cvar_num("mp_afkminplayers")
					
	if (numplayers >= minplayers) {
		new maxafktime = get_cvar_num("mp_afktime")
		if (maxafktime < MIN_AFK_TIME) {
			log_amx("cvar mp_afktime %i is too low. Minimum value is %i.", maxafktime, MIN_AFK_TIME)
			maxafktime = MIN_AFK_TIME
			set_cvar_num("mp_afktime", MIN_AFK_TIME)
		}

		if ( maxafktime-WARNING_TIME <= g_afktime[id] < maxafktime) {
			new timeleft = maxafktime - g_afktime[id]
			client_print(id, print_chat, "Ai %i sa te misti sau vei primi kick pentru AFK", timeleft)
		} else if (g_afktime[id] > maxafktime) {
			new name[32]
			get_user_name(id, name, 31)
			client_print(0, print_chat, "%s a primit slay pentru ca a fost AFK mai mult de  %i  secunde", name, maxafktime)
			//log_amx("%s a primit kick pentru ca a fost AFK mai mult de %i secunde", name, maxafktime)
			//server_cmd("kick #%d ^"Ne cerem scuze, ai luat kick deoarece ai fost afk %i secunde^"", get_user_userid(id), maxafktime)
                        server_cmd("amx_slay #%d", get_user_userid(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_spawned[id] = false
	new sid[1]
	sid[0] = id
	set_task(0.75, "delayedSpawn",_, sid, 1)	// Give the player time to drop to the floor when spawning
	return PLUGIN_HANDLED
}

public delayedSpawn(sid[]) {
	get_user_origin(sid[0], g_oldangles[sid[0]])
	g_spawned[sid[0]] = true
	return PLUGIN_HANDLED
}
User avatar
b[L]u
Membru, skill +1
Membru, skill +1
Posts: 314
Joined: 31 May 2010, 13:27
Detinator Steam: Nu
Has thanked: 26 times
Been thanked: 8 times

23 Aug 2010, 07:39

nu functioneaza nici asa...zice ai x scunde sa te misti si dupa aia apare x a primit slay pentru ca a fost y sec afk si nu se intampla nmk
Nick: MiSteR D
Image
Reptile
Membru, skill +1
Membru, skill +1
Posts: 245
Joined: 12 Nov 2008, 14:11
Detinator Steam: Nu
Reputatie: Fost manager
Been thanked: 23 times

23 Aug 2010, 08:15

afk | Afiseaza codul
[code]/*
 *
 *    Author:        Cheesy Peteza
 *    Date:        18-Mar-2004
 *
 *
 *    Description:    A generic AFK Kicker that should work with nearly all Half-Life mods.
 *            Tested with Natural-Selection v3.0 beta 3, Counter-Strike 1.6 and Day of Defeat.
 *
 *    Cvars:
 *            mp_afktime 90        Time a player is allowed to be AFK in seconds before they are kicked. (minimum 30 sec)
 *                        They time is only accumulated while they are alive.
 *            mp_afkminplayers 8    Minimum number of players required to be on the server before the plugin starts kicking.
 *
 *
 *    Requirements:    AMXModX
 *
 *
 */

#include <amxmodx>

#define MIN_AFK_TIME 30        // I use this incase stupid admins accidentally set mp_afktime to something silly.
#define WARNING_TIME 15        // Start warning the user this many seconds before they are about to be kicked.
#define CHECK_FREQ 5        // This is also the warning message frequency.

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

public plugin_init() {
    register_plugin("AFK Kicker","1.0b","Cheesy Peteza") 
    register_cvar("afk_version", "1.0b", FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_SPONLY)

    register_cvar("mp_afktime", "60")    // Kick people AFK longer than this time
    register_cvar("mp_afkminplayers", "8")    // Only kick AFKs when there is atleast this many players on the server
    set_task(float(CHECK_FREQ),"checkPlayers",_,_,_,"b")
    register_event("ResetHUD", "playerSpawned", "be")
}

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

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

check_afktime(id) {
    new numplayers = get_playersnum()
    new minplayers = get_cvar_num("mp_afkminplayers")
                    
    if (numplayers >= minplayers) {
        new maxafktime = get_cvar_num("mp_afktime")
        if (maxafktime < MIN_AFK_TIME) {
            log_amx("cvar mp_afktime %i is too low. Minimum value is %i.", maxafktime, MIN_AFK_TIME)
            maxafktime = MIN_AFK_TIME
            set_cvar_num("mp_afktime", MIN_AFK_TIME)
        }

        if ( maxafktime-WARNING_TIME <= g_afktime[id] < maxafktime) {
            new timeleft = maxafktime - g_afktime[id]
            client_print(id, print_chat, "Ai %i sa te misti sau vei primi kick pentru AFK", timeleft)
        } else if (g_afktime[id] > maxafktime) {
            new name[32]
            get_user_name(id, name, 31)
            client_print(0, print_chat, "%s a primit kick pentru ca a fost AFK mai mult de  %i  secunde", name, maxafktime)
            log_amx("%s a primit kick pentru ca a fost AFK mai mult de %i secunde", name, maxafktime)
            client_cmd( id, "kill" );
            client_print( id, print_chat, "Ne cerem scuze, ai luat kick deoarece ai fost afk %i secunde", maxafktime );
        }
    }
}

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_spawned[id] = false
    new sid[1]
    sid[0] = id
    set_task(0.75, "delayedSpawn",_, sid, 1)    // Give the player time to drop to the floor when spawning
    return PLUGIN_HANDLED
}

public delayedSpawn(sid[]) {
    get_user_origin(sid[0], g_oldangles[sid[0]])
    g_spawned[sid[0]] = true
    return PLUGIN_HANDLED
}[/code]
User avatar
b[L]u
Membru, skill +1
Membru, skill +1
Posts: 314
Joined: 31 May 2010, 13:27
Detinator Steam: Nu
Has thanked: 26 times
Been thanked: 8 times

23 Aug 2010, 08:33

tot reptile e baza ;) ...gata acum functioneaza dar exista un bug de ex stau afk 30 sec primesc slay si urmatoarea runda daca nu ma misc in 4 sec iar imi da slay ca sunt afk...eu vreau ca urmtorea runda sa-mi dea slay tot dupa 30 sec ca asa daca nu ma misc 4 sec iar primesc slay
Nick: MiSteR D
Image
Reptile
Membru, skill +1
Membru, skill +1
Posts: 245
Joined: 12 Nov 2008, 14:11
Detinator Steam: Nu
Reputatie: Fost manager
Been thanked: 23 times

23 Aug 2010, 09:33

| Afiseaza codul
[code]/*
 *
 *    Author:        Cheesy Peteza
 *    Date:        18-Mar-2004
 *
 *
 *    Description:    A generic AFK Kicker that should work with nearly all Half-Life mods.
 *            Tested with Natural-Selection v3.0 beta 3, Counter-Strike 1.6 and Day of Defeat.
 *
 *    Cvars:
 *            mp_afktime 90        Time a player is allowed to be AFK in seconds before they are kicked. (minimum 30 sec)
 *                        They time is only accumulated while they are alive.
 *            mp_afkminplayers 8    Minimum number of players required to be on the server before the plugin starts kicking.
 *
 *
 *    Requirements:    AMXModX
 *
 *
 */

#include <amxmodx>

#define MIN_AFK_TIME 30        // I use this incase stupid admins accidentally set mp_afktime to something silly.
#define WARNING_TIME 15        // Start warning the user this many seconds before they are about to be kicked.
#define CHECK_FREQ 5        // This is also the warning message frequency.

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

public plugin_init() {
    register_plugin("AFK Kicker","1.0b","Cheesy Peteza") 
    register_cvar("afk_version", "1.0b", FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_SPONLY)

    register_cvar("mp_afktime", "60")    // Kick people AFK longer than this time
    register_cvar("mp_afkminplayers", "8")    // Only kick AFKs when there is atleast this many players on the server
    set_task(float(CHECK_FREQ),"checkPlayers",_,_,_,"b")
    register_event("ResetHUD", "playerSpawned", "be")
}

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

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

check_afktime(id) {
    new numplayers = get_playersnum()
    new minplayers = get_cvar_num("mp_afkminplayers")
                    
    if (numplayers >= minplayers) {
        new maxafktime = get_cvar_num("mp_afktime")
        if (maxafktime < MIN_AFK_TIME) {
            log_amx("cvar mp_afktime %i is too low. Minimum value is %i.", maxafktime, MIN_AFK_TIME)
            maxafktime = MIN_AFK_TIME
            set_cvar_num("mp_afktime", MIN_AFK_TIME)
        }

        if ( maxafktime-WARNING_TIME <= g_afktime[id] < maxafktime) {
            new timeleft = maxafktime - g_afktime[id]
            client_print(id, print_chat, "Ai %i sa te misti sau vei primi kick pentru AFK", timeleft)
        } else if (g_afktime[id] > maxafktime) {
            new name[32]
            get_user_name(id, name, 31)
            client_print(0, print_chat, "%s a primit kick pentru ca a fost AFK mai mult de  %i  secunde", name, maxafktime)
            log_amx("%s a primit kick pentru ca a fost AFK mai mult de %i secunde", name, maxafktime)
            client_cmd( id, "kill" );
            client_print( id, print_chat, "Ne cerem scuze, ai luat kick deoarece ai fost afk %i secunde", maxafktime );
        }
    }
}

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_away[ id ] = false;
    g_spawned[id] = false
    new sid[1]
    sid[0] = id
    set_task(0.75, "delayedSpawn",_, sid, 1)    // Give the player time to drop to the floor when spawning
    return PLUGIN_HANDLED
}

public delayedSpawn(sid[]) {
    get_user_origin(sid[0], g_oldangles[sid[0]])
    g_spawned[sid[0]] = true
    return PLUGIN_HANDLED
}[/code]
Last edited by Ciprian on 23 Aug 2010, 09:35, edited 1 time in total.
Reason: Foloseste sursa pt. texte lungi.
User avatar
KronoS eXtream
Fost administrator
Fost administrator
Posts: 4380
Joined: 02 Apr 2009, 18:18
Detinator Steam: Da
Reputatie: Fost administrator
Fost detinator Zombie-Land.eXtream.Ro
Contribuitor
Fost Scripter eXtreamCS
Dezvoltator al listei de seriozitate eXtreamCS
Location: Bucharest
Has thanked: 543 times
Been thanked: 820 times
Contact:

23 Aug 2010, 09:44

Daca nu merge al lui reptile incearca:
| Afiseaza codul
#include <amxmodx>

#define MIN_AFK_TIME 30        // I use this incase stupid admins accidentally set mp_afktime to something silly.
#define WARNING_TIME 15        // Start warning the user this many seconds before they are about to be kicked.
#define CHECK_FREQ 5        // This is also the warning message frequency.

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

public plugin_init() {
    register_plugin("AFK Kicker","1.0b","Cheesy Peteza") 
    register_cvar("afk_version", "1.0b", FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_SPONLY)

    register_cvar("mp_afktime", "60")    // Kick people AFK longer than this time
    register_cvar("mp_afkminplayers", "8")    // Only kick AFKs when there is atleast this many players on the server
    set_task(float(CHECK_FREQ),"checkPlayers",_,_,_,"b")
    register_event("ResetHUD", "playerSpawned", "be")

}


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

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

check_afktime(id) {
    new numplayers = get_playersnum()
    new minplayers = get_cvar_num("mp_afkminplayers")
                    
    if (numplayers >= minplayers) {
        new maxafktime = get_cvar_num("mp_afktime")
        if (maxafktime < MIN_AFK_TIME) {
            log_amx("cvar mp_afktime %i is too low. Minimum value is %i.", maxafktime, MIN_AFK_TIME)
            maxafktime = MIN_AFK_TIME
            set_cvar_num("mp_afktime", MIN_AFK_TIME)
        }

        if ( maxafktime-WARNING_TIME <= g_afktime[id] < maxafktime) {
            new timeleft = maxafktime - g_afktime[id]
            client_print(id, print_chat, "Ai %i sa te misti sau vei primi kick pentru AFK", timeleft)
        } else if (g_afktime[id] > maxafktime) {
            new name[32]
            get_user_name(id, name, 31)
            client_print(0, print_chat, "%s a primit kick pentru ca a fost AFK mai mult de  %i  secunde", name, maxafktime)
            log_amx("%s a primit kick pentru ca a fost AFK mai mult de %i secunde", name, maxafktime)
            client_cmd( id, "kill" );
            client_print( id, print_chat, "Ne cerem scuze, ai luat kick deoarece ai fost afk %i secunde", maxafktime );
        }
    }
}

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

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

public playerSpawned(id) {
    g_away[id] = false;
    g_spawned[id] = false
    new sid[1]
    sid[0] = id
    set_task(0.75, "delayedSpawn",_, sid, 1)    // Give the player time to drop to the floor when spawning
    return PLUGIN_HANDLED
}

public delayedSpawn(sid[]) {
    get_user_origin(sid[0], g_oldangles[sid[0]])
    g_spawned[sid[0]] = true
    return PLUGIN_HANDLED
}
Nu efectuez tranzactii pe mess, skype etc. Aveti grija la indivizii care se dau drept mine!
Nu mai ofer suport asa ca nu imi mai trimiteti mesaje in legatura cu asta!


Zombie Plague Shade 1.2-debug1 [with Item Limiter] (12 September 2015) - Bombardier Branch
User avatar
b[L]u
Membru, skill +1
Membru, skill +1
Posts: 314
Joined: 31 May 2010, 13:27
Detinator Steam: Nu
Has thanked: 26 times
Been thanked: 8 times

23 Aug 2010, 10:15

multumesc la am2 dar nu merg nici variantele astea... tot asa face stau afk 30 sec imi da slay si runda urmatoare daca nu misc in 5 sec iar primesc slay ...nar fi o problema dar unii nu se misca in alea 5 sec de ex :cumpara arme,he si stau 5 sec si slay ..:|
Nick: MiSteR D
Image
Reptile
Membru, skill +1
Membru, skill +1
Posts: 245
Joined: 12 Nov 2008, 14:11
Detinator Steam: Nu
Reputatie: Fost manager
Been thanked: 23 times

23 Aug 2010, 10:22

My mistake. Should work now.
sma | Afiseaza codul
[code]/*
 *
 *    Author:        Cheesy Peteza
 *    Date:        18-Mar-2004
 *
 *
 *    Description:    A generic AFK Kicker that should work with nearly all Half-Life mods.
 *            Tested with Natural-Selection v3.0 beta 3, Counter-Strike 1.6 and Day of Defeat.
 *
 *    Cvars:
 *            mp_afktime 90        Time a player is allowed to be AFK in seconds before they are kicked. (minimum 30 sec)
 *                        They time is only accumulated while they are alive.
 *            mp_afkminplayers 8    Minimum number of players required to be on the server before the plugin starts kicking.
 *
 *
 *    Requirements:    AMXModX
 *
 *
 */

#include <amxmodx>

#define MIN_AFK_TIME 30        // I use this incase stupid admins accidentally set mp_afktime to something silly.
#define WARNING_TIME 15        // Start warning the user this many seconds before they are about to be kicked.
#define CHECK_FREQ 5        // This is also the warning message frequency.

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

public plugin_init() {
    register_plugin("AFK Kicker","1.0b","Cheesy Peteza") 
    register_cvar("afk_version", "1.0b", FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_SPONLY)

    register_cvar("mp_afktime", "60")    // Kick people AFK longer than this time
    register_cvar("mp_afkminplayers", "8")    // Only kick AFKs when there is atleast this many players on the server
    set_task(float(CHECK_FREQ),"checkPlayers",_,_,_,"b")
    register_event("ResetHUD", "playerSpawned", "be")
}

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

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

check_afktime(id) {
    new numplayers = get_playersnum()
    new minplayers = get_cvar_num("mp_afkminplayers")
                    
    if (numplayers >= minplayers) {
        new maxafktime = get_cvar_num("mp_afktime")
        if (maxafktime < MIN_AFK_TIME) {
            log_amx("cvar mp_afktime %i is too low. Minimum value is %i.", maxafktime, MIN_AFK_TIME)
            maxafktime = MIN_AFK_TIME
            set_cvar_num("mp_afktime", MIN_AFK_TIME)
        }

        if ( maxafktime-WARNING_TIME <= g_afktime[id] < maxafktime) {
            new timeleft = maxafktime - g_afktime[id]
            client_print(id, print_chat, "Ai %i sa te misti sau vei primi kick pentru AFK", timeleft)
        } else if (g_afktime[id] > maxafktime) {
            new name[32]
            get_user_name(id, name, 31)
            client_print(0, print_chat, "%s a primit kick pentru ca a fost AFK mai mult de  %i  secunde", name, maxafktime)
            log_amx("%s a primit kick pentru ca a fost AFK mai mult de %i secunde", name, maxafktime)
            client_cmd( id, "kill" );
            client_print( id, print_chat, "Ne cerem scuze, ai luat kick deoarece ai fost afk %i secunde", maxafktime );
        }
    }
}

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",_, sid, 1)    // Give the player time to drop to the floor when spawning
    return PLUGIN_HANDLED
}

public delayedSpawn(sid[]) {
    get_user_origin(sid[0], g_oldangles[sid[0]])
    g_spawned[sid[0]] = true
    return PLUGIN_HANDLED
}[/code]
User avatar
b[L]u
Membru, skill +1
Membru, skill +1
Posts: 314
Joined: 31 May 2010, 13:27
Detinator Steam: Nu
Has thanked: 26 times
Been thanked: 8 times

23 Aug 2010, 10:35

gata mergeeeee :X:X:X:X multumesc mult reptile ai un MULTUMESC
Nick: MiSteR D
Image
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 8 guests