Raised This Month: $51 Target: $400
 12% 

Need help to convert some natives


  
 
 
Thread Tools Display Modes
Author Message
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-28-2007 , 08:39   Need help to convert some natives
#1

Hi there,

i need some help to convert those 2 natives from amx (2006.3 ?)

amx2006.3 vexdum.inc :
Quote:
native take_damage(victim, attacker, Floatrig[3], Float:dmg, bit=DMG_BULLET, wpnName[]="", hs = 0);
native client_death(victim, attacker, wpnName[]="", hs = 0);

I've found client_death from csx.inc but i can't get it to work

csx.inc :
Quote:
/* Function is called after player death ,
* if player was killed by teammate TK is set to 1 */
forward client_death(killer,victim,wpnindex,hitplace, TK);

Any help would be apreciated
ConnorMcLeod is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 01-28-2007 , 13:23   Re: Need help to convert some natives
#2

Why not just register the events?
Code:
	register_event("Damage", "event_damage", "b", "2!0")
	register_event("DeathMsg", "event_death", "a")
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-28-2007 , 13:32   Re: Need help to convert some natives
#3

I'm trying to convert amx_apache and i guess (i am definitly not a coder) this is not a damage event because of the chopper entity.

Code:
          {
            new Float:origin[3]
            entity_get_vector(entity2, EV_VEC_origin, origin)
            take_damage(entity2, attacker, origin, get_cvar_float("apache_bulletdmg"), DMG_BULLET, "apache_gun")
          }
ConnorMcLeod is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 01-28-2007 , 13:37   Re: Need help to convert some natives
#4

oh my bad, didn't look at it closely. for this you can use engine's
Code:
fakedamage(idvictim,szClassname[],Float:takedmgdamage,damagetype)
edit: however, if it kills idvictim, you will need to show your own deathmessage
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-28-2007 , 14:02   Re: Need help to convert some natives
#5

I think i miss something.

Tried that

Code:
            new Float:origin[3]
            entity_get_vector(entity2, EV_VEC_origin, origin)
            //take_damage(entity2, attacker, origin, get_cvar_float("apache_bulletdmg"), DMG_BULLET, "apache_gun")
            fakedamage(entity2, attacker,get_cvar_float("apache_bulletdmg"),DMG_BULLET, "apache_gun")
..........................................
            new Float:origin[3]
            entity_get_vector(entity2, EV_VEC_origin, origin)
            if(equal(classname2, "player") && get_user_health(entity2) == 1)
            {
              client_print(entity2, print_center, "NEVER STAND IN THE ROTORS AGAIN!")
            }
            //take_damage(entity2, attacker, origin, 1.0, DMG_SLASH, "apache")
            fakedamage(entity2, attacker, 1.0, DMG_SLASH, "apache")
          }
but it doesn't compile

Please show me an example.

original .sma an actual ported :

Last edited by ConnorMcLeod; 01-29-2007 at 23:10. Reason: remove attachments
ConnorMcLeod is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 01-28-2007 , 15:39   Re: Need help to convert some natives
#6

Code:
fakedamage(entity2, "apache_gun",get_cvar_float("apache_bulletdmg"),DMG_BULLET)
Code:
fakedamage(entity2, "apache", 1.0, DMG_SLASH)
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-29-2007 , 19:19   Re: Need help to convert some natives
#7

Doesn't compile.

Code:
engine_stocks.inc(27) : error 088: number of arguments does not match definition
engine_stocks.inc(32) : error 017: undefined symbol "DispatchKeyValue"
engine_stocks.inc(34) : error 017: undefined symbol "DispatchKeyValue"
engine_stocks.inc(35) : error 017: undefined symbol "DispatchKeyValue"
Am i doing something wrong ?
ConnorMcLeod is offline
BAILOPAN
Join Date: Jan 2004
Old 01-29-2007 , 19:50   Re: Need help to convert some natives
#8

Make sure you've done:
Code:
#include <engine>
__________________
egg
BAILOPAN is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-29-2007 , 23:09   Re: Need help to convert some natives
#9

Ok i really not manage.

Tried to add include engine (same errors), but i guess it's allready included with the amxmod_compat includes.

Is it possible to add something like that :

Code:
stock take_damage(idvictim, attacker, Float:orig[3], Float:takedmgdamage, damagetype, szClassname[], hs = 0)
{
    return fakedamage(idvictim,szClassname[],Float:takedmgdamage,damagetype);
}
in vexdum.inc or VexdUM_stock.inc ?


If someone has time, can he convert this cool plugin ?
Original plugin is there : http://djeyl.net/forum/index.php?showtopic=41613

tried-to-port one is below :

Last edited by ConnorMcLeod; 05-21-2009 at 11:38.
ConnorMcLeod is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 01-29-2007 , 23:39   Re: Need help to convert some natives
#10

Here is a temp port. It does not use radius_damage correctly.
Attached Files
File Type: sma Get Plugin or Get Source (amx_apache.sma - 907 views - 31.8 KB)
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
 



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 05:52.


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