Raised This Month: $ Target: $400
 0% 

Some help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
raizo11
BANNED
Join Date: Dec 2013
Location: https://t.me/pump_upp
Old 01-16-2016 , 17:43   Re: Some help
Reply With Quote #9

Code:
#include <amxmodx>
#include <hamsandwich>
#include <dhudmessage>
#include <fun>

new bool:g_bAttack[33] = {true, ...}

public plugin_init() 
{
    register_plugin("x", "1.0", "-")

    register_cvar("god_on", "1")
    register_cvar("amx_reset", "1.0")
    
    RegisterHam(Ham_TakeDamage, "player", "onTakeDamagePre", false)
    RegisterHam(Ham_TraceAttack, "player", "onTraceAttack")
    RegisterHam(Ham_Killed, "player", "fw_PlayerKilled", 1)
}

public onTakeDamagePre(victim, inflictor, attacker, Float:dmg, dmgbits)
{
    if(!is_user_alive(attacker) || get_user_team(attacker) == get_user_team(victim))
        return HAM_IGNORED
    
    return g_bAttack[attacker] ? HAM_IGNORED : HAM_SUPERCEDE
}

public onTraceAttack(ent, attacker, Float:damage, Float:direction[3], trace, dmgbits)
    return !g_bAttack[attacker] ? HAM_SUPERCEDE : HAM_IGNORED


public fw_PlayerKilled(iVictim, iKiller)  
{
    if (iVictim == iKiller || !is_user_alive(iKiller) || !get_cvar_num("god_on") )
        return
    if(get_user_team(iKiller) == 1)
    set_user_rendering(iKiller, kRenderFxGlowShell, 255, 0, 0, kRenderNormal)
    if(get_user_team(iKiller) == 2)
    set_user_rendering(iKiller, kRenderFxGlowShell, 0, 0, 255, kRenderNormal)
    set_user_godmode(iKiller, 1)
    g_bAttack[iKiller] = false
    new Float:GodKill = get_cvar_float("amx_reset")
    set_task(GodKill, "Reset", iKiller)
    set_dhudmessage(110, 55, 110, -1.0, 0.70, 1, 0.1, 3.0, 0.1, 2.0, false)
    show_dhudmessage(iKiller, "God Mode Is Enabled After Kill A Enemy")
    show_dhudmessage(iVictim, "Gang-Bang Protection Enabled")
}

public Reset(id)
{
    if(is_user_alive(id))
    {
        set_user_godmode(id, 0)
        set_user_rendering(id) 
        g_bAttack[id] = true
    }
}

Last edited by raizo11; 01-18-2016 at 06:21.
raizo11 is offline
Send a message via ICQ to raizo11 Send a message via AIM to raizo11 Send a message via MSN to raizo11 Send a message via Yahoo to raizo11 Send a message via Skype™ to raizo11
 



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 09:28.


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