buyrun deneyin bir.
Kod: Tümünü seç
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta>
#define TIME 30.0
#define KICKTIME 10
new Float:player_origin[33][3];
public plugin_init()
{
RegisterHam(Ham_Spawn, "player", "e_Spawn", 1);
}
public e_Spawn(id)
{
remove_task(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);
set_task(TIME, "check_afkkick", 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);
renkliyazi(id, "!t[Mekansizlar Gaming]: !gAFK Oldugun Icin Otomatik Slaylandin.", name) // fixed error here too
}
}
}
public check_afkkick(id)
{
if(is_user_alive(id))
{
if(same_origin(id))
{
new name[33];
get_user_name(id, name, 32);
server_cmd("kick %d ^"10 DAKIKA AFK KALDIGINIZ ICIN KICKLENDINIZ.^"",name)
renkliyazi(0, "!t[Mekansizlar Gaming]: !g %s AFK Oldugu Icin Kicklendi..!", name) // fixed error here too
}
}
}
public same_origin(id)
{
new Float:origin[3];
pev(id, pev_origin, origin);
for(new i = 0; i < 3; i++)
if(origin[i] != player_origin[id][i])
return 0;
return 1;
}
stock renkliyazi(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, "!y", "^1")
replace_all(msg, 190, "!t", "^3")
replace_all(msg, 190, "!c", "^0")
if (id) players[0] = id; else get_players(players, count, "ch")
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}