Raised This Month: $ Target: $400
 0% 

Laser/TripMine Entity


Post New Thread Reply   
 
Thread Tools Display Modes
+ARUKARI-
AlliedModders Donor
Join Date: Jul 2004
Location: Japan
Old 05-07-2025 , 20:37   Re: Laser/TripMine Entity
Reply With Quote #771

Quote:
Originally Posted by SaraAki View Post
Thank you.
What about this:
PHP Code:
register_event("DeathMsg""Event_DeathMsg""a"
PHP Code:
public Event_DeathMsg()
{
    new 
iKiller read_data(DeathMsg_KillerID)
    if( 
IsPlayer(iKiller) && is_user_connected(iKiller) )
    {
        new 
iVictim read_data(DeathMsg_VictimID)
        if( 
iVictim != iKiller )
        {
            
g_iNewMoney clamp
                        

                            
cs_get_user_money(iKiller) + get_pcvar_numcs_get_user_team(iVictim) == cs_get_user_team(iKiller) ? g_pCvarTkMoney : (read_data(DeathMsg_IsHeadshot) ? g_pCvarKillMoneyHs g_pCvarKillMoney) ), 
                            
0
                            
get_pcvar_num(g_pCvarMaxMoney)
                        )
            
g_iMsgHookMoney register_message(gmsgMoney"Message_Money")
        }
    }

What I want is,if the player dies from the laser no bonus money for the killer.
what did i try is:
PHP Code:
if(IsLM(iKiller))
            return 
PLUGIN_HANDLED

        
static szWeaponName];

        
read_data4szWeaponNamecharsmaxszWeaponName ) );

        if ( 
equalszWeaponName"world" ) )
            return 
PLUGIN_HANDLED 
but this doesn't work
"iKiller" contains the player ID.
The "IsLM" function checks whether the entity ID corresponds to a Lasermine.

Retrieve read_data(4) and check whether the weapon is a lasermine.
PHP Code:
if (equali(szWeaponName"lasermine"))
            return 
PLUGIN_HANDLED
If you want to control the amount of money, set "amxx_ltm_frag_money" to zero and use the "cs_set_user_money" function based on conditions.
__________________
GitHub
SteamWishlist

六四天安門事件
+ARUKARI- is offline
SaraAki
Senior Member
Join Date: Nov 2022
Old 05-08-2025 , 00:37   Re: Laser/TripMine Entity
Reply With Quote #772

Lasermine cvar for money is already on 0.
if (equali(szWeaponName, "lasermine"))
return PLUGIN_HANDLED;
This also didn't work.
With all 3 method I tried,after killing enemy with laser,killer get 300$
SaraAki is offline
+ARUKARI-
AlliedModders Donor
Join Date: Jul 2004
Location: Japan
Old 05-08-2025 , 04:04   Re: Laser/TripMine Entity
Reply With Quote #773

Can you confirm what is in szWeaponName?
try it.
PHP Code:
client_print(iKillerprint_chatszWeaponName); 
__________________
GitHub
SteamWishlist

六四天安門事件
+ARUKARI- is offline
SaraAki
Senior Member
Join Date: Nov 2022
Old 05-12-2025 , 14:57   Re: Laser/TripMine Entity
Reply With Quote #774

Quote:
Originally Posted by +ARUKARI- View Post
Can you confirm what is in szWeaponName?
try it.
PHP Code:
client_print(iKillerprint_chatszWeaponName); 
I was on vacation, that's why I'm late.
I get nothing in chat after lm hit.

PHP Code:
public bacon_takedamage_player(victiminflictorattackerFloatdamagedamagetype)
{
    if (
victim == attacker || !is_user_alive(victim) || !is_user_alive(attacker))
        return 
HAM_IGNORED

    
new iVictimAr get_user_armor(victim)
    

        static 
szWeaponName];

        
read_data4szWeaponNamecharsmaxszWeaponName ) );

           
          if(
is_user_alive(attacker))
      {
        if (
iVictimAr >= 1)
        {
            
client_print_center(attacker"[armor %d]"get_user_armor(victim))
                        
client_print(attackerprint_chatszWeaponName); 
        }
      }
          return 
HAM_HANDLED
        


Last edited by SaraAki; 05-12-2025 at 15:57.
SaraAki is offline
Krtola
Veteran Member
Join Date: Oct 2013
Location: Serbia
Old 05-13-2025 , 02:21   Re: Laser/TripMine Entity
Reply With Quote #775

