OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting Multiplayer => Topic started by: Rommel92 on 28 Apr 2008, 21:33:51
-
If (isPlayer) exitWith {};
Missing ;
:dunno:
Clearly the command is wrong, as I was just screwing around with it I just replaced with:
If !(isNull player) exitWith {};
But why the error?
-
Wrong use of the command.
Description:
Check if given person is a human player.
Syntax
Syntax:
isPlayer Object
Parameters:
Object
Return Value:
Boolean
You didn't passed an Object which could be checked.
Also check this:
This is not the same as testing object == player, because in MP it tests for any player, not only for the local one. If object is a vehicle, the test is done for the vehicle commander.
-
Ah k, yeh should've read the Biki first, was just reading into another thread, in which Mr Peanut posted:
if isServer then {onPlayerConnected "publicVariable ""startPos""";};
if isPlayer then {nil = [] execVM "setPlayerStart.sqf";};
And no one seemed to mention anything about it being dud... so... maybe theres an exception here, or no one noticed... :P
-
isPlayer checks to see if the unit is a human (true) or AI (false). It is not used to validate who the player is or compare it to other players.
-
Damn. Another screwup by yours truly! I have added a warning to that original thread not to use the snippet.