AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [help] Will this DMG multiplier will work? (https://forums.alliedmods.net/showthread.php?t=133505)

jc980 07-26-2010 07:22

[help] Will this DMG multiplier will work?
 
Hey Guys Im not sure if this will work so i need help.

PHP Code:

public ham_zombie_knife(id)
{
if(
cs_get_user_team(id) == CS_TEAM_CT && is_user_alive(id) ) 
    {
        if (
PlayerLevel[id] == 1)
        {
            
SetHamParamFloat(41.0)
        }
        if (
PlayerLevel[id] == 2)
        {
            
SetHamParamFloat(41.1)
        }
        if (
PlayerLevel[id] == 3)
        {
            
SetHamParamFloat(41.2)
        }
        if (
PlayerLevel[id] == 4)
        {
            
SetHamParamFloat(41.3)
        }
    }



Arkshine 07-26-2010 07:33

Re: [help] Will this DMG multiplier will work?
 
Test and see yourself ?

jc980 07-26-2010 07:39

Re: [help] Will this DMG multiplier will work?
 
Quote:

Originally Posted by Arkshine (Post 1251878)
Test and see yourself ?

yes. but i didnt know if i was getting moar damage or not.

drekes 07-26-2010 07:40

Re: [help] Will this DMG multiplier will work?
 
better to use switch(PlayerLevel[id])

alan_el_more 07-26-2010 09:48

Re: [help] Will this DMG multiplier will work?
 
Try this (untested :S)

PHP Code:

new Float:g_level_dmg[] = {
    
1.0// Level 0 -.-
    
1.1// Level 1
    
1.2// Level 2
    
1.3// Level 3
    
1.4// Level 4
    
1.5  // Level 5
}

public 
ham_zombie_knife(id)
{
      if(
cs_get_user_team(id) == CS_TEAM_CT && is_user_alive(id) ) 
      {
              
SetHamParamFloat(4damage g_level_dmg[PlayerLevel[id]])
      }



G[o]Q 07-26-2010 18:50

Re: [help] Will this DMG multiplier will work?
 
do you use Ham_TakeDamage ?
Code:



public ham_zombie_knife(id, idinflictor, idattacker,Float:damage,damagebits)
{
if(cs_get_user_team(id) == CS_TEAM_CT && is_user_alive(id) )
    {
switch(PlayerLevel[id]){
      case 1:{
              SetHamParamFloat(4, 1.0*damage)
      }
      case 2:{
              SetHamParamFloat(4, 1.1*damage)
      }
      case 3:{
              SetHamParamFloat(4, 1.2*damage)
      }
      case 4:{
              SetHamParamFloat(4, 1.3*damage)
      }
}
    }



Code:

damage = damage*1.1

not
Code:

damage = 1.1

jc980 07-27-2010 05:13

Re: [help] Will this DMG multiplier will work?
 
Quote:

Originally Posted by g[o]q (Post 1252502)
do you use Ham_TakeDamage ?
Code:



public ham_zombie_knife(id, idinflictor, idattacker,Float:damage,damagebits)
{
if(cs_get_user_team(id) == CS_TEAM_CT && is_user_alive(id) )
    {
switch(PlayerLevel[id]){
      case 1:{
              SetHamParamFloat(4, 1.0*damage)
      }
      case 2:{
              SetHamParamFloat(4, 1.1*damage)
      }
      case 3:{
              SetHamParamFloat(4, 1.2*damage)
      }
      case 4:{
              SetHamParamFloat(4, 1.3*damage)
      }
}
    }



Code:

damage = damage*1.1

not
Code:

damage = 1.1

yes. i just renamed it

SnoW 07-27-2010 05:55

Re: [help] Will this DMG multiplier will work?
 
PHP Code:

PlayerLevel[id] * 0.1 1.0 ) * damage 



All times are GMT -4. The time now is 00:13.

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