hello dear otlanders
hope someone can help me to create a simple script
how to give tibia coins on Account Creation?
$number_of_points = 10;
$reg_account->set('premium_points', ($reg_account->getCustomField('premium_points')+$number_of_points));
local number_of_points = 10
if player:getStorageValue(9999) < 1 then
db.query("UPDATE accounts SET premium_points = premium_points+"..(number_of_points).." WHERE id IN (SELECT account_id FROM players WHERE id='"..(player:getGuid()).."');")
player:setStorageValue(9999, 1)
end
giving it onlogin using player storage the user can just create 50 char and delete them in order to take as many coin as they want to
you actually just need account storage, since I don't think coins are transferable in TFS right now:Giving it on anywhere the user can just create many accounts/characters to take as many coin they want lol.
To control it and give only once to the user, you would have to have a kind of intelligent system or you can manually give players some code and create a talkaction script so they can execute and receive the points.
Bt you can just use the example above, to give when user create his account on webpage.
you actually just need account storage, since I don't think coins are transferable in TFS right now:
![]()
[TFS 1.x] player:getAccountStorageValue | player:setAccountStorageValue
SQL Query: CREATE TABLE `account_storage` ( `account_id` INTEGER(4), `key` INTEGER(10), `value` INTEGER(10) ) data/lib/core/player.lua: function Player.getAccountStorageValue(self, key) if type(key) ~= "number" then return false end local query = db.storeQuery("SELECT...otland.net
im using myaac right nowBased on which platform? Example of gesior acc, after this line in createaccount and before $reg_account->save(); :
PHP:$number_of_points = 10; $reg_account->set('premium_points', ($reg_account->getCustomField('premium_points')+$number_of_points));
If you want give it on player login:
Code:local number_of_points = 10 if player:getStorageValue(9999) < 1 then db.query("UPDATE accounts SET premium_points = premium_points+"..(number_of_points).." WHERE id IN (SELECT account_id FROM players WHERE id='"..(player:getGuid()).."');") player:setStorageValue(9999, 1) end
try it