Raised This Month: $ Target: $400
 0% 

Detect lasermine - incorrect code


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
J4CK
Member
Join Date: Dec 2008
Location: India
Old 07-07-2012 , 13:41   Detect lasermine - incorrect code
Reply With Quote #1

how it's possible, detect deaths with lasermine.
Quote:
Player1 killed Player2 with lasermine
my code is not working anybody know why?

PHP Code:
register_event("DeathMsg""eDeath""a");

public 
eDeath()
{
     new 
szWeapon10 ];
     
read_data4szWeaponcharsmaxszWeapon ) );

     if( 
equalszWeapon"lasermine" ) )
     {
          new 
iKiller read_data(1);
          new 
iVictim read_data(2);

          
//blablabla

     
}

J4CK is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-07-2012 , 13:54   Re: Detect lasermine - incorrect code
Reply With Quote #2

do some debugging, try client_print( 0 , print_chat , "weapon=%s" , szWeapon ) and see why it doesn't match.
__________________
Bugsy is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 07-07-2012 , 16:07   Re: Detect lasermine - incorrect code
Reply With Quote #3

I use a forward to do it...

Here is an example:
PHP Code:
g_lm_forward;

public 
plugin_init( )
    
g_lm_forward CreateMultiForward"lasermine_kill"ET_IGNOREFP_CELLFP_CELL );

// if you are using the common lasermine/tripmine use this:
set_score(id,target,hitscore,HP){
    
// blablabla
    
new iReturn
    ExecuteForward
g_lm_forwardiReturnidtarget );
)

// you can use this in any other plugin you want
forward lasermine_killkillervictim )

public 
lasermine_killkillervictim )
{
     
// here what you want

__________________

Last edited by Neeeeeeeeeel.-; 07-07-2012 at 16:08.
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
J4CK
Member
Join Date: Dec 2008
Location: India
Old 07-08-2012 , 15:15   Re: Detect lasermine - incorrect code
Reply With Quote #4

not working
i want use this code with this lasermine: https://forums.alliedmods.net/showthread.php?t=25819
i know how edit original code, but i need standalone code.

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>

new g_lm_forward;

public 
plugin_init()
{
    
register_plugin("test""0.1""test");
    
g_lm_forward CreateMultiForward"lasermine_kill"ET_IGNOREFP_CELLFP_CELL );
}

public 
lasermine_killkillervictim )
{
// for example killer get grenade after kill enemy with laser
        
give_item(killer"weapon_hegrenade")

J4CK is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 07-08-2012 , 23:46   Re: Detect lasermine - incorrect code
Reply With Quote #5

I made an example for you.
Attached Files
File Type: sma Get Plugin or Get Source (lasermine_023.sma - 649 views - 39.1 KB)
File Type: inc lasermine.inc (303 Bytes, 59 views)
File Type: sma Get Plugin or Get Source (lm_kill.sma - 1434 views - 580 Bytes)
__________________

Last edited by Neeeeeeeeeel.-; 07-08-2012 at 23:49. Reason: He needs it externally.
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
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:02.


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