AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   damage event (https://forums.alliedmods.net/showthread.php?t=54306)

Crusher918 04-22-2007 11:48

damage event
 
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

Arkshine 04-22-2007 11:50

Re: damage event
 
http://www.amxmodx.org/funcwiki.php?...vent&go=search

Crusher918 04-22-2007 13:40

Re: damage event
 
no i mean what do they mean
ie
register_event("DeathMsg", "hook_death", "a", "1>0")
1>0 - killer must not be worldspawn

Arkshine 04-22-2007 13:44

Re: damage event
 
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

regalis 04-22-2007 13:52

Re: damage event
 
Quote:

Originally Posted by Crusher918 (Post 468330)
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

Crusher918 04-22-2007 13:57

Re: damage event
 
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.

VEN 04-22-2007 14:41

Re: damage event
 
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?

Styles 04-23-2007 11:25

Re: damage event
 
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?

Zenith77 04-23-2007 11:53

Re: damage event
 
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.

Crusher918 04-23-2007 22:59

Re: damage event
 
Quote:

Originally Posted by VEN (Post 468403)
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


All times are GMT -4. The time now is 06:36.

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