•  
     

Plug AFK Para servidor de CS

edite a SMA para seu gosto !

//Created by, Garrett Expect more updates..
//This plugin version is still in being fixed
//Credits:MONTILAAAXD

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <engine>

new oldangles[33][3]
new afktimee[33]
new bool:spawned[33] = {true, ...}
new sprLight
new sprSmoke
new szsndthunder[] = "ambience/thunder_clap.wav"

public plugin_init()
{
register_plugin("AFK","0.06","Garrett")
register_cvar("amx_afk","1",FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY)
register_cvar("mp_afktime", "60", FCVAR_SERVER) //this isn't really in use other than that this tells everybody how long before someone is killed
register_clcmd("say afk", "sayafk", 0, "- Says theres a afk")
set_task(60.0,"isplayer",_,_,_,"b") //change 60.0 if u want to increase or decrease how long u want it to wait before killing a person
}

public sayafk(id)
{
if (get_cvar_float("amx_afk") && !is_user_alive(id))
client_print(0,print_center,"AFK!!! Go Get Him")
return PLUGIN_HANDLED
}

public plugin_precache()
{
sprLight = precache_model( "sprites/lgtning.spr" )
sprSmoke = precache_model( "sprites/steam1.spr" )

precache_sound ( szsndthunder )

return PLUGIN_CONTINUE
}

public isplayer() {
for (new a = 1; a <=get_maxplayers(); a++)
if (is_user_alive(a) && is_user_connected(a) && !is_user_hltv(a) && spawned[a]) {
new newangle[3]
get_user_origin(a, newangle)

if ( newangle[0] == oldangles[a][0] && newangle[1] == oldangles[a][1] && newangle[2] == oldangles[a][2] ) {
whats_afktime(a)
} else {
oldangles[a][0] = newangle[0]
oldangles[a][1] = newangle[1]
oldangles[a][2] = newangle[2]
afktimee[a] = 0
}
}
}

whats_afktime(id) {
new maxafktime = get_cvar_num("mp_afktime")
if (afktimee[id] < maxafktime) {
new vec1[3], vec2[3]
get_user_origin( id, vec1 )
vec1[2] -= 26

vec2[0] = vec1[0] + 150
vec2[1] = vec1[1] + 150
vec2[2] = vec1[2] + 400

emit_sound( id, CHAN_ITEM, szsndthunder, 1.0, ATTN_NORM, 0, PITCH_NORM )

message_begin( MSG_BROADCAST, SVC_TEMPENTITY )
write_byte( 0 )
write_coord( vec2[0] )
write_coord( vec2[1] )
write_coord( vec2[2] )
write_coord( vec1[0] )
write_coord( vec1[1] )
write_coord( vec1[2] )
write_short( sprLight )
write_byte( 1 ) // framestart
write_byte( 5 ) // framerate
write_byte( 10 ) // life
write_byte( 175 ) // width
write_byte( 30 ) // noise
write_byte( 200 ) // r, g, b
write_byte( 200 ) // r, g, b
write_byte( 200 ) // r, g, b
write_byte( 500 ) // brightness
write_byte( 175 ) // speed
message_end()

message_begin( MSG_PVS, SVC_TEMPENTITY, vec1 )
write_byte( 9 )
write_coord( vec1[0] )
write_coord( vec1[1] )
write_coord( vec1[2] )
message_end()

message_begin( MSG_BROADCAST, SVC_TEMPENTITY, vec1 )
write_byte( 5 )
write_coord( vec1[0] )
write_coord( vec1[1] )
write_coord( vec1[2] )
write_short( sprSmoke )
write_byte( 10 )
write_byte( 10 )
message_end()
user_kill(id, 0)
new name[32]
get_user_name(id, name, 31)
client_print(0, print_chat, "[AFK] %s was slayed by the BOLT OF DEATH for being AFK longer %i seconds", name, maxafktime)
}
}
Não tem Permissão para ver os ficheiros anexados nesta mensagem.