Author Topic: Function for finding BL_ID  (Read 1876 times)

So I know syntax, I know how to make GUIs, and I know how add-ons are structured.  There's something I don't know:
What is the function for finding a player's BL_ID? You should ideally enter in a player name and it stuffs out the ID in a text field below

Here's a general outline of what I want to do:

You have a text input box and a button for submitting its input
Upon clicking the button, it checks for input
If there's input, it moves on to using the input
If there's no input, it stops
It compares the input (ideally a player name) while being case-insensitive with a list of people who are currently on the server
If it matches up, get the player ID from the player the name matches then tell it to the text field below the button
The text field says, "$playerName's BL_ID is $BL_ID"

I'm asking for that because I need to know this so that
"It compares the input (ideally a player name) while being case-insensitive with a list of people who are currently on the server"
does findClientByName with getField then
uses whatever function exists to grab a BL_ID so that
"If it matches up, get the player ID from the player the name matches then tell it to the text field below the button"
can happen and it tells the text field (probably through defining variables such as $playerName and $BL_ID)
so that the text field displays the variables' results and tells you the ID of the name


something like findClientByName(%name).getBLID() or findClientByName(%name).bl_id
to find other methods you can use on an object (like the client/player), use .dump();

Just dropping in to say: stop locking all your damn help topics here.

There is no good reason to forcefully halt discussion in them and several good reasons not to. Even when you think your problem is solved, you may be wrong. In one of your earlier threads, I was going to provide you with some advice, only to find when I hit post that the thread was locked with a "nvm solved it" that will help absolutely nobody who have a similar issue who find that thread in the future. On top of that, later the thread was unlocked because you realized you were wrong, but my response was already lost. Even more, people may chime in to correct an inaccurate answer someone else posted, or ask further questions on the same subject, or provide a solution for future reference when the OP fails to indicate what solved their problem, or yell at someone for bad coding help etiquette.

It's not helpful to anyone and can be harmful to the board. Don't do it.
« Last Edit: March 24, 2017, 10:36:14 AM by -Jetz- »

Just dropping in to say: stop locking all your damn help topics here.

There is no good reason to forcefully halt discussion in them and several good reasons not to. Even when you think your problem is solved, you may be wrong. In one of your earlier threads, I was going to provide you with some advice, only to find when I hit post that the thread was locked with a "nvm solved it" that will help absolutely nobody who have a similar issue who find that thread in the future. On top of that, later the thread was unlocked because you realized you were wrong, but my response was already lost. Even more, people may chime in to correct an inaccurate answer someone else posted, or ask further questions on the same subject, or provide a solution for future reference when the OP fails to indicate what solved their problem, or yell at someone for bad coding help etiquette.

It's not helpful to anyone and can be harmful to the board. Don't do it.

Okay.  I will stop locking them.  Thank you for the advice.

something like findClientByName(%name).getBLID() or findClientByName(%name).bl_id
to find other methods you can use on an object (like the client/player), use .dump();

Is it really just .getBLID(); that has to be added? I'm asking for specifics.

The problem with findClientByName and GUIs is that findClientByName is a server sided function and GUIs are a client sided thing.

Is this supposed to be client-sided or server sided? Because if it's server-sided, used only by the host of the server, then that'll work just fine. But if it's client-sided then it's more tricky, because you'll only be able to get the BLID's of people currently in the server and such, and there's also a much different method of actually getting said BLID's as well.

not sure how the client gets the BLIDs, but it shows in the player list
could investigate there to see how it gets the IDs, or use the player list as the source for your IDs/names

(if you're going to be the host, just use %client.bl_id)

not sure how the client gets the BLIDs, but it shows in the player list
could investigate there to see how it gets the IDs, or use the player list as the source for your IDs/names

(if you're going to be the host, just use %client.bl_id)
it doesnt get the blids it gets it sent by the server every time somebody joins
if you want to get somebodys blid that's on (assuming the server host isnt messing with it) you'll want to dump the rows of lstAdminPlayerList or NewPlayerListGui

it doesnt get the blids it gets it sent by the server every time somebody joins
if you want to get somebodys blid that's on (assuming the server host isnt messing with it) you'll want to dump the rows of lstAdminPlayerList or NewPlayerListGui

oops also in a secureClientCmd, you aren't gonna be able to overwrite that :(

You can package it.
Code: [Select]
function secureClientCmd_ClientJoin(%nn, %cid, %id, %v1, %v2, %v3, %v4)
{
%nn being net name, %cid being client object ID, %id being the BL ID, rest is stuff like score, trust, admin, minigame. Didn't feel like figuring out which was which.

It gets called for every client when you first join, as well as for every client that joins after you.

You can package it.
Code: [Select]
function secureClientCmd_ClientJoin(%nn, %cid, %id, %v1, %v2, %v3, %v4)
{
%nn being net name, %cid being client object ID, %id being the BL ID, rest is stuff like score, trust, admin, minigame. Didn't feel like figuring out which was which.

It gets called for every client when you first join, as well as for every client that joins after you.
Quote
function secureClientCmd_ClientJoin(%clientName, %clientId, %bl_id, %score, %isAI, %isAdmin, %isSuperAdmin, %trust, %inYourMiniGame)

Is this supposed to be client-sided or server sided? Because if it's server-sided, used only by the host of the server, then that'll work just fine. But if it's client-sided then it's more tricky, because you'll only be able to get the BLID's of people currently in the server and such, and there's also a much different method of actually getting said BLID's as well.

Client, but

everyone else has answered it.