Dinero extra cuando matas al nemesis
#1
Últimamente estoy haciendo cosillas por el csgo y me apetece aportarlas por aquí por si alguien lo necesita.

Solo sirve para este mod: https://forums.alliedmods.net/showthread.php?t=290657

Código PHP:
#include <sourcemod> 
#include <sdkhooks> 
#include <multicolors>
#include <zombieplague> 

#pragma semicolon 1 
#pragma newdecls required 

#define Prefix "ZP"

int premio 200;
int g_modo;

bool nemesis;

public 
Plugin myinfo =  

    
name "Extra ammos x cuchillo",  
    
author "SIDE",  
    
description "Ganas un extra de ammopacks (Dinero) cuando matas al nemesis con cuchillo",  
    
version "1.0",  
    
url "https://steamcommunity.com/id/CSIDE97/" 
}; 

public 
void OnPluginStart() 

    for (
int i 1<= MaxClientsi++) 
        if(
IsClientInGame(i)) 
            
OnClientPutInServer(i); 


public 
void OnLibraryAdded(const char[] sLibrary)
{
    if (!
strcmp(sLibrary"zombieplague"false))
    {
        if (
ZP_IsMapLoaded())
            
ZP_OnEngineExecute();
    }
}

public 
void OnClientPutInServer(int client) { SDKHook(clientSDKHook_OnTakeDamagePostOnTakeDamagePost); }

public 
void ZP_OnEngineExecute() { g_modo ZP_GetGameModeNameID("nemesis mode"); }

public 
void ZP_OnGameModeStart(int mode)
{
    if (
mode == g_modo)
        
nemesis true;
}

public 
void OnTakeDamagePost(int victimint attackerint inflictorfloat damageint damagetypeint weapon, const float damageForce[3], const float damagePosition[3], int damagecustom

    if (
IsPlayerAlive(victim))
        return; 
             
    if (
victim == attacker || !IsPlayerAlive(attacker)) 
        return; 
        
    
int clase ZP_GetCurrentGameMode();    
    
int money ZP_GetClientMoney(attacker);      
    
int premio_final money premio;
    
    
char arma[64];
    
GetEntPropString(weaponProp_Data"m_iClassname"armasizeof(arma)); 
             
    if (
StrContains(arma"knife"false) == -1)
        return; 
    
    if(!
ZP_IsPlayerHuman(attacker))    
        return;
        
    if(!
ZP_IsGameModeZombieClass(clase"nemesis"))
        return;
        
    if(!
nemesis)
        return;
        
    
ZP_SetClientMoney(attackerpremio_final);
    
CPrintToChat(attacker"{green}[%s] {default} Has ganado {green}%i {default}por acuchillar al nemesis"Prefixpremio);
  
[Imagen: 76561198066347799.png]
Responder
#2
Buen aporte Mario

Ya era hora de que alguien aporte algo aquí...

Voy a tener que aportar algo yo Lengua

Saludos! Crab
Responder
#3
Gracias a lo largo de estos días seguiré aportando cosillas que iré haciendo.
[Imagen: 76561198066347799.png]
Responder
#4
buen aporte
[Imagen: zcsztw-4.png] [Imagen: 6u5fj2-4.png]
[Imagen: linkedin_thumb_image.png][Imagen: 76561198283253977.png][Imagen: linkedin_thumb_image.png]
Responder
#5
Le he metido una actualización para que solo funcione cuando la ronda sea nemesis ya que hay un modo llamado armagueddon en el cual también hay nemesis y survivors con esto también la gente que quiera saber como obtener los modos y no sepan se hagan una idea.
[Imagen: 76561198066347799.png]
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)