AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   omg i don't undersand this (https://forums.alliedmods.net/showthread.php?t=129200)

Nightfall1 06-10-2010 05:21

omg i don't undersand this
 
frist code
PHP Code:

public fw_TakeDamage(victiminflictorattackerFloat:damagedamagebits)
{

    new 
attacker
    
new weapon get_user_weapon(attacker)
    if (
weapon == CSW_DEAGLE)
    {
        
SetHamParamFloat(4damage get_pcvar_num(toggle_dmg))
    }
        
    return 
HAM_IGNORED;


Next try....
PHP Code:

public fw_TakeDamage(victiminflictorattackerFloat:damagedamagebits)
{  
    if (
get_user_weapon(attacker) == CSW_DEAGLE)
    {
        
SetHamParamFloat(4damage get_pcvar_float(toggle_dmg))
        return 
HAM_IGNORED;
    }
    return 
HAM_IGNORED;


Friend Code
PHP Code:

public fw_TakeDamage(victiminflictorattackerFloat:damagedamagebits)
{  
    if (
get_user_weapon(attacker) == CSW_DEAGLE)
    {
        
SetHamParamFloat(4, ( damage *= get_pcvar_floattoggle_dmg ) ) )
        return 
HAM_IGNORED;
    }
    return 
HAM_IGNORED;



DMG NOT WORK
HELP MY


Brreaker 06-10-2010 05:29

Re: omg i don't undersand this
 
PHP Code:

public fw_TakeDamage(victiminflictorattackerFloat:damagedamagebits)
{  
    if (
get_user_weapon(attacker) == CSW_DEAGLE)
    {
        
SetHamParamFloat(4, ( damage *= get_pcvar_floattoggle_dmg ) ) )
        return 
HAM_IGNORED;
    }
    return 
HAM_IGNORED;


This works because damage*=get_pcvar_float means
PHP Code:

damage damage get_pcvar_floattoggle_dmg 

You are just setting the value for the "damage" variable, but you don't assign it :)

Nightfall1 06-10-2010 05:30

Re: omg i don't undersand this
 
si in romana ca nu inteleg ce am facut
PS: IT NOT WORK
wash spelling mistake

Brreaker 06-10-2010 05:53

Re: omg i don't undersand this
 
[ro]

Deci forwardul ala are declarata variabila damage, care tine damage-ul facut de acea arma.Pentru a modifica damage de ex poti scrie
PHP Code:

damage 100 

si astfel, arma va face 100 damage.
In codul tau, doar ai calculat cat damage sa faca, dar nu i-ai spus programului sa puna valoarea obtinuta la variabila DAMAGE.
De aceea cand prietenul tau a pus damage *= get_pcvar_Float
i-a spus programului ca
PHP Code:

damage damage get_pcvar_float etc 

unde:
PHP Code:

//variabila = valoarea variabilei * valoarea cvarului
damage damage get_pcvar_float etc 

sper ca ai inteles :)

unnyquee 06-10-2010 05:56

Re: omg i don't undersand this
 
[ro]
@ Brreaker: damage-ul e Float, nu Int.
Şi treaba cu damage-ul din damage = damage * get_pcvar_float( etc ) nu prea are treabă.

@ Nightfall1: mai bine postează īn forumul multi-lingvistic, decāt să te chinui atāt cu engleza.

[en]
Nothing important :).

PHP Code:

public fw_TakeDamagevictiminflictorattackerFloat:damagedamagebits )
{
      if( 
get_user_weaponattacker ) == CSW_DEAGLE )
      {
            
SetHamParamFloat4damage get_pcvar_floattoggle_dmg ) );

            return 
HAM_HANDLED;
      }

      return 
HAM_IGNORED;



Nightfall1 06-10-2010 06:00

Re: omg i don't undersand this
 
NICI UNU NU MERGE
am pus dmg de 9999, se imulteste dmg deagalului cu 9999 tot acelsi dmg, nu se scimba

unnyquee 06-10-2010 06:04

Re: omg i don't undersand this
 
PHP Code:

#include <cstrike>
#include <hamsandwich> 

[ro]
Sper că sunt incluse deja şi că ai īnregistrat forward-ul.

[en]
Nothing important.. again.

Nightfall1 06-10-2010 06:13

Re: omg i don't undersand this
 
1 Attachment(s)
nu cred ca necesita cstrike
oricum vreu acesta plugin cu dmg sa mearga si copilat

Brreaker 06-10-2010 06:40

Re: omg i don't undersand this
 
pai merge compilat...

Nightfall1 06-10-2010 06:41

Re: omg i don't undersand this
 
Plugin failed to compile! Please try contacting the author.Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

/home/groups/alliedmodders/forums/files/4/1/3/7/2/67451.attach(88) : error 010: invalid function or declaration

1 Error.
Could not locate output file /home/groups/amxmodx/public_html/compiled3/67451.amx (compile failed).


All times are GMT -4. The time now is 05:24.

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