Jump to content
Sign in to follow this  
FelixK44

addAction Reward from kills/killstreak?

Recommended Posts

Ok... So I have a question is it possible to create a trigger that tracks progress of each player so they get an addaction reward from kills?

So like maybe after 5 or 10 kills it would reward that player with Air Support...and would then remove the action after the plane is called in then blocks that player from calling another for 5-10minutes.......:confused:

addAction "airSup\addMenu.sqf"

Share this post


Link to post
Share on other sites

If anyone has an example please let us know how to do the same but kills are counted for side (west/blufor for example) and player named "westco" gets that addaction.

Share this post


Link to post
Share on other sites

Had thoughts of Quake-II and booming voice saying "Impressive..." :D

But to your question, a trigger would work as long as you used a global variable to act as a locking mechanism. You could also use a FSM for this.

Share this post


Link to post
Share on other sites
Had thoughts of Quake-II and booming voice saying "Impressive..." :D

But to your question, a trigger would work as long as you used a global variable to act as a locking mechanism. You could also use a FSM for this.

Hrmm.... would you have any example how it would work because I have NO scripting knowledge at all and I think there's a few people out there who would like this script... ;)

Share this post


Link to post
Share on other sites

i guess this can be done by using publicvariable and addPublicVariableEventHandler

eventhandler killed is fired on the person that dies. so you could do something like.

you put the killer in the publicvariable, "on the person that was killed"

he then send this over the network. where the addPublicVariableEventHandler is fired on all clients.

here you can check if its your name in there, if it is, add 1 to a global counter each time its fired.

just an idea. not tested

Share this post


Link to post
Share on other sites
this addEventHandler ["killed", "hint format['Killed by %1',_this select 1]"]

Share this post


Link to post
Share on other sites

Hrm.... I just thought of a really old mission that had some kind of addcash per kill gunna try and find it and post the init.........

---------- Post added at 01:17 PM ---------- Previous post was at 01:04 PM ----------

does this give anyone ideas on how it might work?(not the cash part but tracking kills) :/ NOTE: this is from a really old ArmA 1 mission :P

addEventHandler ["killed", { _Killer = _this select 1; _id=([man1,man2,man3,man4,man5,man6,man7,man8,man9,man10,man11,man12,man13,man14,man15,man16,man17,man18,man19,man20] find gunner _Killer)+1; if(_id>0)then{["banditdeathevent", _id] call SPON_publishGlobalEvent;}}];

call SPON_addEventHandler;

//

["banditdeathevent",

{

_id=_this;

if (player == (call compile format["man%1",_id])) then

{

SPON_playerCashBalance = SPON_playerCashBalance + 7500;

player groupchat format ["You have eliminated a wanted bandit! $7500 reward. $%1 total in pocket cash",SPON_playerCashBalance,basereward];

};

}

Share this post


Link to post
Share on other sites

I'd just keep track of kills and killers on server with killed EH. Then based on those numbers pubvar (+PVEH on clients) something to enable the actions (using the addaction condition parameter).

Share this post


Link to post
Share on other sites
If anyone has an example please let us know how to do the same but kills are counted for side (west/blufor for example) and player named "westco" gets that addaction.

I'd have a problem broadcasting a message over the network each time a unit gets killed. Ok, since the message consists of only an integer value I don't know if my concerns are reasonable.

Anyway, my approach would be to create a repeated trigger covering the whole map, set it to BLUFOR activation,

condition:

if(isNil "westcount") then{westcount = count thislist}; westcount > count thislist

activation:

if(isNil "reward") then{reward=0}; reward = reward + (westcount - count thislist); westcount = count thislist

And the condition for the action to be available uses the value stored in the variable 'reward'.

Didn't test it, also don't know if it leads into performance loss, however, safes you some network traffic.

Share this post


Link to post
Share on other sites

Does anyone have a script/trigger with example of adding the addeventkilled globally to a side? which activates an .sqf for the player who killed that unit/side?

Example:

Player 1 kills X # of enemy units that is required to enable an action from .sqf file?

---------- Post added at 02:20 PM ---------- Previous post was at 02:17 PM ----------

I'd have a problem broadcasting a message over the network each time a unit gets killed. Ok, since the message consists of only an integer value I don't know if my concerns are reasonable.

Anyway, my approach would be to create a repeated trigger covering the whole map, set it to BLUFOR activation,

condition:

if(isNil "westcount") then{westcount = count thislist}; westcount > count thislist

activation:

if(isNil "reward") then{reward=0}; reward = reward + (westcount - count thislist); westcount = count thislist

And the condition for the action to be available uses the value stored in the variable 'reward'.

Didn't test it, also don't know if it leads into performance loss, however, safes you some network traffic.

So....

if(isNil "reward") then{reward=0}; reward = reward + (westcount - count thislist); westcount = count thislist

could be this ?

if(isNil "player addAction ["Test", "Test.sqs"]") then{reward=0}; reward = reward + (westcount - count thislist); westcount = count thislist

Edited by FelixK44

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  

×