Raised This Month: $ Target: $400
 0% 

Is monster ally?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Drak
Veteran Member
Join Date: Jul 2005
Old 10-23-2006 , 22:50   Is monster ally?
Reply With Quote #1

I wanted to check to see if the monster killed, is a ally using the SvenCoop module. I tryed makeing a death message, and using "sc_is_player_ally" But it kept returning 0. Is there anyway for 'get_user_attacker'; or something to get the information?

Last edited by Drak; 10-23-2006 at 23:14.
Drak is offline
Send a message via MSN to Drak
Silencer123
Veteran Member
Join Date: Jul 2006
Old 10-24-2006 , 08:43   Re: Is monster ally?
Reply With Quote #2

A SvenCoop Module? O_o Where? O_o
> get_user_attacker returns attackers EntId.
The Entity IDs of Players range from 1 to 32.
Other Entites Entids range from 33 to 8224.
I am not sure if this can only be called on Damage
Event or if it is last Attack but if you try to use
Damage Event Hook it as Global Event, not as
Event sent to a single Player because that is
only called when the Player takes Damage.
Whatsoever you cannot get the Team or Ally Status with that.
Bythe Way it is "is_player_ally" not "sc_is_player_ally" and also
Scientistsand Barneys have this reversed. For Example a Scientist
with is_player_ally = 1 would be an Enemy. Also check if the
Data is a bool or an integer. (A bool makes more sence, as this
can just be 0 or 1 / false or true) Or you could try to get the
Monsters Relation to you. (Offers much more) This is, for Example,
if you shoot a Scientist he runs away from you, if you heal him
with the MedKit he acts normal again.
__________________
EAT YOUR VEGGIES
Silencer123 is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 10-24-2006 , 09:38   Re: Is monster ally?
Reply With Quote #3

use deathMsg event and read_data

Half Life 1 Events: Registering, Using, and Reading them

then you could do something like:
Code:
public plugin_init() {      register_event("DeathMsg", "Death", "a") } public Death() {      new victim = read_data(2)      new killer = read_data(1)      if(get_user_team(victim) == get_user_team(killer)) {           //...      } }
that may or may not work depending on if that is correct usage of the get_user_team function

EDIT: just realized I dunno what the svenCoop module is and I have no idea what your talking about so ignore my post as the "moster" isn't a player my code probably will not work
__________________
DO NOT PM me about avp mod.

Last edited by Rolnaaba; 10-24-2006 at 09:56.
Rolnaaba is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Old 10-24-2006 , 13:08   Re: Is monster ally?
Reply With Quote #4

DeathMsg does not work, as SvenCoop is not giving any Message if a Monster or Player has died.
And that is good, because a lot of Stuff dies in that Game. *lol*
__________________
EAT YOUR VEGGIES
Silencer123 is offline
Drak
Veteran Member
Join Date: Jul 2005
Old 10-24-2006 , 13:44   Re: Is monster ally?
Reply With Quote #5

Quote:
Originally Posted by Silencer123 View Post
A SvenCoop Module? O_o Where? O_o
> get_user_attacker returns attackers EntId.
The Entity IDs of Players range from 1 to 32.
Other Entites Entids range from 33 to 8224.
I am not sure if this can only be called on Damage
Event or if it is last Attack but if you try to use
Damage Event Hook it as Global Event, not as
Event sent to a single Player because that is
only called when the Player takes Damage.
Whatsoever you cannot get the Team or Ally Status with that.
Bythe Way it is "is_player_ally" not "sc_is_player_ally" and also
Scientistsand Barneys have this reversed. For Example a Scientist
with is_player_ally = 1 would be an Enemy. Also check if the
Data is a bool or an integer. (A bool makes more sence, as this
can just be 0 or 1 / false or true) Or you could try to get the
Monsters Relation to you. (Offers much more) This is, for Example,
if you shoot a Scientist he runs away from you, if you heal him
with the MedKit he acts normal again.
http://forums.alliedmods.net/showthread.php?t=23985
Drak is offline
Send a message via MSN to Drak
Rolnaaba
Veteran Member
Join Date: May 2006
Old 10-24-2006 , 17:12   Re: Is monster ally?
Reply With Quote #6

ok lol dont know how to help you without further study if I find something I will let you know.
__________________
DO NOT PM me about avp mod.
Rolnaaba 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 04:46.


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