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

Lua Needing helps with addons

I don't know it's possible in query, but you can try with this:

PHP:
UPDATE `players` SET `lookaddons` = 3;
 
It is not possible to make it with mysql query. You should use this onLogin() function in creatureevents:
Code:
local STORAGE = 130301
local ACTIVATION_VALUE = 1
local femaleOutfits = {136, 137}
local maleOutfits = {128, 129}

function onLogin(cid)
    if getPlayerStorageValue(cid, STORAGE) == ACTIVATION_VALUE then
        if getPlayerSex(cid) == 0 then
            for i,_ in ipairs(femaleOutfits) do
                doPlayerAddOutfit(cid, i, 3)
            end
        elseif getPlayerSex(cid) == 1 then
            for i,_ in ipairs(maleOutfits) do
                doPlayerAddOutfit(cid, i, 3)
            end
        else
            return FALSE
        end
        doSetPlayerStorageValue(cid, STORAGE, ACTIVATION_VALUE + 1)
    end
    return TRUE
end
From now, every time you execute a query like this, each player that has this storage will receive addons after logging in:
PHP:
 UPDATE `player_storage` SET `value` = '1' WHERE `storage` = '130301' AND `player_id` = 'xxx';
And here is a modified script. It gives addons to every player:
Code:
local STORAGE = 130301
local femaleOutfits = {136, 137}
local maleOutfits = {128, 129}

function onLogin(cid)
    if getPlayerStorageValue(cid, STORAGE) < 0 then
        if getPlayerSex(cid) == 0 then
            for i,_ in ipairs(femaleOutfits) do
                doPlayerAddOutfit(cid, i, 3)
            end
        elseif getPlayerSex(cid) == 1 then
            for i,_ in ipairs(maleOutfits) do
                doPlayerAddOutfit(cid, i, 3)
            end
        else
            return FALSE
        end
        doSetPlayerStorageValue(cid, STORAGE, 1)
    end
    return TRUE
end
 
Back
Top