Kod:
#include <amxmodx>
#include <fakemeta_util>
#include <engine>
#include <reapi>
#define PLUGIN "GezinmeMod"
#define VERSION "3.0"
#define AUTHOR "By.KinG"
native jb_get_user_packs(id);
native jb_set_user_packs(id, Ammount);
new const TAG[] = "Holigan";
new const KISATAG[] = "HG";
new bool:GezinmeMod[MAX_CLIENTS + 1];
new bool:RocketAtiliyor;
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_logevent("Event_RoundStart", 2, "1=Round_Start");
register_touch("weaponbox", "player", "Touch");
register_touch("armoury_entity", "player", "Touch");
register_touch("weapon_shield", "player", "Touch");
register_message(get_user_msgid("ScoreAttrib"), "MessageScoreAttrib");
RegisterHookChain(RG_CBasePlayer_TakeDamage, "CBasePlayer_TakeDamage", 0);
RegisterHookChain(RG_CBasePlayer_Killed, "CBasePlayer_Killed", .post=true);
}
public client_connect(id)
{
GezinmeMod[id] = false;
}
public client_disconnected(id)
{
GezinmeMod[id] = false;
}
public MessageScoreAttrib()
{
new Player = get_msg_arg_int(1);
if(GezinmeMod[Player])
{
set_msg_arg_int(2, ARG_BYTE, (1<<0));
}
}
public CBasePlayer_Killed(Victim)
{
new Players[MAX_CLIENTS], NumAll, Num;
get_players(Players, NumAll, "ae", "TERRORIST");
for(new i; i < NumAll; i++)
{
if(GezinmeMod[i])
{
Num++;
}
}
new NumAllNew = NumAll - Num;
if(NumAllNew <= 1)
{
LRAtiliyor();
}
else if(get_member(Victim, m_iTeam) == TEAM_TERRORIST)
{
GezinmeMenu(Victim);
}
}
public GezinmeMenu(id)
{
if(RocketAtiliyor)
{
return;
}
static Item[128]
formatex(Item, charsmax(Item),"\d[\r%s\d] \w| \yGezinme Mod Menu", TAG)
new Menu = menu_create(Item, "GezinmeMenu_Devam")
formatex(Item, charsmax(Item),"\d[\r%s\d] \w| \yGezinme Modunu Ac", KISATAG)
menu_additem(Menu, Item, "1")
formatex(Item, charsmax(Item),"\d[\r%s\d] \w| \yIzleyici Olarak Kal", KISATAG)
menu_additem(Menu, Item, "2")
menu_setprop(Menu,MPROP_EXITNAME,"\wCikis")
menu_display(id, Menu,0)
}
public GezinmeMenu_Devam(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu);
return PLUGIN_HANDLED;
}
new data[6], iName[64];
new access, callback;
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);
new key = str_to_num(data);
switch(key)
{
case 1 :
{
GezinmeMod[id] = true;
rg_round_respawn(id);
rg_remove_all_items(id);
rg_set_user_footsteps(id, true);
set_entity_visibility(id, 0);
set_entvar(id, var_takedamage, DAMAGE_NO);
set_task(1.0, "SilahSil", id);
jb_set_user_packs(id, jb_get_user_packs(id) + 3);
client_print(id, print_center, "[ - Gezinme Moduna Gectigin Icin 3 TL Kazandin - ]", TAG);
}
case 2 :
{
GezinmeMod[id] = false;
}
}
return PLUGIN_HANDLED
}
public Event_RoundStart(id)
{
new Players[MAX_CLIENTS], NumAll;
get_players(Players, NumAll);
for(new i; i < NumAll; i++)
{
id = Players[i];
if(GezinmeMod[id] == true)
{
GezinmeMod[id] = false;
rg_round_respawn(id);
rg_set_user_footsteps(id);
rg_give_item(id, "weapon_knife");
set_entity_visibility(id, 1);
set_entvar(id, var_takedamage, DAMAGE_AIM);
set_task(1.0, "SilahSil");
}
}
RocketAtiliyor = false;
set_task(1.0, "RoketKontrol");
}
public RoketKontrol(id)
{
new Players[MAX_CLIENTS], NumAll;
get_players(Players, NumAll);
for(new i; i < NumAll; i++)
{
id = Players[i];
if(GezinmeMod[id])
{
if(fm_get_user_gravity(id) == -0.50)
{
user_kill(id);
RocketAtiliyor = true;
}
}
}
set_task(1.0, "RoketKontrol");
}
public LRAtiliyor()
{
static id;
new Players[MAX_CLIENTS], NumAll;
get_players(Players, NumAll);
for(new i; i < NumAll; i++)
{
id = Players[i];
if(GezinmeMod[id] == true)
{
GezinmeMod[id] = false;
user_kill(id);
}
}
}
public SilahSil(id)
{
rg_remove_all_items(id);
}
public client_PreThink(id)
{
if(!is_user_connected(id))
{
return PLUGIN_CONTINUE;
}
if(GezinmeMod[id] == false)
{
return PLUGIN_CONTINUE;
}
static Buton, Buton_0;
Buton = get_entvar(id, var_button);
Buton_0 = get_entvar(id, var_oldbuttons);
if(Buton & IN_USE)
{
set_entvar(id, var_movetype, MOVETYPE_NOCLIP);
}
else if(Buton_0 & IN_USE)
{
set_entvar(id, var_movetype, MOVETYPE_WALK);
}
return PLUGIN_CONTINUE;
}
public Touch(ent, id)
{
return GezinmeMod[id] ? PLUGIN_HANDLED : PLUGIN_CONTINUE;
}
public CBasePlayer_TakeDamage(Victim, Inflictor, Attacker, Float:Damage, Damage_Bits)
{
if(is_user_connected(Attacker) && is_user_connected(Victim) && Victim != Attacker)
{
if(GezinmeMod[Attacker])
{
SetHookChainArg(4, ATYPE_FLOAT, Damage * 0.0);
}
}
return PLUGIN_CONTINUE;
}