meanbeandk Posted April 30, 2015 Report Share Posted April 30, 2015 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. Link to comment Share on other sites More sharing options...
0 Halvhjearne Posted April 30, 2015 Report Share Posted April 30, 2015 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 ... SchwEde 1 Link to comment Share on other sites More sharing options...
0 SchwEde Posted April 30, 2015 Report Share Posted April 30, 2015 maybe checking for bad names? BEC has a function for that. I don't get a real reason to check for the name either. The UID is the best to use to check for specific players. Link to comment Share on other sites More sharing options...
0 Guest Posted April 30, 2015 Report Share Posted April 30, 2015 _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 More sharing options...
0 Halvhjearne Posted April 30, 2015 Report Share Posted April 30, 2015 if (typeName _x == "SCALAR") then { this is why you put the uids into a string first, rofl not to mention you cannot compare 2 arrays ... Link to comment Share on other sites More sharing options...
0 Guest Posted April 30, 2015 Report Share Posted April 30, 2015 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 More sharing options...
0 meanbeandk Posted April 30, 2015 Author Report Share Posted April 30, 2015 I just wanted to have a player name where ill have my admin tool and one whitout admin tool Link to comment Share on other sites More sharing options...
0 Halvhjearne Posted April 30, 2015 Report Share Posted April 30, 2015 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 More sharing options...
0 Ssgt. Raptor Man Posted December 24, 2016 Report Share Posted December 24, 2016 i need it for application wheres my UID? Link to comment Share on other sites More sharing options...
Question
meanbeandk
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.
Link to comment
Share on other sites
8 answers to this question
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now