Raised This Month: $51 Target: $400
 12% 

[Request] Last Counter-Terrorist Alive get a knife with a lot of damage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Yeoo
Junior Member
Join Date: Nov 2020
Old 03-27-2024 , 18:21   [Request] Last Counter-Terrorist Alive get a knife with a lot of damage
Reply With Quote #1

Hi, could someone make me a plugin that check the last CT alive and gives him a knife with a lot of damage and a custom skin.
Also this should work only if there are at least 4 players online.
Yeoo is offline
Yeoo
Junior Member
Join Date: Nov 2020
Old 04-04-2024 , 15:51   Re: [Request] Last Counter-Terrorist Alive get a knife with a lot of damage
Reply With Quote #2

Up
Yeoo is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 04-04-2024 , 19:45   Re: [Request] Last Counter-Terrorist Alive get a knife with a lot of damage
Reply With Quote #3

PHP Code:
#include <amxmodx>
#include <cstrike_const>
#include <fakemeta>
#include <hamsandwich>

const m_pPlayer 41
const XO_CBASEPLAYERITEM 4
const MIN_PLAYERS 4
const Float:DAMAGE_MULTIPLIER 4.0

new arr_players[MAX_PLAYERS], last_ctnum_ct
new const knife_model[] = "models/v_knife_r.mdl"

public plugin_init()
{
    
register_event("DeathMsg""player_killed""a""1>0")
    
RegisterHam(Ham_Item_Deploy"weapon_knife""weapon_knife"1)
    
RegisterHam(Ham_TakeDamage"player""knife_damage")
    
register_logevent("reset_last_ct"2"1=Round_Start")  
    
register_logevent("reset_last_ct"2"1=Round_End")
    
register_event("TextMsg""reset_last_ct""a""2=#Game_Commencing""2=#Game_will_restart_in")
}

public 
plugin_precache()
    
precache_model(knife_model)

public 
client_authorized()
    
check()
public 
client_disconnected()
    
check()
public 
player_killed()
    
check()
public 
reset_last_ct()
    
last_ct 0

public check()
{
    
get_players(arr_playersnum_ct"ae""CT")
    
last_ct = (num_ct == arr_players[0] : 0)

    if (
last_ct)
    {
        if (
get_user_weapon(last_ct) == CSW_KNIFE)
            
client_cmd(last_ct"lastinv;lastinv")
    }
}

public 
weapon_knife(entity)
{
    if (
get_playersnum() >= MIN_PLAYERS)
    {
        new 
id get_pdata_cbase(entitym_pPlayerXO_CBASEPLAYERITEM)
        if (
id == last_ct)
            
set_pev(idpev_viewmodel2knife_model)
    }
}

public 
knife_damage(victimiidFloat:dmg)
{
    if (
get_playersnum() >= MIN_PLAYERS)
    {
        if (
is_user_connected(id))
        {
            if(
id == last_ct && get_user_weapon(id) == CSW_KNIFE)
                
SetHamParamFloat(4dmg DAMAGE_MULTIPLIER)
        }
    }

__________________
bigdaddy424 is offline
Reply



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 15:54.


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