AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   add a model and a team (https://forums.alliedmods.net/showthread.php?t=326979)

Joker2020 08-26-2020 14:45

add a model and a team
 
good day to all) can I please add to this plugin the output of the model and that the plugin would work on the command /hed
Code:

#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>

const m_LastHitGroup = 75;

public plugin_init()
{
    RegisterHam( Ham_TakeDamage , "player" , "HamTakeDamage" );
}

public HamTakeDamage( victim , inflictor , attacker , Float:fDamage , bitDamage )
{   
    return ( get_pdata_int( victim , m_LastHitGroup ) == HIT_HEAD ) ? HAM_IGNORED : HAM_SUPERCEDE;
}


Shadows Adi 08-26-2020 15:33

Re: add a model and a team
 
Yes you can add them, just try it out and post here your code after you've done it.

Joker2020 08-26-2020 15:49

Re: add a model and a team
 
Quote:

Originally Posted by Shadows Adi (Post 2715622)
Yes you can add them, just try it out and post here your code after you've done it.

I don't have any special knowledge
Code:

#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>

#define BONUS_ROUNDS 1 //valid for 1 round

const m_LastHitGroup = 75;

new g_NextRoundHed[33]

public plugin_init()
{
    RegisterHam( Ham_TakeDamage , "player" , "HamTakeDamage" );
    register_clcmd("say /hed", "hed_command");
    register_clcmd("say_team /hed", "hed_command");
    RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawn");
    register_forward(FM_SetModel, "FM_SetModel_Hook", 1);
}

public plugin_precache() {
    precache_model("models/deadpools.mdl")
}

public hed_command(iPlayer) {
                g_NextRoundHed[iPlayer] = BONUS_ROUNDS
}

public fwHamPlayerSpawn( const player ) {
        if( !pev_valid( iEnt ) ) {
            engfunc( EngFunc_SetModel, iEnt, "models/deadpools.mdl" )
        }
}

public FM_SetModel_Hook(iEnt, szModel[])
{
        if (pev_valid(iEnt) && equal(szModel, "models/deadpools.mdl"))
}

public HamTakeDamage( victim , inflictor , attacker , Float:fDamage , bitDamage )
{   
    return ( get_pdata_int( victim , m_LastHitGroup ) == HIT_HEAD ) ? HAM_IGNORED : HAM_SUPERCEDE;
}



All times are GMT -4. The time now is 13:52.

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