PHP Code:
new const ENT_CLASS_NAME[] = "lasermine" 
Now in your bacon take damage bla bla

PHP Code:
new classname[32]; pev(inflictorpev_classnameclassname31

        if(
equal(classnameENT_CLASS_NAME)) 
                return 
HAM_IGNORED 
__________________
I made a new zombie mod for 2025 with unique lasermine.
Look at the video below.

https://www.youtube.com/shorts/Uzixo25SqDw

Perfect balanced mod with good items.Look at the video below.

https://www.youtube.com/shorts/vcQ2HMf847I
Krtola is offline
Send a message via Skype™ to Krtola
+ARUKARI-
AlliedModders Donor
Join Date: Jul 2004
Location: Japan
Old 05-13-2025 , 09:06   Re: Laser/TripMine Entity
Reply With Quote #776

@SaraAki
As @Krtola says, when using Ham_Takedame, you can check the "inflictor".
__________________
GitHub
SteamWishlist

六四天安門事件
+ARUKARI- is offline
SaraAki
Senior Member
Join Date: Nov 2022
Old 05-13-2025 , 11:07   Re: Laser/TripMine Entity
Reply With Quote #777

Ok this work in takedamage,but didn't work in public Event_DeathMsg().I should post this problem in money plugin
SaraAki is offline
CryWolf
Veteran Member
Join Date: Jul 2008
Location: Romania
Old 06-20-2025 , 08:43   Re: Laser/TripMine Entity
Reply With Quote #778

Hi there im trying to get gib on zombies only when they are killed by lasermine
PHP Code:
public bacon_killed(victimattackershouldgib)
{
    static 
szWeaponName];
    
read_data4szWeaponNamecharsmaxszWeaponName ) );
    
    if( 
is_user_zombie(victim) && get_pcvar_num(cvar_bodyexplodes) )
    {
        if (
equali(szWeaponName"lasermine")) {
            
SetHamParamInteger(32)
            return 
HAM_HANDLED;
        }
    }
    return 
HAM_IGNORED

Don't know what i am doing wrong , cuz it doesn't work

Another try:
PHP Code:
public bacon_killed(victimattackershouldgib)
{
    static 
szWeaponName];
    
read_data4szWeaponNamecharsmaxszWeaponName ) );
    new 
classname[32]; pev(attackerpev_classnameclassname31
    
    if( 
is_user_zombie(victim) && get_pcvar_num(cvar_bodyexplodes) )
    {
        if(
equal(classnameENT_CLASS_NAME)) {
            
SetHamParamInteger(32)
            return 
HAM_HANDLED;
        }
    }
    return 
HAM_IGNORED

Same , the code is from bio_misc.sma
__________________
I dont walk trough this world with fear in my heart.
www.dark-arena.com L4D, CS1.6, CZ Servers

Last edited by CryWolf; 06-20-2025 at 08:53.
CryWolf is offline
Send a message via MSN to CryWolf Send a message via Yahoo to CryWolf
+ARUKARI-
AlliedModders Donor
Join Date: Jul 2004
Location: Japan
Old 06-21-2025 , 10:43   Re: Laser/TripMine Entity
Reply With Quote #779

@CryWolf
try this.
PHP Code:
public bacon_killed(victimattackershouldgib)
{
    static 
szWeaponName];
    
read_data4szWeaponNamecharsmaxszWeaponName ) );
    
    if( 
is_user_zombie(victim) && get_pcvar_num(cvar_bodyexplodes) )
    {
         if ( 
get_ent_data(victim"CBaseMonster","m_bitsDamageType") & DMG_ENERGYBEAM) {
            
SetHamParamInteger(32)
            return 
HAM_HANDLED;
        }
    }
    return 
HAM_IGNORED

__________________
GitHub
SteamWishlist

六四天安門事件

Last edited by +ARUKARI-; 06-21-2025 at 10:43.
+ARUKARI- is offline
CryWolf
Veteran Member
Join Date: Jul 2008
Location: Romania
Old 06-22-2025 , 06:27   Re: Laser/TripMine Entity
Reply With Quote #780

Thanks , works fine
__________________
I dont walk trough this world with fear in my heart.
www.dark-arena.com L4D, CS1.6, CZ Servers
CryWolf is offline
Send a message via MSN to CryWolf Send a message via Yahoo to CryWolf
Reply


Thread Tools
Display Modes

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 20:16.


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