Home   Help Search Login Register  

Author Topic: isPlayer  (Read 1439 times)

0 Members and 1 Guest are viewing this topic.

Offline Rommel92

  • Members
  • *
isPlayer
« on: 28 Apr 2008, 21:33:51 »
Code: [Select]
If (isPlayer) exitWith {};
Missing ;

 :dunno:
Clearly the command is wrong, as I was just screwing around with it I just replaced with:
Code: [Select]
If !(isNull player) exitWith {};
But why the error?

Offline myke13021

  • Contributing Member
  • **
  • Myke
Re: isPlayer
« Reply #1 on: 28 Apr 2008, 21:37:42 »
Wrong use of the command.
Quote
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:
Quote
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.

Offline Rommel92

  • Members
  • *
Re: isPlayer
« Reply #2 on: 28 Apr 2008, 21:42:29 »
Ah k, yeh should've read the Biki first, was just reading into another thread, in which Mr Peanut posted:
Code: [Select]
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

Offline Loyalguard

  • Former Staff
  • ****
Re: isPlayer
« Reply #3 on: 28 Apr 2008, 22:32:35 »
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.

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: isPlayer
« Reply #4 on: 12 May 2008, 17:05:47 »
Damn. Another screwup by yours truly! I have added a warning to that original thread not to use the snippet.
urp!