Results 1 to 5 of 5

Thread: onPlayerDisconnected and getPlayerUID

  1. #1

    onPlayerDisconnected and getPlayerUID

    Hi everyone.

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

    Code:
    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.

    Code:
    _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.
    Last edited by MAD T; Feb 20 2011 at 11:36.

  2. #2
    Quote Originally Posted by MAD T View Post
    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:
    Code:
    onPlayerDisconnected "[_id, _name, _uid] execVM 'PlayerDisconnected.sqf';";

  3. #3
    Lance Corporal
    Join Date
    Mar 3 2010
    Location
    Germany
    Posts
    53
    Author of the Thread
    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

    I was just confused about the value it gave me because my ID is 7 numbers long. Thanks for your help anyway.
    Last edited by MAD T; Feb 20 2011 at 12:00.

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

  5. #5
    Lance Corporal
    Join Date
    Mar 3 2010
    Location
    Germany
    Posts
    53
    Author of the Thread
    Thanks mate, you helped me alot.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •