Raised This Month: $51 Target: $400
 12% 

AFK Manager


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Asran
Member
Join Date: Aug 2007
Location: France
Old 08-10-2008 , 10:08   AFK Manager
Reply With Quote #1

Hi,

I just wanted to know if you could post your AFK Manager version plz, I don't want to use the original version made by VEN which requires a free admin slot because I thnik this is a waste... I know that yours doest not need it. thank you.

Cheers!
__________________
Asran is offline
bmann_420
AMX_Super Pooper
Join Date: Jan 2005
Location: [SuperCentral.co]
Old 08-10-2008 , 14:16   Re: AFK Manager
Reply With Quote #2

Its in teh 4.0 beta.
__________________
bmann_420 is offline
Asran
Member
Join Date: Aug 2007
Location: France
Old 08-10-2008 , 15:16   Re: AFK Manager
Reply With Quote #3

I don't know how to write a plugin
__________________
Asran is offline
Asran
Member
Join Date: Aug 2007
Location: France
Old 08-10-2008 , 15:40   Re: AFK Manager
Reply With Quote #4

I don't know how to write a plugin

Quote:
//AFK Manager
register_event("TeamInfo", "event_spectate", "a", "2=UNASSIGNED", "2=SPECTATOR")
register_event("TeamInfo", "event_playteam", "a", "2=TERRORIST", "2=CT")
set_task(float(AFK_CHECK_INTERVAL), "task_afk_check2", _, _, _, "b")
and:

Quote:
//----------------------------------------------------------------------------------------------------------
//AFK Manager by VEN
//----------------------------------------------------------------------------------------------------------
g_connected[id] = true

if (get_playersnum(1) <= g_maxplayers - get_pcvar_num(amx_reservation) || get_pcvar_num(afkcheck_allow) || (!(is_user_bot(id))))
return PLUGIN_CONTINUE

static players[32], num, i, tchar[2]
new candidate, candidatetime
get_players(players, num, "b")
for (new x; x < num; ++x) {
i = players[x]

if (get_user_flags(i)&get_immune_access_flag())
continue

get_user_team(i, tchar, 1)
if (((tchar[0] == 'U' && get_user_time(i, 1) > get_pcvar_num(immune_time)) || tchar[0] == 'S') && (!candidatetime || g_specgametime[i] < candidatetime)) {
candidatetime = g_specgametime[i]
candidate = i
}
}

if (candidate) {
chat_msg(candidate, g_spec_kick_chat)
client_kick(candidate)
return PLUGIN_CONTINUE
}

static origin[3], afktime
get_players(players, num, "a")
for (new x; x < num; ++x) {
i = players[x]
get_user_origin(i, origin)
if (!is_user_afk(i, origin)) {
g_afktime[i] = 0
g_origin[i] = origin
continue
}

afktime = g_afktime[i]
if (afktime >= get_pcvar_num(max_afktime) && afktime > candidatetime) {
candidatetime = afktime
candidate = i
}
}

if (candidate) {
chat_msg(candidate, g_afk_kick_chat)
client_kick(candidate)
}

return PLUGIN_CONTINUE
}
public task_afk_check2() {

if(!get_pcvar_num(afkcheck_allow))
return

static players[32], num, i, bool:allafk, origin[3]
for (new a; a < 2; ++a) {
get_players(players, num, "ae", g_teamname[a])
allafk = true
for (new x; x < num; ++x) {
i = players[x]
get_user_origin(i, origin)
if (is_user_afk(i, origin)) {
g_afktime[i] += AFK_CHECK_INTERVAL
if (g_afktime[i] < get_pcvar_num(max_afktime))
allafk = false
}
else {
g_afktime[i] = 0
g_origin[i] = origin
allafk = false
}
}

if (!allafk)
continue

for (new x; x < num; ++x) {
i = players[x]
chat_msg(i, g_afktospec_chat)
user_to_spec(i)
}
}
}

public event_spectate() {
new id = read_data(1)
if (g_connected[id] && !g_specgametime[id])
g_specgametime[id] = floatround(get_gametime())
}

public event_playteam() {
new id = read_data(1)
if (g_connected[id])
clear_vars(id)
}

clear_vars(id) {
g_origin[id][0] = 0
g_origin[id][1] = 0
g_origin[id][2] = 0
g_afktime[id] = 0
g_specgametime[id] = 0
}

bool:is_user_afk(id, const origin[3]) {
return (origin[0] == g_origin[id][0] && origin[1] == g_origin[id][1])
}

chat_msg(id, const text[]) {
static name[32]
get_user_name(id, name, 31)
client_print(0, print_chat, "%L", LANG_PLAYER, text, name)
}

stock client_kick(id, const reason[] = "") {
server_cmd("kick #%d ^"%L^"", get_user_userid(id), reason)
server_exec()
}

stock user_to_spec(id) {
user_kill(id, 1)
engclient_cmd(id, "jointeam", "6")
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Player Spawn Event
//============================================= ============================================= ================
public event_fm_DispatchSpawned(id) {

if(HasPermGod[id])
fm_set_user_godmode(id,1)

if(HasPermNoclip[id])
fm_set_user_noclip(id,1)

if ( get_pcvar_num(deadchat)==1 ) {
if (is_user_connected(id) && fm_get_speak(id) != SPEAK_MUTED )
fm_set_speak(id, SPEAK_NORMAL)
}
return PLUGIN_CONTINUE
}
__________________
Asran is offline
bmann_420
AMX_Super Pooper
Join Date: Jan 2005
Location: [SuperCentral.co]
Old 08-10-2008 , 15:55   Re: AFK Manager
Reply With Quote #5

I dont know what your asking?

I thought you wanted the super with the afk
__________________
bmann_420 is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 08-10-2008 , 16:17   Re: AFK Manager
Reply With Quote #6

Happy not being you in this thread, bmann.
__________________
Brad is offline
bmann_420
AMX_Super Pooper
Join Date: Jan 2005
Location: [SuperCentral.co]
Old 08-10-2008 , 16:18   Re: AFK Manager
Reply With Quote #7

lol, why ty very much their brad
__________________
bmann_420 is offline
Asran
Member
Join Date: Aug 2007
Location: France
Old 08-10-2008 , 16:36   Re: AFK Manager
Reply With Quote #8

I just need the afk manager plugin you revised and not the entire amx_super ...
__________________
Asran is offline
bmann_420
AMX_Super Pooper
Join Date: Jan 2005
Location: [SuperCentral.co]
Old 08-10-2008 , 17:01   Re: AFK Manager
Reply With Quote #9

I dont have it
__________________
bmann_420 is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 08-11-2008 , 08:53   Re: AFK Manager
Reply With Quote #10

Asran, I've written another AFK management type plugin. It's called, Bad Camper. Might be something you'd like.
__________________
Brad is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:19.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode