Jump to content
Sign in to follow this  
NTULINUX

How to tell init.sqf to only affect all human players?

Recommended Posts

Hello everyone. I was wondering, how do I have the init.sqf file affect human players only within a mission on an online server? I do not want init.sqf to have any affect on AI players. For example:

//init.sqf
setViewDistance 3000;
//EOF

Would it be something like this?

//init.sqf
waitUntil {!isNil { player }}
waitUntil {!isNull player }
waitUntil {(player == player)}
setViewDistance 2500;
//EOF

Thanks!

Share this post


Link to post
Share on other sites
{
if (isPlayer _x) then {
_x setViewDistance 3000;
};
} forEach allUnits;

Share this post


Link to post
Share on other sites

Since when is the init.sqf executed for non human players? Did I miss something?

I mean I'm a rather new ArmA2 guy and all but I had the firm conviction that the init.sqf is executed upon human players when connection into your map.

All you do in your init.sqf using the "player" keyword will only affect human players, so you don't (and moreover can't) have to discern between human players and AI.

Since I'm really confused here, can someone clarify this with more details? :D

Share this post


Link to post
Share on other sites
{
if (isPlayer _x) then {
_x setViewDistance 3000;
};
} forEach allUnits;

Maybe you should check wiki for the command syntax before giving people advice.

http://community.bistudio.com/wiki/setViewDistance

Since when is the init.sqf executed for non human players? Did I miss something?

I mean I'm a rather new ArmA2 guy and all but I had the firm conviction that the init.sqf is executed upon human players when connection into your map.

All you do in your init.sqf using the "player" keyword will only affect human players, so you don't (and moreover can't) have to discern between human players and AI.

Since I'm really confused here, can someone clarify this with more details? :D

You're right, makes no sense for viewdistance.

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  

×