• 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!

auto reward

Good Samaritan

New Member
Joined
Sep 9, 2015
Messages
19
Reaction score
0
Location
Idaho
Looking for a solid script that rewards a player money and premium points at a certain level. Can only work once per account. using tfs 0.4
 
Follow these steps.. https://otland.net/threads/how-to-set-a-account-storage.30205/
Then you can just use the formula provided.
Code:
setAccountStorageValue(accid, key, value)
getAccountStorageValue(accid, key)

(Place this into whichever spot you wish.. Login / onUse (a chest for example.)
Using storage '45001' as an example.

Code:
function onLogin(cid)
    if getAccountStorageValue(getPlayerAccountId(cid), 45001) < 1 then
        -- give items
        -- give premium points
        setAccountStorageValue(getPlayerAccountId(cid), 45001, 1)
    end
    return true
end
 
You use it like any regular storage value.

So in my example I used storage 45001.
You can use any storage value though.

You can view more about storage values here , or a more refined description here.

As for the level requirement, you can simply add an additional parameter check.

Code:
function onLogin(cid)
    if getAccountStorageValue(getPlayerAccountId(cid), 45001) < 1 then
        if getPlayerLevel(cid) >= 100 then
            -- give items
            -- give premium points
            setAccountStorageValue(getPlayerAccountId(cid), 45001, 1)
        end
    end
    return true
end
 
Back
Top