AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   variable=true on attacked (https://forums.alliedmods.net/showthread.php?t=40998)

Rolnaaba 07-07-2006 11:39

variable=true on attacked
 
how would i set a variable to true on someone I attacked. Not someone shooting me but someone i shot at?

v3x 07-07-2006 11:47

Re: variable=true on attacked
 
Code:

new bool:mybool[33];

//

register_event("Damage" , "event_Damage" , "b" , "2>0");

//

public event_Damage(victim)
{
  //new attacker = get_user_attacker(victim);
  mybool[victim] = true;
}


Rolnaaba 07-07-2006 11:53

Re: variable=true on attacked
 
is victim pre-defined as person being attacked? cause i dont see where u defined that anywhere
P.S. v3x check ur PM's i sent you 2 of them :)

Zenith77 07-07-2006 12:39

Re: variable=true on attacked
 
You should use read_data() to get the victim. I forget whether it should be 1 or 2 as the param.

Rolnaaba 07-07-2006 12:55

Re: variable=true on attacked
 
i like v3x's way better lol

VEN 07-07-2006 15:21

Re: variable=true on attacked
 
Quote:

You should use read_data() to get the victim. I forget whether it should be 1 or 2 as the param.
Damage event does not contain victim argument at all. Technically it's possible to do new victim = read_data(0) but in fact victim is the person who recieved the Damage message. So i do not see what's wrong in the code above.


All times are GMT -4. The time now is 08:04.

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