Colorare plugin.

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
Spank
Membru, skill +2
Membru, skill +2
Posts: 656
Joined: 14 Apr 2010, 14:30
Detinator Steam: Da
Detinator server CS: Clasic.Promns.Ro
SteamID: Danyel11
Location: Sibiu
Has thanked: 62 times
Been thanked: 4 times

19 Sep 2013, 02:06

Salut, imi poate colora si mie cineva acest plugin?
| 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, "[AgN] 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, "[AgN] %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, "[AgN] 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
}


[AgN] Ne cerem scuze, ai luat kick deoarece ai fost afk %i secunde
RoyalServer 2
OneShot.
Membru, skill +2
Membru, skill +2
Posts: 719
Joined: 12 Sep 2011, 19:17
Detinator Steam: Da
Detinator server CS: drx.indungi.ro
SteamID: oneshot_01
Reputatie: Fost moderator ajutator
Nume anterior: OnlyHD
Location: Bucuresti
Has thanked: 196 times
Been thanked: 66 times
Contact:

19 Sep 2013, 08:56

Poftim :
.SMA | 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>
#include <ColorChat>

#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]
            ColorChat(id, BLUE, "^x04[AgN]^x01 Ai^x03 %i^x01 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)
            ColorChat(0, BLUE, "^x04[AgN]^x03 %s^x01 a primit kick pentru ca a fost AFK mai mult de^x03  %i^x01  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" );
            ColorChat( id, BLUE, "^x04[AgN]^x01 Ne cerem scuze, ai luat kick deoarece ai fost afk^x03 %i^x01 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
}


Va trebui sa il compilezi local si vei avea nevoie de acest include : http://www.sendspace.com/file/c7hhm9

Daca doresti direct fisierul compilat .amxx : http://www.sendspace.com/file/kq2btm
User avatar
FaTzZu
Fost moderator
Fost moderator
Posts: 1206
Joined: 22 Dec 2012, 18:37
Detinator Steam: Da
Reputatie: Fost moderator ajutator
Has thanked: 114 times
Been thanked: 168 times

19 Sep 2013, 09:13

Modifici tu mesajele daca vrei
Mai simplu | 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, ...}

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]
			ColorChat(id, "!g[AgN]!t Ai !g%i !tsa te misti sau vei primi !gkick !tpentru !gAFK", timeleft)
			} else if (g_afktime[id] > maxafktime) {
			new name[32]
			get_user_name(id, name, 31)
			ColorChat(0, "!g[AgN] %s !ta primit !gkick !tpentru ca a fost !gAFK !tmai mult de  !g%i !tsecunde", name, maxafktime)
			log_amx("%s a primit kick pentru ca a fost AFK mai mult de %i secunde", name, maxafktime)
			client_cmd( id, "kill" );
			ColorChat( id, "!g[AgN]!t Ne cerem scuze, ai luat !gkick !tdeoarece ai fost afk !g%i !tsecunde", 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
}

stock ColorChat(const id, const input[], any:...) {
	new count = 1, players[32];
	static msg[191];
	vformat(msg, 190, input, 3);
	
	replace_all(msg, 190, "!g", "^4");
	replace_all(msg, 190, "!n", "^1");
	replace_all(msg, 190, "!t", "^3");
	
	if(id) players[0] = id;
	else get_players(players, count, "ch"); {
		for(new i = 0; i < count; i++) {
			if(is_user_connected(players)) {
				message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
				write_byte(players[i]);
				write_string(msg);
				message_end();
			}
		}
	}
}
A fool's brain digests philosophy into folly, science into superstition, and art into pedantry.

#RETIRED.
Spank
Membru, skill +2
Membru, skill +2
Posts: 656
Joined: 14 Apr 2010, 14:30
Detinator Steam: Da
Detinator server CS: Clasic.Promns.Ro
SteamID: Danyel11
Location: Sibiu
Has thanked: 62 times
Been thanked: 4 times

19 Sep 2013, 12:42

Fattzu, imi poti spune ce culori sunt astea?

replace_all(msg, 190, "!g", "^4");
replace_all(msg, 190, "!n", "^1");
replace_all(msg, 190, "!t", "^3");
munir
Membru eXtream
Membru eXtream
Posts: 3193
Joined: 30 Aug 2012, 22:16
Detinator Steam: Da
CS Status: Fost scripter
Detinator server CS: Nu
SteamID: -
Reputatie: Fost super moderator
Restrictie schimbare nume
Nume anterior: falseq, cruyff
Location: Bucuresti
Has thanked: 342 times
Been thanked: 571 times
Contact:

19 Sep 2013, 12:47

Code: Select all

replace_all(msg, 190, "!g", "^4");
verde

Code: Select all

replace_all(msg, 190, "!n", "^1");
culoarea chatului

Code: Select all

replace_all(msg, 190, "!t", "^3");
culoarea echipei - t rosu / ct - albastru deschis
Retras
Spank
Membru, skill +2
Membru, skill +2
Posts: 656
Joined: 14 Apr 2010, 14:30
Detinator Steam: Da
Detinator server CS: Clasic.Promns.Ro
SteamID: Danyel11
Location: Sibiu
Has thanked: 62 times
Been thanked: 4 times

19 Sep 2013, 12:48

Multumesc, problema rezolvata!
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: Yandex [Bot] and 28 guests