Jump to content

get the playername from serial


tosfera

Recommended Posts

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. xD

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
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. xD

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 xD and its just for 1 single thing, aint that much of a big deal.

Link to comment
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. xD

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 by Guest
Link to comment
Guest Guest4401
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
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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...