Jump to content
  • 0

get player id and name ?


meanbeandk

Question

8 answers to this question

Recommended Posts

  • 0

i want to execute a script for a specific player name and specific id.

 

have used this 

  ((getPlayerUID player) in ["*********************"]

 

but i wont to be sure that the player id and name match.

 

not sure why you would want the name to match aswell, as a player can change it and then the script wont run ... also it is very unreliable and will often fail cause of case sensitive

 

but you can get players name with:

name player

could be used like this to check players name and run some code:

if(name player == "blabla")then{
//block of code here
};

or check if name is in an array:

if(name player in ["blabla","blabla2"])then{
//block of code here
};

using it with toLower can sometimes help, but still not fail proof ...

Link to comment
Share on other sites

  • 0

_list = [213123,"Martin",456456,"is",789789,"hungry"];
_uid = getPlayerUID player;
_name = name player;


{
	if (typeName _x == "SCALAR") then {
		_check = _x == _uid && (_list select (_forEachIndex+1) == _name;
	};

} forEach _list;

//Returns True, if uid and Name Match, otherwise returns false. 

You searching for something like that?

OR:

 

_list = [[123,"Martin"]];
_uid = getPlayerUID player;
_name = name player;
_arr = [];
_arr = [_uid,_name];

{
	if (_x == _arr) then {
		//Is True
	};
} count _list;
Link to comment
Share on other sites

  • 0

this is why you put the uids into a string first, rofl

 

Just in case you don't know, what a Question Mark is there for: It indicates, that the sentence before the Question Mark is supposed to be Question, which in return means, that you are asking something. Now A solution is not a question, but i posted a Question. Can you follow?

 

I'm watching you a while now and you always criticize everything, but mostly your codes are not 100% perfect either, so mate how about you try saying it nicer when something is wrong or just leave it, because you are just annoying as hell.

 

Sorry, had to say that...

Link to comment
Share on other sites

  • 0

Just in case you don't know, what a Question Mark is there for: It indicates, that the sentence before the Question Mark is supposed to me Question, which in return means, that you are asking something. Now A solution is not a question, but i posted a Question. Can you follow?

 

im laughing becourse you are checking for something irrelevant, when you could just put the uids into string to begin with and avoid that chekc all togehter ...

 

I'm watching you a while now

 

i know im good looking, but im just not into youy that way martin ... sorry

 

but mostly your codes are not 100% perfect either

 

when did i ever say it was?

 

because you are just annoying as hell.

 

tbh i dont really care who i annoy, ill do my thing the way i see fit ...

 

Sorry, had to say that...

 

dont be sorry that you speak your oppinion about me being a douche, cause i propperbly am sometimes, but i usually do not mean it in a bad way.

 

however you are always waving your arms like you can do everything, so i think its super funny to pick it apart ... ill try not to, if you feel offended ... lol

 

 

I just wanted to have a player name where ill have my admin tool and one whitout admin tool

 
you do not need it in the array for that, just get it at some other point ... if you want to save a special name associated with the uid, the best way would be to do two arrays or something i guess.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...