tosfera Posted February 19, 2013 Share Posted February 19, 2013 hey hey, I'm trying to get the player from a serial. its kinda hard to explain... I got a serial, and with that serial I want to get user information. like the name of the player! how can I recover the name of the player by just having the serial? O_O Thanks in advance! Link to comment
PaiN^ Posted February 19, 2013 Share Posted February 19, 2013 Here !! if igot you right Link to comment
tosfera Posted February 19, 2013 Author Share Posted February 19, 2013 Ehh wel I'm more searching for an function that gets the playername by a serial. And if I need to download that crappy source, and search for it... its going to take a while. Link to comment
Fury Posted February 20, 2013 Share Posted February 20, 2013 Ehh wel I'm more searching for an function that gets the playername by a serial. And if I need to download that crappy source, and search for it... its going to take a while. there is a /whois and /whowas command in admin resource. i think u can make it what you want by editing admin resource. Link to comment
tosfera Posted February 20, 2013 Author Share Posted February 20, 2013 Ehh wel I'm more searching for an function that gets the playername by a serial. And if I need to download that crappy source, and search for it... its going to take a while. there is a /whois and /whowas command in admin resource. i think u can make it what you want by editing admin resource. yes, thats a good example! now I can finally say what I'm trying to do!! I want the command /whois to work with a serial, like; /whois if that isn't possible I might save it with the players account. edit: started thinking about it when I was downstairs, it gets saved by the players serial, time to find out where its hiding! edit2: Ill do the alternative thing I had in mind, cause this isn't working out. its hidding somewhere I can't find and its just for 1 single thing, aint that much of a big deal. Link to comment
Fury Posted February 20, 2013 Share Posted February 20, 2013 (edited) Ehh wel I'm more searching for an function that gets the playername by a serial. And if I need to download that crappy source, and search for it... its going to take a while. there is a /whois and /whowas command in admin resource. i think u can make it what you want by editing admin resource. yes, thats a good example! now I can finally say what I'm trying to do!! I want the command /whois to work with a serial, like; /whois if that isn't possible I might save it with the players account. edit: started thinking about it when I was downstairs, it gets saved by the players serial, time to find out where its hiding! it is possible i think. another way example; getPlayerSerial() getPlayerName() getAccount() setAccountData() getAccounts() getAccountData() addCommandHandler() or easy way you can edit the function in admin resource. Edited February 20, 2013 by Guest Link to comment
tosfera Posted February 20, 2013 Author Share Posted February 20, 2013 or easy way you can edit the function in admin resource. Thats the point, it isn't in the admin resource Link to comment
Fury Posted February 20, 2013 Share Posted February 20, 2013 or easy way you can edit the function in admin resource. Thats the point, it isn't in the admin resource hmm i checked the wiki. seems like its a server command; https://wiki.multitheftauto.com/wiki/Ser ... ands#whois Link to comment
tosfera Posted February 20, 2013 Author Share Posted February 20, 2013 or easy way you can edit the function in admin resource. Thats the point, it isn't in the admin resource hmm i checked the wiki. seems like its a server command; https://wiki.multitheftauto.com/wiki/Ser ... ands#whois noticed that too, I did the same reseach Link to comment
Guest Guest4401 Posted February 20, 2013 Share Posted February 20, 2013 addEventHandler('onPlayerLogin', root, function(_,acc) setAccountData(acc,'serial',getPlayerSerial(source)) setAccountData(acc,'playername',getPlayerName(source)) end ) function getPlayerFromSerial(serial) if serial then for i,v in ipairs(getAccounts()) do if getAccountData(v,'serial') == serial then return getAccountData(v,'playername') end end end return false end Link to comment
tosfera Posted February 20, 2013 Author Share Posted February 20, 2013 addEventHandler('onPlayerLogin', root, function(_,acc) setAccountData(acc,'serial',getPlayerSerial(source)) setAccountData(acc,'playername',getPlayerName(source)) end ) function getPlayerFromSerial(serial) if serial then for i,v in ipairs(getAccounts()) do if getAccountData(v,'serial') == serial then return getAccountData(v,'playername') end end end return false end already solved it. Still thanks! n_n Haven't thought about that Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now