Jump to content
Sign in to follow this  
Faique

what I need in my .sqf script?

Recommended Posts

Hi guys

Just a question regarding an .sqf script.

All I want it to do is this... _this removemagazines "ACE_Bandage"; from the player. So when the player preforms an action the item is removed.

I have the execution line all good in the apropriate init file but I just can't get my head around what I need to write in the .sqf file.

Appreciate any help.

Thanks

Share this post


Link to post
Share on other sites

Hi mate ,

Seeing I know what you're trying to achieve probably easiest for me to respond.

In the revive_init.sqf put

NORRNCustomExec1 ="[_reviver] execVM 'RemoveBandage.sqf'";

Then create a script in the root mission directory called RemoveBandage.sqf and in the script put

_reviver = _this select 0;

_reviver setVehicleInit "if (local this) then {this removeMagazine 'ACE_Bandage'}";
processInitCommands;

Quick explanation as to why I've used setVehicleInit is that the removeMagazine command, according to the BIKI, only works locally - as we want to remove the bandage from another player on the server we must send the code across the network so it runs locally on the machine where the reviver exists. NB: Untested so good luck

Share this post


Link to post
Share on other sites

Norrin your a legend, thanks alot. I will let you know how it goes.

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  

×