Raised This Month: $ Target: $400
 0% 

[Ayuda] Cambiar daņo a un arma...


  
 
 
Thread Tools Display Modes
Author Message
MexPower
Veteran Member
Join Date: Nov 2012
Old 01-28-2013 , 20:04   [Ayuda] Cambiar daņo a un arma...
#1

Hola gente de AM, Solo les tenia una pregunta, este tutorial de starsailor para cambiar el daņo de las armas, me intereso y como que le entendi pero lo que no entiendo es donde definio o donde se define a que arma le multiplico el daņo por 2
PHP Code:
#include <amxmodx>
#include <hamsandwich> //indispensable para que funcione xD

public plugin_init()
{
    
register_plugin("Mini tuto","1.0","Maartin! (Starsailor)")

//  registramos el hamtakedamage    ENTidad      Handler     Post
    
RegisterHam(Ham_TakeDamage"player""FwdTakeDamage"0)
    
}

//              id  victima     arma  attacker id  daņo      tipo de daņo              
public FwdTakeDamage(victiminflictorattackerFloat:damagedamage_bits)
{            
//parametro 1         2         3             4             5
    
        
SetHamParamFloat(4,(damage*2.0)) 
        return 
HAM_HANDLED  
    
    
// ya el nombre del comando te lo dice
    // set param float
    // PARAMETRO 4 (daņo)
    // FLOAT porqe es un numero decimal
    // 2.0 porqe multiplicamos el daņo que hace por 2
    

Si me podrian ayudar en eso porfa, me harian un gran favor
MexPower is offline
StrikerV2
Senior Member
Join Date: Nov 2012
Location: Chile , O Yes!
Old 01-28-2013 , 20:18   Re: [Ayuda] Cambiar daņo a un arma...
#2

PHP Code:
#include <amxmodx> 
#include <hamsandwich> //indispensable para que funcione xD 

public plugin_init() 

    
register_plugin("Mini tuto","1.0","Maartin! (Starsailor)"

//  registramos el hamtakedamage    ENTidad      Handler     Post 
    
RegisterHam(Ham_TakeDamage"player""FwdTakeDamage"0
     


//              id  victima     arma  attacker id  daņo      tipo de daņo               
public FwdTakeDamage(victiminflictorattackerFloat:damagedamage_bits
{            
//parametro 1         2         3             4             5 
     
        
SetHamParamFloat(4,(damage*2.0))  // En Donde Dice 2.0 Sale un * Signo de multiplicacion 2.0 = 2 ._. Multiplica El damage por 2 
        
return HAM_HANDLED   
     
    
// ya el nombre del comando te lo dice 
    // set param float 
    // PARAMETRO 4 (daņo) 
    // FLOAT porqe es un numero decimal 
    // 2.0 porqe multiplicamos el daņo que hace por 2 
     

__________________
Mi firma era tan sexy .-.

Last edited by StrikerV2; 01-28-2013 at 20:19.
StrikerV2 is offline
Send a message via MSN to StrikerV2
Roccoxx
AlliedModders Donor
Join Date: Jan 2012
Location: Argentina
Old 01-28-2013 , 20:23   Re: [Ayuda] Cambiar daņo a un arma...
#3

igual esta incompleto debes checkiar si el atacante o la victima estan vivos y checkiar si la victima es el atacante.
__________________
Tutorials here (Spanish)

Like as another Pijudo said: "Tired and retired"
Roccoxx is offline
Send a message via MSN to Roccoxx
MexPower
Veteran Member
Join Date: Nov 2012
Old 01-28-2013 , 20:24   Re: [Ayuda] Cambiar daņo a un arma...
#4

Si, Eso lose, lo que no comprendi es en que arma se multipiclo por 2, o no se definio eso y se multiplico por 2 todos sus ataques??? porque quiero cambiar el daņo de una granada y no se definir que se multiplique por 2 pero solo el daņo de una granda

EDIT: Roccoxx lo que usted dise es asi?
PHP Code:
if(victim == attacker || !is_user_alive(victim) || !is_user_alive(attacker)) 

Last edited by MexPower; 01-28-2013 at 20:32.
MexPower is offline
Roccoxx
AlliedModders Donor
Join Date: Jan 2012
Location: Argentina
Old 01-28-2013 , 20:38   Re: [Ayuda] Cambiar daņo a un arma...
#5

si justo a eso me refiero (:, acordate del return e.e.

en ese plugin multiplica por 2 todos sus ataques, busca en los temas de blackfur ahi el creo un tema para cambiar el daņo a la granada he ;)
__________________
Tutorials here (Spanish)

Like as another Pijudo said: "Tired and retired"
Roccoxx is offline
Send a message via MSN to Roccoxx
StrikerV2
Senior Member
Join Date: Nov 2012
Location: Chile , O Yes!
Old 01-28-2013 , 20:41   Re: [Ayuda] Cambiar daņo a un arma...
#6

PHP Code:
#include <amxmodx> 
#include <hamsandwich> //indispensable para que funcione xD 

public plugin_init() 

    
register_plugin("Mini tuto","1.0","Maartin! (Starsailor)"
    
    
//  registramos el hamtakedamage    ENTidad      Handler     Post 
    
RegisterHam(Ham_TakeDamage"player""FwdTakeDamage"0
    


//              id  victima     arma  attacker id  daņo      tipo de daņo               
public FwdTakeDamage(victiminflictorattackerFloat:damagedamage_bits

    if( !
is_user_connectedvictim ) && !is_user_alivevictim ) ) 
        return 
HAM_IGNORED;  
    
    if( 
get_user_weaponattacker ) != CSW_HEGRENADE 
        return 
HAM_IGNORED
    
    
SetHamParamFloat4damage 10.0 // Sumaria el daņo en 10. 
    
return HAM_HANDLED
    

__________________
Mi firma era tan sexy .-.

Last edited by StrikerV2; 01-28-2013 at 20:52.
StrikerV2 is offline
Send a message via MSN to StrikerV2
MexPower
Veteran Member
Join Date: Nov 2012
Old 01-28-2013 , 20:51   Re: [Ayuda] Cambiar daņo a un arma...
#7

, Busque y busque con el blackfur Biendo sus treaths y no encontre nada, buelvo y el striker me iso el favor xD

oye y gracias me podrias explicar esto? xP

PHP Code:
#define m_bitsDamageType 76 //que es esto y porque 76?

#define DMG_GRENADE (1<<24) //que es eso "(1<<24)"

if ( get_pdata_intvictim m_bitsDamageType ) & DMG_GRENADE 
        
SetHamParamFloat4damage 400.0 )  //Veo que en lugar de multriplicar le sumaste el daņo mas 400 :D 
MexPower is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 01-29-2013 , 03:58   Re: [Ayuda] Cambiar daņo a un arma...
#8

Para los 2 defines , estan en el HL-SDK , de ahi se sacan.
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
 



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 03:24.


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