Jump to content

Photo
- - - - -

onPlayerDisconnected and getPlayerUID


  • Please log in to reply
4 replies to this topic
Thread Starter
MAD T
MAD T

    Corporal

  • Members
  • 63 posts

#1

Posted 20 February 2011 - 11:33

Hi everyone.

I have a question about onPlayerDisconnected. When i use it like this,

onPlayerDisconnected "[_id, _name, _uid] execVM "PlayerDisconnected.sqf";

_uid always gives me a number like 1.4253e+006 which is actualy the player ID but just with some zeros added to the end. I know from the wiki page that the value is returned in a float format.

_uid = getPlayerUID vehicle player;


getPlayerUID Gives me the player ID in a correct format like 942107.

For example if i want to compare these both values how do i get the one from onPlayerDisconnected in a correct format? Other question. What purpose or use does the float value has? Any help is much appreciated on this.

Edited by MAD T, 20 February 2011 - 11:36.


Bon
Bon

    Gunnery Sergeant

  • Members
  • 556 posts

#2

Posted 20 February 2011 - 11:46

I know from the wiki page that the value is returned in a float format.

I would like to know to what wiki you are referencing here. _uid in onplayerdisconnected returns the same value as getplayeruid does, your problem is something else.
Be advised, if this is all the code you use regarding to onplayerdisconnected, you messed with the quotes:
onPlayerDisconnected [COLOR="Blue"]"[/COLOR][_id, _name, _uid] execVM [COLOR="Red"]'[/COLOR]PlayerDisconnected.sqf[COLOR="Red"]'[/COLOR];[COLOR="Blue"]"[/COLOR];


Thread Starter
MAD T
MAD T

    Corporal

  • Members
  • 63 posts

#3

Posted 20 February 2011 - 11:57

Im sry i misread something on the wiki. Your right it gives me the correct ID in a number value and getPlayerUID gives me a string. My question should be rather how do i convert numbers to a string :o

I was just confused about the value it gave me because my ID is 7 numbers long. Thanks for your help anyway.

Edited by MAD T, 20 February 2011 - 12:00.


Bon
Bon

    Gunnery Sergeant

  • Members
  • 556 posts

#4

Posted 20 February 2011 - 12:00

Alright you can either parse a string for a number using parseNumber or you can convert anything to a string using str or format.

Thread Starter
MAD T
MAD T

    Corporal

  • Members
  • 63 posts

#5

Posted 20 February 2011 - 12:19

Thanks mate, you helped me alot.