Jump to content
Sign in to follow this  
mrbean1112

Eventhandlers

Recommended Posts

"FML_HP3_slow_Zombie10" createunit [getpos die1,jas,"BOBs=this"]

how would i give him an eventhandler of being killed exec script zkilled.sqs

?

Share this post


Link to post
Share on other sites

Very simple:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

BoBs addEventHandler ["hit",{_this exec "script.sqs"}]

Share this post


Link to post
Share on other sites
Very simple:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

BoBs addEventHandler ["hit",{_this exec "script.sqs"}]

thanks.. but i have the script looping, so i imagine there are many bobs being made... now... will this affect the eventhandler?

Share this post


Link to post
Share on other sites

hi, look here:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

#loop

_bob = "FML_HP3_slow_Zombie10" createunit [getpos die1,jas,"BOBs=this"]

~.5

_bob addEventHandler ["hit",{_this exec "script.sqs"}]

goTo "loop"

Share this post


Link to post
Share on other sites
hi, look here:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

#loop

_bob = "FML_HP3_slow_Zombie10" createunit [getpos die1,jas,"BOBs=this"]

~.5

_bob addEventHandler ["hit",{_this exec "script.sqs"}]

goTo "loop"

That will fail.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

#loop

"FML_HP3_slow_Zombie10" createunit [getpos die1,jas,"BOBs=this"]

~.5

BOBs addEventHandler ["Killed",{(_this select 0) exec "zkilled.sqs"}]

goTo "loop"

Share this post


Link to post
Share on other sites
hi, look here:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

#loop

_bob = "FML_HP3_slow_Zombie10" createunit [getpos die1,jas,"BOBs=this"]

~.5

_bob addEventHandler ["hit",{_this exec "script.sqs"}]

goTo "loop"

That will fail.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

#loop

"FML_HP3_slow_Zombie10" createunit [getpos die1,jas,"BOBs=this"]

~.5

BOBs addEventHandler ["Killed",{(_this select 0) exec "zkilled.sqs"}]

goTo "loop"

okay.. this partially works, when i do it, basically i have a script which gives the player 25$

_victim = _this select 0

_killer = _this select 1

?(_killer == w1):w1money = w1money + 25

?(_killer == w2):w2money = w2money + 25

?(_killer == w3):w3money = w3money + 25

?(_killer == w4):w4money = w4money + 25

But now it is giving me an error about the killer. where it expects array and i give object or something like that...

help.gif

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×