Raised This Month: $ Target: $400
 0% 

how can i add this 2 case?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 06-19-2011 , 14:18   Re: how can i add this 2 case?
Reply With Quote #1

You need to create a global array that is indexed by a player index.
PHP Code:
case 2:
{
    
g_yourGlobalArray[id] = true

Then check that array in the damage handler.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
2reason2kill
Senior Member
Join Date: Feb 2011
Old 06-19-2011 , 14:48   Re: how can i add this 2 case?
Reply With Quote #2

Quote:
Originally Posted by Exolent[jNr] View Post
You need to create a global array that is indexed by a player index.
PHP Code:
case 2:
{
    
g_yourGlobalArray[id] = true

Then check that array in the damage handler.
Im trying 2 add block deagle damage 2 case when some1 buy it.

and like this?

PHP Code:
public fwTakeDamagevictim inflictor attacker Float:damage damage_bits )
{
    if( 
IsPlayerattacker ) && is_user_aliveattacker ) && inflictor == attacker && ( get_user_weapon(attacker) == CSW_DEAGLE ) )
g_ibought[id][antideagle] = true;
    {
        return 
HAM_SUPERCEDE;
    }
    
    return 
HAM_IGNORED;

like that?
2reason2kill is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-19-2011 , 15:58   Re: how can i add this 2 case?
Reply With Quote #3

This must be related to some other thread/code because I'm lost on this one.

Quote:
Originally Posted by 2reason2kill View Post
Im trying 2 add block deagle damage 2 case when some1 buy it.
You have a keyboard, use it. Stop using numbers as words.
__________________
fysiks is online now
2reason2kill
Senior Member
Join Date: Feb 2011
Old 06-19-2011 , 16:00   Re: how can i add this 2 case?
Reply With Quote #4

Quote:
Originally Posted by fysiks View Post
This must be related to some other thread/code because I'm lost on this one.



You have a keyboard, use it. Stop using numbers as words.
Okay, But where did u lost it?
2reason2kill is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 06-19-2011 , 16:19   Re: how can i add this 2 case?
Reply With Quote #5

Quote:
Originally Posted by 2reason2kill View Post
and like this?

PHP Code:
public fwTakeDamagevictim inflictor attacker Float:damage damage_bits )
{
    if( 
IsPlayerattacker ) && is_user_aliveattacker ) && inflictor == attacker && ( get_user_weapon(attacker) == CSW_DEAGLE ) )
g_ibought[id][antideagle] = true;
    {
        return 
HAM_SUPERCEDE;
    }
    
    return 
HAM_IGNORED;

like that?
No. My code was how to set that the player has it.
You have to check if the player has it in that if statement inside the damage forward.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
2reason2kill
Senior Member
Join Date: Feb 2011
Old 06-19-2011 , 16:31   Re: how can i add this 2 case?
Reply With Quote #6

Quote:
Originally Posted by Exolent[jNr] View Post
No. My code was how to set that the player has it.
You have to check if the player has it in that if statement inside the damage forward.
Is This Right?

PHP Code:
public fwTakeDamagevictim inflictor attacker Float:damage damage_bits )
{
    if(
is_user_alive(id) )
        {
            if(
g_bBoght[id][anti_deagle] = true)
            {
                
                if( 
IsPlayerattacker ) && is_user_aliveattacker ) && inflictor == attacker && ( get_user_weapon(attacker) == CSW_DEAGLE ) )
                {
                    return 
HAM_SUPERCEDE;
                }
                
    
            return 
HAM_IGNORED;
            }
    }

Code:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team


Error: Undefined symbol "id" on line 398
Error: Undefined symbol "id" on line 400



2 Errors.
Please Explian To me what's Wrong.
2reason2kill is offline
Dolph_Ziggler
BANNED
Join Date: Jun 2011
Old 06-20-2011 , 09:04   Re: how can i add this 2 case?
Reply With Quote #7

Quote:
Originally Posted by 2reason2kill View Post
Is This Right?

PHP Code:
public fwTakeDamagevictim inflictor attacker Float:damage damage_bits )
{
    if(
is_user_alive(id) )
        {
            if(
g_bBoght[id][anti_deagle] = true)
            {
                
                if( 
IsPlayerattacker ) && is_user_aliveattacker ) && inflictor == attacker && ( get_user_weapon(attacker) == CSW_DEAGLE ) )
                {
                    return 
HAM_SUPERCEDE;
                }
                
    
            return 
HAM_IGNORED;
            }
    }

Code:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team


Error: Undefined symbol "id" on line 398
Error: Undefined symbol "id" on line 400



2 Errors.
Please Explian To me what's Wrong.
the wrong that you don't add id remplace :
PHP Code:
public fwTakeDamagevictim inflictor attacker Float:damage damage_bits )


PHP Code:
public fwTakeDamagevictim inflictor attacker Float:damage damage_bits id )

Dolph_Ziggler is offline
Send a message via MSN to Dolph_Ziggler
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 06-20-2011 , 11:27   Re: how can i add this 2 case?
Reply With Quote #8

Quote:
Originally Posted by Dolph_Ziggler View Post
the wrong that you don't add id remplace :
PHP Code:
public fwTakeDamagevictim inflictor attacker Float:damage damage_bits )


PHP Code:
public fwTakeDamagevictim inflictor attacker Float:damage damage_bits id )

You are completely wrong. Stop helping if you don't know what you are doing.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
2reason2kill
Senior Member
Join Date: Feb 2011
Old 06-20-2011 , 14:15   Re: how can i add this 2 case?
Reply With Quote #9

Quote:
Originally Posted by Dolph_Ziggler View Post
the wrong that you don't add id remplace :
PHP Code:
public fwTakeDamagevictim inflictor attacker Float:damage damage_bits )


PHP Code:
public fwTakeDamagevictim inflictor attacker Float:damage damage_bits id )

i think it was like

PHP Code:
public fwTakeDamagevictim inflictor attacker Float:damage damage_bits  
Right?
2reason2kill is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 06-20-2011 , 15:09   Re: how can i add this 2 case?
Reply With Quote #10

Quote:
Originally Posted by 2reason2kill View Post
i think it was like

PHP Code:
public fwTakeDamagevictim inflictor attacker Float:damage damage_bits  
Right?
You had your function header correct the first time.
Yes, that one there is the proper header.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Reply



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 23:28.


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