Цвет сообщений AFK Manager

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
101
Реакции
18
Ошибка
Отсутствует
ОС
Linux
Amx Mod X
AMX Mod X 1.9.0.5294 (http://www.amxmodx.org)
Authors:
David "BAILOPAN" Anderson, Pavol "PM OnoTo" Marko
Felix "SniperBeamer" Geyer, Jonny "Got His Gun" Bergstrom
Lukasz "SidLuke" Wlasinski, Christian "Basic-Master" Hammacher
Borja "faluco" Ferrer, Scott "DS" Ehlert
Compiled: Dec 3 2021 15:54:56
Built from: https://github.com/alliedmodders/amxmodx/commit/363871a
Build ID: 5294:363871a
Core mode: JIT+ASM32
Билд
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
ReHLDS version: 3.13.0.813-dev-mpatch
Build date: 15:28:10 Mar 13 2024 (3623)
Build from: https://github.com/dreamstalker/rehlds/commit/05f4a27
ReGamedll
ReGameDLL version: 5.26.0.668-dev
Build date: 19:02:48 Dec 31 2023
Build from: https://github.com/s1lentq/ReGameDLL_CS/commit/d3c0ec8
Версия Metamod
Metamod-r v1.3.0.138, API (5:13)
Metamod-r build: 11:50:32 Nov 28 2023
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/5179c25
Список метамодулей
Currently loaded plugins:
description stat pend file vers src load unload
[ 1] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5294 ini Start ANY
[ 2] Reunion RUN - reunion_mm_i386.so v0.1.92d ini Start Never
[ 3] Revoice RUN - revoice_plus_mm.so v2.0.5 ini ANY Never
[ 4] HitBox Fix RUN - hitbox_fix_mm_i386.so v1.1.5 ini Start ANY
[ 5] ReSemiclip RUN - resemiclip_mm_i386.so v2.4.3 ini Chlvl ANY
[ 6] Rechecker RUN - rechecker_mm_i386.so v2.7 ini Chlvl ANY
[ 7] ReSRDetector RUN - resrdetector_mm_i386.so v0.1.0 ini Chlvl ANY
[ 8] SafeNameAndChat RUN - SafeNameAndChat.so v1.2 Beta 3 ini ANY ANY
[ 9] Ultimate Unprecacher RUN - unprecacher_i386.so vBeta 2.5.3 ini Chlvl Chlvl
[10] MySQL RUN - mysql_amxx_i386.so v1.9.0.5294 pl1 ANY ANY
[11] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl1 ANY Never
[12] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5294 pl1 ANY ANY
[13] GeoIP RUN - geoip_amxx_i386.so v1.9.0.5294 pl1 ANY ANY
[14] Amxx Easy Http RUN - easy_http_amxx_i386.so v1.3.0 pl1 ANY ANY
[15] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5294 pl1 ANY ANY
[16] Engine RUN - engine_amxx_i386.so v1.9.0.5294 pl1 ANY ANY
[17] ReAPI RUN - reapi_amxx_i386.so v5.24.0.300-dev pl1 ANY Never
[18] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5294 pl1 ANY ANY
[19] Orpheu RUN - orpheu_amxx_i386.so v2.6.3 pl1 ANY ANY
[20] Fun RUN - fun_amxx_i386.so v1.9.0.5294 pl1 ANY ANY
[21] SQLite RUN - sqlite_amxx_i386.so v1.9.0.5294 pl1 ANY ANY
21 plugins, 21 running
Список плагинов
Currently loaded plugins:
name version author file status
[ 1] AMXBans: Core Gm 1.6 Larte Team amxbans_core.am running
[ 2] AMXBans: Main Gm 1.6 Larte Team amxbans_main.am running
[ 3] FreshBans 1.4.8b kanagava fresh_bans_148- running
[ 4] Bypass Guard 1.0.9 mx?! bypass_guard.am running
[ 5] [BG] Supervisor 0.4 mx?! bg_supervisor.a running
[ 6] [BG] Provider: GeoIP 0.3 mx?! bg_provider_geo running
[ 7] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 8] Vac Ban Status 0.0.1 Albertio vac_ban_status. running
[ 9] Ping Checker 26.0.1 RC1 h1k3 ping_checker.am running
[ 10] CSXSQL: Onlinetime Awa 0.2 serfreeman1337 csstatsx_playti running
[ 11] CSStatsX SQL 0.7.4+2 serfreeman1337 csstatsx_sql.am running
[ 12] AES: StatsX 0.5+1 serfreeman1337 aes_statsx_cstr running
[ 13] ACS injection med-kit 1.0.6.2 DEV-CS.RU acs_injection.a running
[ 14] [ReAPI] Healthnade 0.0.18f DEV-CS.RU Commun reapi_healthnad running
[ 15] Molotov Cocktail API 2.31 CHEL74 + mx?! molotov_cocktai running
[ 16] Admin Commands 1.9.0.5294 AMXX Dev Team admincmd.amxx running
[ 17] Slots Reservation 1.9.0.5294 AMXX Dev Team adminslots.amxx running
[ 18] AFK Manager v1.6 Leon McVeran afk_manager.amx running
[ 19] Menus Front-End 1.9.0.5294 AMXX Dev Team menufront.amxx running
[ 20] Commands Menu 1.9.0.5294 AMXX Dev Team cmdmenu.amxx running
[ 21] Players Menu 1.9.0.5294 AMXX Dev Team plmenu.amxx running
[ 22] Maps Menu 1.9.0.5294 AMXX Dev Team mapsmenu.amxx running
[ 23] Plugin Menu 1.9.0.5294 AMXX Dev Team pluginmenu.amxx running
[ 24] Reklama 20.05.2020 mx?! reklama.amxx running
[ 25] Admin Chat 1.9.0.5294 AMXX Dev Team adminchat.amxx running
[ 26] Scrolling Message 1.9.0.5294 AMXX Dev Team scrollmsg.amxx running
[ 27] Info. Messages 1.9.0.5294 AMXX Dev Team imessage.amxx running
[ 28] Admin Votes 1.9.0.5294 AMXX Dev Team adminvote.amxx running
[ 29] Chat Manager 1.1.2-16 Mistrick chatmanager.amx running
[ 30] Chat Manager: Addon 0.0.4-70 Mistrick chatmanager_add running
[ 31] NextMap 1.9.0.5294 AMXX Dev Team nextmap.amxx running
[ 32] Nextmap Chooser 1.9.0.5294 AMXX Dev Team mapchooser.amxx running
[ 33] TimeLeft 1.9.0.5294 AMXX Dev Team timeleft.amxx running
[ 34] FocusOnVotemap 1.2.1 Boec[SpecOPs] focus_on_votema running
[ 35] Pause Plugins 1.9.0.5294 AMXX Dev Team pausecfg.amxx running
[ 36] Stats Configuration 1.9.0.5294 AMXX Dev Team statscfg.amxx running
[ 37] StatsX Colored TOP15 1.9.0.5294 AMXX Dev Team Statsx_Colored_ running
[ 38] CS Stats Logging 1.9.0.5294 AMXX Dev Team stats_logging.a running
[ 39] Vip Modular 5.0.0-b12 ArKaNeMaN VipModular.amxx running
[ 40] [VipM] Modules Limiter 5.0.0-b12 ArKaNeMaN VipM-ModulesLim running
[ 41] [VipM] Misc 5.0.0-b12 ArKaNeMaN VipM-Misc.amxx running
[ 42] [VipM][M] Weapon Menu 5.0.0-b12 ArKaNeMaN VipM-M-WeaponMe running
[ 43] [VipM-M] Vip in TAB 5.0.0-b12 ArKaNeMaN VipM-M-VipInTab running
[ 44] [VipM][M] Vampire 5.0.0-b12 ArKaNeMaN VipM-M-Vampire. running
[ 45] [VipM-M] Spawn Items 5.0.0-b12 ArKaNeMaN VipM-M-SpawnIte running
[ 46] [VipM][M] Spawn Health 5.0.0-b12 ArKaNeMaN VipM-M-SpawnHea running
[ 47] [VipM][L] Logic 5.0.0-b12 ArKaNeMaN VipM-L-Logic.am running
[ 48] [VipM][L] Default 5.0.0-b12 ArKaNeMaN VipM-L-Default. running
[ 49] [VipM] Items Controlle 5.0.0-b12 ArKaNeMaN VipM-ItemsContr running
[ 50] [VipM-I] Limits 5.0.0-b12 ArKaNeMaN VipM-I-Limits.a running
[ 51] [VipM][I] Default 5.0.0-b12 ArKaNeMaN VipM-I-Default. running
[ 52] [VipM-I] CWAPI 1.0.0 ArKaNeMaN VipM-I-Cwapi.am running
[ 53] unknown unknown unknown VipM-I-ACSInjec running
[ 54] [VipM-I] Health Nade 1.1.0 ArKaNeMaN VipM-I-HealthNa running
[ 55] [VipM-M] Multi Jump 1.2.0 ArKaNeMaN VipM-M-MultiJum running
[ 56] [VipM-I] BlackSignatur 1.0.0 ArKaNeMaN VipM-I-BlackSig running
[ 57] [190] Ultimate Flags 22.11.15 SKAJIbnEJIb ultimate_flags. running
[ 58] [Talisman Modular] Cor 1.0 beta ImmortalAmxx AmxxTalismanCor running
[ 59] [Talisman Modular] Giv 1.0 beta ImmortalAmxx AmxxTalismanGiv running
[ 60] [Talisman Modular] Giv 1.0 beta ImmortalAmxx AmxxTalismanGiv running
[ 61] [Talisman Modular] Not 1.0 beta ImmortalAmxx AmxxTalismanNot running
[ 62] [ReAPI] Silly C4 2.0 F@ntoM & Cheap_S reapi_sillyc4.a running
[ 63] ADV. QUAKE SOUNDS (ENA 8.0 HATTRICK (HTTRCK AQS.amxx running
[ 64] New Dance Menu 2.4 b0t. NewDanceMenu.am running
[ 65] Bomb Taker 0.0.2b Vaqtincha bomb_taker.amxx running
[ 66] Parachute Lite [ReAPI] 11.0 Leo_[BH] parachute_lite. running
[ 67] Reset Score 1.0 Silenttt resetscore.amxx running
[ 68] [190] Piss RBS 20.06.06 SKAJIbnEJIb & KR piss_rbs.amxx running
[ 69] [190] C4 Destroyer 21.03.23 SKAJIbnEJIb c4_destroyer.am running
[ 70] c4 timer 1.1 cheap_suit c4timer.amxx running
[ 71] WeaponBox Pack 0.2 Vaqtincha WeaponBoxPack.a running
[ 72] CS:GO Inspect Weapon beta-v1.0 hellmonja inspect.amxx running
[ 73] Knife Duel with Telepo 1.5 neygomon knife_duel_with running
[ 74] Custom Weapons API 0.7.5 ArKaNeMaN CustomWeaponsAP running
[ 75] Grenade Animation 3rd 1.0 Prefers to be An grenade_animati running
[ 76] Advanced Kill Assists 1.5 Xelson next21_kill_ass running
[ 77] [ReAPI] Grenade Trile 1.2 Base Code: Fatih reapi_grenade_t running
[ 78] C4 GIBS 1.0 Garey c4_gibs.amxx running
[ 79] SPLESHING ON THE WATER 1.5 MayroN | KRoTaL splashing_on_th running
[ 80] [GeoIP] Connect Info 1.0.0 Nordic Warrior geoip_connect_i running
[ 81] Demo Recorder 2.4.1 F@nt0M demo_recorder.a running
[ 82] Simple Damager 2.1.0 fl0wer simple_damager. running
[ 83] [ReAPI] AWPoff 1.3 PAffAEJIkA :3 awp_off.amxx running
[ 84] Revive Teammates: Core 1.1.7 ufame & Albertio rt_core.amxx running
[ 85] Revive Teammates: Plan 1.1.7 ufame & Albertio rt_planting.amx running
[ 86] Revive Teammates: Rest 1.1.7 ufame & Albertio rt_restrictions running
[ 87] Revive Teammates: Time 1.1.7 ufame & Albertio rt_timer.amxx running
[ 88] Revive Teammates: Effe 1.1.7 ufame & Albertio rt_effects.amxx running
[ 89] Revive Teammates: Soun 1.1.7 ufame & Albertio rt_sounds.amxx running
[ 90] Revive Teammates: Bonu 1.1.7 ufame & Albertio rt_bonus.amxx running
[ 91] Advanced Experience Sy 0.5.9 [REA serfreeman1337/s aes_main.amxx running
[ 92] AES: CStrike Addon 0.5.9 [REA serfreeman1337/s aes_exp_cstrike running
[ 93] AES: Informer 0.5.9 [REA serfreeman1337/s aes_informer.am running
[ 94] AES: Bonus System 0.5.9 Vega serfreeman1337/s aes_bonus_syste running
[ 95] AES: Bonus CSTRIKE 0.5.9.1 [R serfreeman1337/s aes_bonus_cstri running
[ 96] Custom Player Models A 0.2.5 F@nt0M & BlackSi custom_player_m running
[ 97] Custom Player Models C 0.2.2 BlackSignature custom_player_m running
[ 98] Custom Player Models T 0.2.1 BlackSignature custom_player_m running
[ 99] ChatAdditions: Core v1.9.4 Sergey Shorokhov ChatAdditions_C debug
[100] ChatAdditions: CSBans v1.9.4 Sergey Shorokhov CA_Storage_CSBa debug
[101] CA: Anti Flood v1.9.4 Nordic Warrior CA_AntiFlood.am debug
[102] CA: Mute v1.9.4 Sergey Shorokhov CA_Mute.amxx debug
[103] CA Addon: Death mute v1.9.4 Sergey Shorokhov CA_Addon_DeathM debug
[104] CA Addon: Rank restric v1.9.4 steelzzz CA_Addon_RankRe debug
[105] CA: VoteGAG 1.0.1-alph Sergey Shorokhov CA_Addon_VoteGa debug
[106] CA Addon: Request UnGA v1.9.4 steelzzz CA_Addon_Reques debug
[107] CA: Gag v1.9.4 Sergey Shorokhov CA_Gag.amxx debug
[108] AMXBans: Screens Gm 1.6 Larte Team amxbans_ssban.a running
[109] Map Manager: Core 3.2.1 Mistrick map_manager_cor running
[110] Map Manager: Scheduler 0.2.1 Mistrick map_manager_sch running
[111] Map Manager: Rtv 0.1.5 Mistrick map_manager_rtv running
[112] Map Manager: Nominatio 0.3.5 Mistrick map_manager_nom running
[113] Map Manager: BlockList 0.0.4 Mistrick map_manager_blo running
[114] Map Manager: Online so 0.0.4 Mistrick map_manager_onl running
[115] Map Manager: Effects 0.1.3 Mistrick map_manager_eff running
[116] Map Manager: Informer 0.0.5 Mistrick map_manager_inf running
[117] Map Manager: Sounds 0.0.3 Mistrick map_manager_sou running
117 plugins, 117 running
Автор плагина
Leon McVeran
Версия плагина
v1.6
Исходный код
#define PLUGIN 	"AFK Manager"
#define AUTHOR "Leon McVeran"
#define VERSION "v1.6"
#define PDATE "2nd August 2011"

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta>

#define KICK_IMMUNITY ADMIN_BAN

#define TASK_AFK_CHECK 142500
#define FREQ_AFK_CHECK 5.0
#define MAX_WARN 3

static const OFFSET_LINUX = 5
new const m_iJoiningState = 125

new bool:g_bSpec[33]
new bool:g_bSpecAccess[33]
new Float:g_fLastActivity[33]
new g_iAFKCheck
new g_iAFKTime[33]
new g_iDropBomb
new g_iKickTime
new g_iMaxPlayers
new g_iMinPlayers
new g_iTransferTime
new g_iWarn[33]
new g_vOrigin[33][3]

new CVAR_afk_drop_bomb
new CVAR_afk_check
new CVAR_afk_transfer_time
new CVAR_afk_kick_time
new CVAR_afk_kick_players

new CVAR_afk_spec_pw


public plugin_init(){
register_plugin(PLUGIN, VERSION, AUTHOR)
register_dictionary("afk_manager.txt")

register_logevent("event_round_end", 2, "0=World triggered", "1=Round_End")
register_logevent("event_round_start", 2, "0=World triggered", "1=Round_Start")

// Support der alten Menьs
register_clcmd("jointeam", "cmd_jointeam") // new menu
register_menucmd(register_menuid("Team_Select", 1), 511, "cmd_jointeam") // old menu

register_clcmd("joinclass", "cmd_joinclass") // new menu
register_menucmd(register_menuid("Terrorist_Select", 1), 511, "cmd_joinclass") // old menu
register_menucmd(register_menuid("CT_Select", 1), 511, "cmd_joinclass") // old menu

register_clcmd("say", "cmd_say")

CVAR_afk_check = register_cvar("afk_check", "1")
CVAR_afk_drop_bomb = register_cvar("afk_drop_bomb", "2")
CVAR_afk_transfer_time = register_cvar("afk_transfer_time", "9")
CVAR_afk_kick_time = register_cvar("afk_kick_time", "24")
CVAR_afk_kick_players = register_cvar("afk_kick_players", "12")

CVAR_afk_spec_pw = register_cvar("afk_spec_pw", "password")
}

public plugin_cfg(){
g_iMaxPlayers = get_maxplayers()
}

public client_connect(id){

// Spieler als Spectator entmarkieren
g_bSpec[id] = false
g_bSpecAccess[id] = false

// Positionen zurьcksetzen
g_vOrigin[id] = {0, 0, 0}

// Counter zurьcksetzen
g_iAFKTime[id] = 0
g_iWarn[id] = 0
}

public event_round_start(){

// AFK Check eingeschaltet
g_iAFKCheck = get_pcvar_num(CVAR_afk_check)
if (g_iAFKCheck){

// Spawn-Positionen aktualisieren
new iPlayers[32], pNum
get_players(iPlayers, pNum, "a")
for (new p = 0; p < pNum; p++){
get_user_origin(iPlayers[p], g_vOrigin[iPlayers[p]])
}

// Loop anlegen falls nicht vorhanden
if (!task_exists(TASK_AFK_CHECK)) set_task(FREQ_AFK_CHECK, "func_afk_check", TASK_AFK_CHECK, _, _, "b")

// Kick und Transferzeiten festlegen
if (get_pcvar_num(CVAR_afk_transfer_time) < 6) set_pcvar_num(CVAR_afk_transfer_time, 6)
if (get_pcvar_num(CVAR_afk_kick_time) < 6) set_pcvar_num(CVAR_afk_kick_time, 6)
g_iDropBomb = get_pcvar_num(CVAR_afk_drop_bomb)
g_iTransferTime = get_pcvar_num(CVAR_afk_transfer_time)
g_iKickTime = get_pcvar_num(CVAR_afk_kick_time)
g_iMinPlayers = get_pcvar_num(CVAR_afk_kick_players)
}

// AFK Check ausgeschaltet
else{

// Loop lцschen falls vorhanden
if (task_exists(TASK_AFK_CHECK)) remove_task(TASK_AFK_CHECK)
}


}

public event_round_end(){

// Check darf nicht durchgefьhrt werden
g_iAFKCheck = 0
}

public cmd_jointeam(id){

// Spieler als Spectator markieren, sonst kann man den Kick umgehen, indem man keiner Klasse joined.
g_bSpec[id] = true
}

public cmd_joinclass(id){

// Spieler als Spectator entmarkieren
g_bSpec[id] = false

// Positionen zurьcksetzen
g_vOrigin[id] = {0, 0, 0}

// Counter zurьcksetzen
g_iAFKTime[id] = 0
g_iWarn[id] = 0
}

public cmd_say(id){
new szMsg[64], szCommand[16], szTrash[2]
read_args(szMsg, 63)
remove_quotes(szMsg)
parse(szMsg, szCommand, 15, szTrash, 1)

// Wir interessieren uns nur fьr Chatnachrichten die nicht mehr als 2 Wцrter beinhalten
if (!szTrash[0]){

new szPassword[32]
get_pcvar_string(CVAR_afk_spec_pw, szPassword, 31)
if (equal(szCommand, szPassword)){
client_print_color(id, print_chat, "[AMXX] %L", LANG_PLAYER, "AFK_ACCESS_GRANTED")
g_bSpecAccess[id] = true
return PLUGIN_HANDLED
}
}
return PLUGIN_CONTINUE
}

public func_afk_check(taskid){
if (g_iAFKCheck){
new CsTeams:eTeam

// Alle Spieler ьberprьfen
for (new id = 1; id <= g_iMaxPlayers; id++){

// Bots nicht ьberprьfen
if (is_user_bot(id)) continue

// AFK Funktionen fьr Specs
if (is_user_connected(id) && !is_user_hltv(id)){
eTeam = cs_get_user_team(id)
if (eTeam == CS_TEAM_SPECTATOR || eTeam == CS_TEAM_UNASSIGNED || g_bSpec[id]){

// Counter erhцhen
g_iAFKTime[id]++

// Spec-Kick
if (g_iAFKTime[id] >= g_iKickTime - MAX_WARN){
func_kick_player(id)
}
}
}

// AFK Funktionen fьr lebende Spieler
if (is_user_alive(id)){

// Positionen ьberprьfen
if (g_iAFKCheck == 1){
new vOrigin[3]
get_user_origin(id, vOrigin)

if (g_vOrigin[id][0] != vOrigin[0] || g_vOrigin[id][1] != vOrigin[1]){
g_vOrigin[id][0] = vOrigin[0]
g_vOrigin[id][1] = vOrigin[1]
g_vOrigin[id][2] = vOrigin[2]
g_iAFKTime[id] = 0
g_iWarn[id] = 0
}
else{
g_iAFKTime[id]++
}
}

// Letzte Aktivitдt ermitteln
else{
new Float:fLastActivity
fLastActivity = cs_get_user_lastactivity(id)

if (fLastActivity != g_fLastActivity[id]){
g_fLastActivity[id] = fLastActivity
g_iAFKTime[id] = 0
g_iWarn[id] = 0
}
else{
g_iAFKTime[id] = floatround((get_gametime() - fLastActivity) / FREQ_AFK_CHECK)
}
}

// Bombentransfer
if (g_iDropBomb && g_iAFKTime[id] >= 3){
if (g_iDropBomb == 1){
if (pev(id, pev_weapons) & (1 << CSW_C4)) engclient_cmd(id, "drop", "weapon_c4")
}
else{
func_transfer_bomb(id)
}
}

// Spec-Switch
if (g_iAFKTime[id] >= g_iTransferTime - MAX_WARN){
func_transfer_player(id)
}
}
}
}
}

public func_transfer_bomb(id){

// Abbrechen wenn der Spieler keine Bombe hat
if (!(pev(id, pev_weapons) & (1 << CSW_C4))) return

// Ermittle alle lebenden Terroristen
new iPlayers[32], pNum
get_players(iPlayers, pNum, "ae", "TERRORIST")

// Abbrechen falls weniger als 2 Terroristen leben
if (pNum < 2) return

// Finde den nдchsten Terroristen der nicht AFK ist
new vCarrier[3], vRecipient[3], iRecipient, iDistance, iMinDistance = 999999
get_user_origin(id, vCarrier)
for (new p = 0; p < pNum; p++){
if (g_iAFKTime[iPlayers[p]] < 2){
get_user_origin(iPlayers[p], vRecipient)
iDistance = get_distance(vCarrier, vRecipient)
if (iDistance < iMinDistance){
iMinDistance = iDistance
iRecipient = iPlayers[p]
}
}
}

// Abbrechen wenn alle Terroristen AFK sind
if (!iRecipient) return

// Bombe transferieren
engclient_cmd(id, "drop", "weapon_c4")
new iC4 = engfunc(EngFunc_FindEntityByString, -1, "classname", "weapon_c4")
if (pev_valid(iC4)){
new iBackpack = pev(iC4, pev_owner)
if (iBackpack > g_iMaxPlayers){
set_pev(iBackpack, pev_flags, pev(iBackpack, pev_flags) | FL_ONGROUND)
dllfunc(DLLFunc_Touch, iBackpack, iRecipient)
}
}

// Nachrichten anzeigen
new szRecipient[32], szMsg[128]
get_user_name(iRecipient, szRecipient, 31)
set_hudmessage(255, 255, 0, -1.0, 0.8, 0, 3.0, 6.0, 0.1, 0.2, -1)
for (new p = 0; p < pNum; p++){
if (iPlayers[p] != iRecipient){
format(szMsg, 127, "%L", iPlayers[p], "AFK_TRANSFER_BOMB", szRecipient)
show_hudmessage(iPlayers[p], "%s", szMsg)
}
}
format(szMsg, 127, "%L", iRecipient, "AFK_GOT_BOMB")
show_hudmessage(iRecipient, szMsg)
}

public func_transfer_player(id){

// Warnung anzeigen, wenn nicht schon max-mal verwarnt
if (g_iWarn[id] < MAX_WARN){
client_print_color(id, print_chat, "[AMXX] %L", LANG_PLAYER, "AFK_TRANSFER_WARN", floatround(FREQ_AFK_CHECK) * (MAX_WARN - g_iWarn[id]))
g_iWarn[id]++
return
}

// Eigentlich sollte die Bombe schon transferiert worden sein
if (pev(id, pev_weapons) & (1 << CSW_C4)){
engclient_cmd(id, "drop", "weapon_c4")
}

// Spieler tranferieren
if (is_user_alive(id)) user_silentkill(id)

// Allow players to choose a team more than one time per round (Thanks ConnorMcLeod)
// I use this method caused of some issue with deathmatch (Player will be respawned as T or CT)
set_pdata_int(id, m_iJoiningState, get_pdata_int(id, m_iJoiningState, OFFSET_LINUX) & ~(1<<8), OFFSET_LINUX)
engclient_cmd(id, "jointeam", "6")
set_pdata_int(id, m_iJoiningState, get_pdata_int(id, m_iJoiningState, OFFSET_LINUX) & ~(1<<8), OFFSET_LINUX)
//cs_set_user_team(id, CS_TEAM_SPECTATOR)
//cs_reset_user_model(id)

// Positionen zurьcksetzen
g_vOrigin[id] = {0, 0, 0}

// Counter zurьcksetzen
g_iAFKTime[id] = 0
g_iWarn[id] = 0

// Nachrichten anzeigen
new szName[32]
get_user_name(id, szName, 31)
client_print_color(0, print_chat, "[AMXX] %L", LANG_PLAYER, "AFK_TRANSFER_PLAYER", szName)
log_amx("Player ^"%s^" was transferred to the spectators for being AFK.", szName)
}

public func_kick_player(id){

// Abbrechen wenn es sich um einen Admin handelt
if (get_user_flags(id) & KICK_IMMUNITY || g_bSpecAccess[id]) return

// Anzahl der aktuellen Spieler ermitteln
new iCurrentPlayers = get_playersnum(1)

// Sind noch Plдtze frei?
if (iCurrentPlayers < g_iMinPlayers || !g_iMinPlayers) return

// Warnung anzeigen, wenn nicht schon max-mal verwarnt
if (g_iWarn[id] < MAX_WARN){
client_print_color(id, print_chat, "[AMXX] %L", LANG_PLAYER, "AFK_KICK_WARN", floatround(FREQ_AFK_CHECK) * (MAX_WARN - g_iWarn[id]))
g_iWarn[id]++
return
}

// Spieler kicken
new szMsg[192]
format(szMsg, 191, "%L", id, "AFK_KICK_REASON")
server_cmd("kick #%d ^"%s^"", get_user_userid(id), szMsg)

// Nachrichten anzeigen
new szName[32]
get_user_name(id, szName, 31)
client_print_color(0, print_chat, "[AMXX] %L", LANG_PLAYER, "AFK_KICK_PLAYER", szName)
log_amx("Player ^"%s^" was kicked for being AFK.", szName)
}
Всем привет! Хочу сделать цветной вывод в чат. Переделал плагин, но как сделать так, чтобы слово AFK было красным не зависимо от команды?
 
В этой теме было размещено решение! Перейти к решению.
Сообщения
264
Реакции
132
Помог
13 раз(а)
ZizionarD, немного не в том разделе тему создал. А так то полезно заглядывать в описание функций там и примеры есть :

Код:
Usage examples:
client_print_color(id, print_team_red, "^4Green ^3Red ^1Default")
 
Статус
В этой теме нельзя размещать новые ответы.

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу