Jump to content
Sign in to follow this  
jonastheundead

Code error in editor

Recommended Posts

Hello.

I have downloaded a script that lets you respawn with the gear that you had when you died.Unfortunately, when i try to type this: player execVM "Save_gear_when_respawned.sqf into the INI line in editor, a text pops out saying:Type Script,expected nothing.I have putted an .sqf file into my MPmissions folder containing this:

#start

@ (! alive player)

_weapons = weapons player

_magazines = magazines player;

@ (alive player)

removeallweapons player;

{player addMagazine _x} foreach _magazines;

{player addWeapon _x} foreach _weapons;

goto "start"

Someone help :help:

Share this post


Link to post
Share on other sites

The script you have there is in sqs format. You need to save it as sqs and call it with:

[] exec "Save_gear_when_respawned.sqs";

Alternatively you use below sqf code and call it with

nul=[] execVM "Save_gear_when_respawned.sqf";

Save_gear_when_respawned.sqf

while {true} do 
{
 waitUntil {(!alive player)};
 _weapons = weapons player;
 _magazines = magazines player;
 waitUntil {(alive player)};
 removeallweapons player;
 {player addMagazine _x} forEach _magazines;
 {player addWeapon _x} forEach _weapons;
};

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  

×