Raised This Month: $ Target: $400
 0% 

headshot drop bonus [Zombie Panic Source]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 03-06-2023 , 12:24   Re: headshot drop bonus [Zombie Panic Source]
Reply With Quote #4

Try this
PHP Code:

#include <sdktools>
#include <sdkhooks>

#define ZPS_TEAM_NONE            0    // player running on map but haven't choose team
#define ZPS_TEAM_SPECTATOR    1    // observer
#define ZPS_TEAM_HUMAN        2    // human
#define ZPS_TEAM_ZOMBIE        3    // zombie


char items[][] = {
    
//"item_ammo_barricade",
    //"item_ammo_barricade_clip",
    //"item_ammo_barricadepile",
    //"item_ammo_flare",
    
"item_ammo_pistol",
    
"item_ammo_pistol_clip",
    
"item_ammo_revolver",
    
"item_ammo_revolver_clip",
    
"item_ammo_rifle",
    
"item_ammo_rifle_clip",
    
"item_ammo_shotgun",
    
"item_ammo_shotgun_clip",
    
"item_armor",
    
//"item_deliver",
    
"item_healthkit",
    
"item_pills"
}

public 
void OnPluginStart()
{
    
HookEvent("player_feed"player_feed)
}

public 
void player_feed(Event event, const char[] namebool dontBroadcast)
{
    if(!
event.GetBool("death") || !event.GetBool("headshot"))
        return;

    
int client GetClientOfUserId(event.GetInt("userid"));

    if(
GetClientTeam(client) == ZPS_TEAM_ZOMBIE// && ZPS_IsCarrier(client))
    
{
        
float pos[3];
        
GetClientEyePosition(clientpos);
        
        
DataPack pack = new DataPack();
        
pack.WriteFloatArray(possizeof(pos));
        
        
RequestFrame(delaypack);
    }
}

public 
void delay(DataPack data)
{
    
data.Reset();

    
float pos[3];
    
data.ReadFloatArray(possizeof(pos));

    
delete data;

    
int item CreateEntityByName(items[GetRandomInt(0sizeof(items)-1)]);
        
    if(
item != -1)
    {
        
TeleportEntity(itemposNULL_VECTORNULL_VECTOR);
        
DispatchSpawn(item);
    }
}

stock bool ZPS_IsCarrier(int client)
{
    if(
HasEntProp(clientProp_Send"m_bIsCarrier") &&
        
GetEntProp(clientProp_Send"m_bIsCarrier"))
    {
        return 
true;
    }

    return 
false;

__________________
Do not Private Message @me
Bacardi is offline
 



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 05:02.


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