View Single Post
eaz
Member
Join Date: Jan 2017
Old 02-26-2018 , 15:11   Re: [CS:GO] Release: Zombie Plague 7.8fix2
Reply With Quote #360

Quote:
Originally Posted by Mikado View Post

And one last thing, please can you help me to make zombie madness as an extra item & extra item buy survivor/nemesis round ?

Thank you .
this one is for old version but you can try it

PHP Code:
#include <sourcemod> 
#include <sdktools>
#include <sdkhooks> 
#include <zombieplague>

#define EXTRA_ITEM_NAME                "Zombie Madness" // If string has @, phrase will be taken from translation file. For example: "@AK47" require translation block, "AK47" not require      
#define EXTRA_ITEM_COST                22       // Ammopacks cost     
#define EXTRA_ITEM_LEVEL                    0        // The level of the player, which allow to buy item. ['0' = off] 
#define EXTRA_ITEM_ONLINE            0       // The number of players, which allowed to buy item. ['0' = off]  
#define EXTRA_ITEM_LIMIT                    0       // The number of purchases, which allowed per round for player. ['0' = off] 

int iItem;

bool gMadnessUsed[MAXPLAYERS+1];

ConVar gMadnessTime;



public 
OnPluginStart() 
{
iItem ZP_RegisterExtraItem(EXTRA_ITEM_NAMEEXTRA_ITEM_COSTZP_TEAM_ZOMBIEEXTRA_ITEM_LEVELEXTRA_ITEM_ONLINEEXTRA_ITEM_LIMIT);
gMadnessTime         CreateConVar("zp_madness_time",          "2.0",     "Time of having madness.");
AutoExecConfig(true"zombieplague_madness");
}

public 
void OnMapStart(/*void*/)
{
    
// Sounds
    
FakePrecacheSound("zbm3/extra_item_zombie_madness.mp3");
}

public 
void ZP_OnClientInfected(int clientIndexint infectorIndex)
{
    
gMadnessUsed[clientIndex] = false
}

public 
void ZP_OnClientHeroed(int clientIndex)
{
    
gMadnessUsed[clientIndex] = false
}

public 
Action ZP_OnExtraBuyCommand(int clientIndexint extraitemIndex

    
// Verify that the client is connected and alive 
    
if(!IsPlayerExist(clientIndex)) 
    { 
        return 
Plugin_Handled
    }  
    if(
extraitemIndex == iItem
    {    
        
gMadnessUsed[clientIndex] = true;
        
SetEntityRenderMode(clientIndexRENDER_TRANSCOLOR);  
        
SetEntityRenderColor(clientIndex2360140255);
        
EmitSoundToAll("*/zbm3/extra_item_zombie_madness.mp3"clientIndexSNDCHAN_VOICESNDLEVEL_SCREAMING);
        
CreateTimer(GetConVarFloat(gMadnessTime), EventRemoveMadnessclientIndexTIMER_FLAG_NO_MAPCHANGE);
    } 
     
    
// Allow buying 
    
return Plugin_Continue
}

public 
Action EventRemoveMadness(Handle hTimerany clientIndex)
{
    
// Verify that the client is exist
    
if(!IsPlayerExist(clientIndex))
    {
        return 
Plugin_Stop;
    }

    
// If player have it, reset ammo
    
if(gMadnessUsed[clientIndex])
    {
        
gMadnessUsed[clientIndex] = false;
        
SetEntityRenderMode(clientIndexRENDER_TRANSCOLOR);  
        
SetEntityRenderColor(clientIndex255255255255);
    }

    
// Destroy timer
    
return Plugin_Stop;
}

public 
Action DamageTraceAttack(int iVictimint &iAttackerint &Inflictorfloat &damageint &pDamageBitsint &iAmmoTypeint iHitBoxint iHitGroup)
{
    
// If player used tank skill
    
if (ZP_IsPlayerZombie(iVictim) && gMadnessUsed[iVictim])
    {
        return 
Plugin_Handled;
    }

    
// Allow trace
    
return Plugin_Continue;
}

public 
void OnClientPostAdminCheck(int clientIndex)
{
    
SDKHook(clientIndexSDKHook_TraceAttackDamageTraceAttack);

eaz is offline