This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Help!


Post New Thread Reply   
 
Thread Tools Display Modes
taykor19
Member
Join Date: Feb 2018
Old 02-10-2018 , 07:08   Re: Help!
Reply With Quote #11

Quote:
Originally Posted by raizo11 View Post
maybe you want this

Code:
#include <amxmodx>
#include <hamsandwich>

#define VERSION "0.1"

public plugin_init()
{
    register_plugin("Damage", VERSION, "Justin");

    RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage");
}

public fw_TakeDamage(victim, inflictor, attacker, Float:damage)
{
    new authid[32]; 
    get_user_authid(attacker, authid, 31)

    if ( is_user_alive(attacker))
    {
        if( equali(authid, "STEAM_0:0:1337") )
        {
            SetHamParamFloat(4, damage * 2);
        }
    }
}
Thanks.
taykor19 is offline
taykor19
Member
Join Date: Feb 2018
Old 03-01-2018 , 11:48   Re: Help!
Reply With Quote #12

Quote:
Originally Posted by raizo11 View Post
maybe you want this

Code:
#include <amxmodx>
#include <hamsandwich>

#define VERSION "0.1"

public plugin_init()
{
    register_plugin("Damage", VERSION, "Justin");

    RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage");
}

public fw_TakeDamage(victim, inflictor, attacker, Float:damage)
{
    new authid[32]; 
    get_user_authid(attacker, authid, 31)

    if ( is_user_alive(attacker))
    {
        if( equali(authid, "STEAM_0:0:1337") )
        {
            SetHamParamFloat(4, damage * 2);
        }
    }
}
could you do it 2 steam IDs?
taykor19 is offline
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 03-01-2018 , 12:01   Re: Help!
Reply With Quote #13

Get steam id on client_putinserver() and save it in an array.
If the connected player meets the arrays requirements, turn a bool array size of 32 true.
Then on TakeDamage just check if bool is true to execute or false to handle.
__________________
Relaxing is offline
FunnyGun
Junior Member
Join Date: Dec 2013
Location: Black Land
Old 03-01-2018 , 12:16   Re: Help!
Reply With Quote #14

gr8 m8 i r8 8/8
FunnyGun is offline
taykor19
Member
Join Date: Feb 2018
Old 03-01-2018 , 14:53   Re: Help!
Reply With Quote #15

Help?
taykor19 is offline
Clauu
Senior Member
Join Date: Feb 2008
Location: RO
Old 03-02-2018 , 02:59   Re: Help!
Reply With Quote #16

Since this is a request section, just advices won't be really useful to OP
PHP Code:
#include <amxmodx>
#include <hamsandwich>

#define VERSION "0.1"

// edit here
new const steamIDs[][] = { 
    
"STEAM_0:0:1337"
    
"STEAM_0:0:7331" 
};
//

new isValidSteam[33];
new 
Trie:arrSteamIDs;

public 
plugin_init()
{
    
register_plugin("Damage"VERSION"Justin");

    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage");
    
    
arrSteamIDs TrieCreate();
    for(new 
i=0,j=sizeof(steamIDs);i<j;i++)
        
TrieSetCell(arrSteamIDssteamIDs[i], 0);
}

public 
client_putinserver(id) {

    static 
authid[32]; 
    
get_user_authid(idauthid31);
    
isValidSteam[id] = TrieKeyExists(arrSteamIDsauthid);
}

public 
fw_TakeDamage(victiminflictorattackerFloat:damage)
{
    if(!
isValidSteam[attacker] || !is_user_alive(attacker))
        return 
HAM_IGNORED
    
    SetHamParamFloat
(4damage 2);
    
    return 
HAM_HANDLED    
}

public 
client_disconnect(id)
    
isValidSteam[id]=0

Last edited by Clauu; 03-02-2018 at 03:03.
Clauu is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 03-02-2018 , 08:25   Re: Help!
Reply With Quote #17

Quote:
Originally Posted by raizo11 View Post
maybe you want this

Code:
#include <amxmodx>
#include <hamsandwich>

#define VERSION "0.1"

public plugin_init()
{
    register_plugin("Damage", VERSION, "Justin");

    RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage");
}

public fw_TakeDamage(victim, inflictor, attacker, Float:damage)
{
    new authid[32]; 
    get_user_authid(attacker, authid, 31)

    if ( is_user_alive(attacker))
    {
        if( equali(authid, "STEAM_0:0:1337") )
        {
            SetHamParamFloat(4, damage * 2);
        }
    }
}
This will ignore hegrenade dmg check if user is connected instead, also retrieve the user authid after the connect check.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 03-02-2018 at 08:29.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 15:27.


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