+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: [E2] Get a player id

  1. #1
    Wirererer warrior08's Avatar
    Join Date
    Feb 2009
    Posts
    218

    Default [E2] Get a player id

    Hello,

    is possible get a player id whit expression 2 ?

    Example:

    One player is target by a target-Finder


    E2 show the player Id on the screen

    or

    im say in chat PlayerName

    and E2 give me player id


    Thanks for help

  2. #2
    Developer Matte's Avatar
    Join Date
    Jan 2009
    Location
    Norway
    Posts
    3,109

    Default Re: [E2] Get a player id

    Don't know if you meant Nick, UniqueID or SteamID, but here goes:

    To get a players SteamID, we use Ply:steamID()
    To get a players UniqueID, we use Ply:id()
    To get a players Nick, we use Ply:name()

    Now try make something yourself, and we will correct the code if you get errors.
    "If anybody says he can think about quantum physics without getting giddy, that only shows he has not understood the first thing about them."
    -- Niels Bohr

  3. #3
    Wirererer warrior08's Avatar
    Join Date
    Feb 2009
    Posts
    218

    Default Re: [E2] Get a player id

    its not this
    Last edited by warrior08; 07-06-2009 at 11:46 AM.

  4. #4
    Wire Amateur no_one's Avatar
    Join Date
    Mar 2009
    Posts
    88

    Default Re: [E2] Get a player id

    What is UniqueID? Is that like one's player number on the server? Does it stay the same throughout different play sessions like SteamID?
    New to Expression 2? Read this: E2 Guide [WIP]
    Steam ID ► Easton741
    Connect Now!

  5. #5
    Developer Matte's Avatar
    Join Date
    Jan 2009
    Location
    Norway
    Posts
    3,109

    Default Re: [E2] Get a player id

    In my last post, talking about uniqueID, I meant E:id(), which gives you the numeric ID of an entity. It does not stay the same. It's based off which order entities are spawned, I guess.
    "If anybody says he can think about quantum physics without getting giddy, that only shows he has not understood the first thing about them."
    -- Niels Bohr

  6. #6
    Wirererer warrior08's Avatar
    Join Date
    Feb 2009
    Posts
    218

    Default Re: [E2] Get a player id

    Ah no sorry im nedded this


    # ((((7)))) "Playername" STEAM_0:1:00078900 00:32 120 2 active


    im nedded (7) player id

  7. #7
    Wirererer warrior08's Avatar
    Join Date
    Feb 2009
    Posts
    218

    Default Re: [E2] Get a player id

    Help me! .

  8. #8
    Expressionism 2.0 Syranide's Avatar
    Join Date
    Mar 2007
    Location
    Sweden
    Posts
    4,573

    Default Re: [E2] Get a player id

    Quote Originally Posted by warrior08 View Post
    Ah no sorry im nedded this


    # ((((7)))) "Playername" STEAM_0:1:00078900 00:32 120 2 active


    im nedded (7) player id
    That's probably not possible unless it is what :id() returns, which I seriously doubt.

  9. #9
    Wire Sofaking ahref's Avatar
    Join Date
    Jul 2008
    Posts
    520

    Default Re: [E2] Get a player id

    you dont need this. use their name steam id or entity id
    A-Z Materials - Released!!!!!!!

  10. #10
    Developer Matte's Avatar
    Join Date
    Jan 2009
    Location
    Norway
    Posts
    3,109

    Default Re: [E2] Get a player id

    Quote Originally Posted by Syranide View Post
    That's probably not possible unless it is what :id() returns, which I seriously doubt.
    Why shouldn't it be possible? :huh:

    I made a function which works.

    The Lua function Player.UserID() returns the ID you want. The ID which is increased by one for each player who joins. This E2 function returns that ID. If the entity is not a player, it returns 0.

    E:userID()

    Code:
    e2function number entity:userID()
    	if !this:IsPlayer() then return 0 end
    	return this:UserID()
    end
    "If anybody says he can think about quantum physics without getting giddy, that only shows he has not understood the first thing about them."
    -- Niels Bohr

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Audio Player
    By Bake in forum Finished contraptions
    Replies: 11
    Last Post: 08-06-2009, 05:02 PM
  2. Player Info Help E2 (+ CPU?)
    By grandpapolly in forum Installation and Malfunctions Support
    Replies: 88
    Last Post: 05-25-2009, 12:29 PM
  3. How to detect player name
    By kronix904 in forum Installation and Malfunctions Support
    Replies: 12
    Last Post: 04-17-2009, 11:35 AM
  4. Player Finder
    By bloodyshadow13 in forum Ideas & Suggestions
    Replies: 4
    Last Post: 08-01-2007, 07:01 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots