Raised This Month: $ Target: $400
 0% 

damage event


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Crusher918
Senior Member
Join Date: Feb 2007
Location: New York
Old 04-22-2007 , 11:48   damage event
Reply With Quote #1

Does any1 know what the arguments in the code means?

Code:
register_event("Damage","TGdamage","b","2!0","3=0","4!0")
i know i shouldnt be using it if i dont know but it did what i wanted to do in the plugin

any help would be appreciated
Crusher918 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-22-2007 , 11:50   Re: damage event
Reply With Quote #2

http://www.amxmodx.org/funcwiki.php?...vent&go=search
__________________
Arkshine is offline
Crusher918
Senior Member
Join Date: Feb 2007
Location: New York
Old 04-22-2007 , 13:40   Re: damage event
Reply With Quote #3

no i mean what do they mean
ie
register_event("DeathMsg", "hook_death", "a", "1>0")
1>0 - killer must not be worldspawn
Crusher918 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-22-2007 , 13:44   Re: damage event
Reply With Quote #4

Not sure to understand exactly what you say, but if you want to know params for the Damage event, it's here : http://wiki.amxmodx.org/Half-Life_1_Game_Events#Damage
__________________
Arkshine is offline
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 04-22-2007 , 13:52   Re: damage event
Reply With Quote #5

Quote:
Originally Posted by Crusher918 View Post
Does any1 know what the arguments in the code means?

Code:
register_event("Damage","TGdamage","b","2!0","3=0","4!0")
i know i shouldnt be using it if i dont know but it did what i wanted to do in the plugin

any help would be appreciated
2!0 means second (2) parameter must NOT contain null (0)
3=0 means third (3) parameter have to be null (0)
4!0 means fourth (4) parameter must NOT contain null (0)

btw.: param 1 is alway the type of the message for you it would be "Damage"...

example of deathmsg:
Code:
stock make_deathMsg(Killer, Victim, const weapon[])
{
    //message_begin starts a message.  NEVER start two messages at once.
    //MSG_ALL means send the message to everyone
    //get_user_msgid returns the id of a message name
    //{0,0,0} is the origin vector - not used here
    //0 is the target - no specific target here
    message_begin(MSG_ALL, get_user_msgid("DeathMsg"), {0,0,0}, 0) 
    write_byte(Killer)
    write_byte(Victim)
    write_string(weapon)
    message_end()
}
For further information look here: http://www.amxmodx.org/doc/source/sc...ced.htm#events
AND look here: http://forums.alliedmods.net/showthread.php?p=65983

greetz regalis
__________________

Last edited by regalis; 04-22-2007 at 13:55.
regalis is offline
Crusher918
Senior Member
Join Date: Feb 2007
Location: New York
Old 04-22-2007 , 13:57   Re: damage event
Reply With Quote #6

i know those parameters stuff
but i need to know the arguments

i saw the meaning of it b4 but it was wrong
it was like this:
2!0 - damage must be more than 0
3=0 - damage must be done by player
4!0 - damage must not be worldspawn
This is wrong but if sum1 knows the correct one plz tell me
thx in advanced.
Crusher918 is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 04-22-2007 , 14:41   Re: damage event
Reply With Quote #7

You have register_event() usage explanation and Damage message description so why you asking? Maybe you need a better Damage message arguments desription? Or you just can't figure out how that particular register_event() conditions is related to corresponding Damage event arguments?
VEN is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 04-23-2007 , 11:25   Re: damage event
Reply With Quote #8

okay what I don't get about register_events are:

Code:
You can optionally set a list of restrictions/conditions on the event. For example:
"2=c4" - 2nd parameter of message must be sting "c4".
"3>10" - 3rd parameter must be greater then 10.
"3!4" - 3rd must not be 4.
"2&Buy" - 2nd parameter of message must contain "Buy" substring.
"2!Buy" - 2nd parameter of message can't contain "Buy" substring.
What is the Full list ? Why would you need to do this?
Styles is offline
Send a message via AIM to Styles
Zenith77
Veteran Member
Join Date: Aug 2005
Old 04-23-2007 , 11:53   Re: damage event
Reply With Quote #9

It basically filters out events you don't want/need. So let's say you're using the DeathMsg event to find a killer, and slap him or something (just an example). But, with this, you can't slap an entity or the more common world spawn entity (index: 0). So if killer is the first paramter passed you would use:

Code:
register_event("DeathMsg", "Event_Death", "a", "1!0"); // 1 != 0 public Event_Death() {      // We don't need to check if the killer is connected or alive (chances are he still is when this code is executed, but you can go ahead and do is_user_alive() for safety purposes).      new killer = read_data(1);      user_slap(killer); }

Hope I did everything right, typed it up in the little post box at school.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
Crusher918
Senior Member
Join Date: Feb 2007
Location: New York
Old 04-23-2007 , 22:59   Re: damage event
Reply With Quote #10

Quote:
Originally Posted by VEN View Post
You have register_event() usage explanation and Damage message description so why you asking? Maybe you need a better Damage message arguments desription? Or you just can't figure out how that particular register_event() conditions is related to corresponding Damage event arguments?
not sure what u mean but i think i need to know more about the conditions
Crusher918 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 06:36.


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