AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   hostages, vip escape (https://forums.alliedmods.net/showthread.php?t=251624)

Jhob94 11-16-2014 08:43

hostages, vip escape
 
How can i detect when some hostage has been rescued?
How can i detect when vip has reach escape zone?

HamletEagle 11-16-2014 09:51

Re: hostages, vip escape
 
Code:
register_logevent ("OnPlayerAction", 3, "1=triggered") public OnPlayerAction( ) {         new loguser[ 80 ], szName[ 32 ], szEvent[ 64 ]     read_logargv(0, loguser, charsmax(loguser))     read_logargv(2, szEvent, charsmax(szEvent))     parse_loguser(loguser, szName, charsmax(szName))         new id = get_user_index(szName)         if(equal(szEvent, "Rescued_A_Hostage"))     {     //rescued a  hostage     }         else if(equal(szEvent, "Escaped_As_VIP"))     {     //vip escaped     } }

Jhob94 11-16-2014 10:27

Re: hostages, vip escape
 
I also need to check when someone kills hostage or the VIP. This event also can detect who is the killer?

HamletEagle 11-16-2014 11:08

Re: hostages, vip escape
 
For hostage kill: you can hook Ham_Killed with hostage as classname.
Or you can do:
Code:
else if(equal(szEvent, "Killed_A_Hostage")) {         }

To check for vip kill hook TakeDamage and check if the victim is vip:
Code:
native cs_get_user_vip(index)

RateX 11-16-2014 12:46

Re: hostages, vip escape
 
@HamletEagle: Just curious, where did you get those events' name and their infos?

HamletEagle 11-16-2014 13:00

Re: hostages, vip escape
 
Quote:

Originally Posted by RateX (Post 2225020)
@HamletEagle: Just curious, where did you get those events' name and their infos?

Searched around the forum some time ago and learned them :))

Jhob94 11-16-2014 14:03

Re: hostages, vip escape
 
Indeed there is much information that isnt easy to find. Events is one of them.

HamletEagle 11-16-2014 14:19

Re: hostages, vip escape
 
But I hope that I helped you with my posts. :D Is something that you don't understood ?

Jhob94 11-16-2014 15:58

Re: hostages, vip escape
 
Quote:

Originally Posted by HamletEagle (Post 2225070)
But I hope that I helped you with my posts. :D Is something that you don't understood ?

I dont.
read_logargv(0, loguser, charsmax(loguser))
When i check for the message that vip has been assassinated, will it return me who's name? VIP or killer?


All times are GMT -4. The time now is 17:33.

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