• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved Check account id

Exoltes

Novia OTserv Developer
Joined
Jul 2, 2009
Messages
563
Reaction score
47
Location
Belgium
I'm working on a 8.54 Open Tibia Server using The Forgotten Server - Version 0.2.7 (Mystic Spirit).

I want to make a script that depending on your account teleports you to a different location. So I'm looking for a way to check your account number ingame with a lua script.

If this doesn't excist I'm open to suggestions on how let teleport each character of the same account to the same location after using an item but when the account is different the location needs to be different. Adding all character names seems impossible because I don't feel like blocking off people from making new characters.

Any advice is welcome.
Thanks in advance.
 
Not sure if it is reachable through normal methods. You can storage the Account value on a storageValue if you are creating your characters through a website, then check the storagevalue to get the account of each character.

Other thing you can try (i dont know if that would work) is to form a query on the lua script to reach the database. I think this havent used so probably wont work.
 
You can always check your playerinfo.lua in talkactions.
I have getPlayerAccount(pid) in one of my 8.54
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)  
    if item.actionid == 30110 and getAccountNumberByPlayerName(Test) == "1" then
            doTeleportThing(cid,{x = 1302, y = 1073, z = 7})
    elseif item.actionid == 30110 then
              doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Please contact the admin to configurate your home.")
        else
            doTeleportThing(cid,{x = 1058, y = 992, z = 6})

end
    return TRUE
end

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)  
    if item.actionid == 30110 and getAccountNumberByPlayerName(getPlayerName(cid)) == "1" then
            doTeleportThing(cid,{x = 1302, y = 1073, z = 7})
    elseif item.actionid == 30110 then
              doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Please contact the admin to configurate your home.")
        else
            doTeleportThing(cid,{x = 1058, y = 992, z = 6})

end
    return TRUE
end

Both don't seem to work so I hope I'm doing something wrong :D Tested it with character named: 'Test' and on account with account number '1'.
 
Back
Top Bottom