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

On look, temporary name

Bruce Leal

New Member
Joined
Nov 9, 2017
Messages
77
Reaction score
3
Is it possible for a script to add a temporary name that disappears in seconds in the player's look?

(example command: /changelookname John, Protector of thais)

You see a John, he is a sorcerer, PROTECTOR OF THAIS

The PROTECTOR OF THAIS, will disappear in 10 seconds.
 
Last edited:
I'm honestly curious why you need a talkaction that does this. xP
 
For a Donaters, when someone donate, will get the title As:
Blessed by Odin.

You see a John, he is an sorcerer, Blessed By odin.
When expire the donate/vip time, i will remove the title, and back to "You see a John, he is an sorcerer."

Curious: My server have nordic theme :p
 
For a Donaters, when someone donate, will get the title As:
Blessed by Odin.

You see a John, he is an sorcerer, Blessed By odin.
When expire the donate/vip time, i will remove the title, and back to "You see a John, he is an sorcerer."

Curious: My server have nordic theme :p
Does your server have a vip function or a storage value that indicates they are a donator?

If yes, then this request will be really easy.
 
I Will send at night, im working now :S 09:42 At now,
12:00 is my break *-* and i send.
@edit
i get a time, sending the script. addvip.lua
 
Last edited:
-bump
@Xikini
Add vip script.
Code:
function onSay(cid, words, param)
access = 4
days = 30
player = getPlayerByName(param)
daysvalue = days*3600*24
storageplayer = getPlayerStorageValue(player,13540)
timenow = os.time()
if storageplayer == -1 or storageplayer == 0 then
time = timenow+daysvalue
else
time = storageplayer+daysvalue
end
if param ~= "" then
if getPlayerGroupId(cid) >= access then
doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Were added ".. days .." VIP day on your character.")
setPlayerStorageValue(player,13540,time)
quantity = math.floor((getPlayerStorageValue(player,13540) - timenow)/(3600*24))
doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "You have ".. quantity .." days of VIP time.")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only members with greater access to ".. access .." can add VIP.")
end
end
end
 
Last edited:
-bump
@Xikini
Add vip script.
Code:
function onSay(cid, words, param)
access = 4
days = 30
player = getPlayerByName(param)
daysvalue = days*3600*24
storageplayer = getPlayerStorageValue(player,13540)
timenow = os.time()
if storageplayer == -1 or storageplayer == 0 then
time = timenow+daysvalue
else
time = storageplayer+daysvalue
end
if param ~= "" then
if getPlayerGroupId(cid) >= access then
doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "Were added ".. days .." VIP day on your character.")
setPlayerStorageValue(player,13540,time)
quantity = math.floor((getPlayerStorageValue(player,13540) - timenow)/(3600*24))
doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "You have ".. quantity .." days of VIP time.")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only members with greater access to ".. access .." can add VIP.")
end
end
end
I think this will work as intended, as the vip is counted by os.time
I basically just edited this reborn script.
Lua:
function onLook(cid, thing, position, lookDistance)
    if not isPlayer(thing.uid) then
        return true
    end
    local cur_time = os.time()
    if getPlayerStorageValue(thing.uid, 13540) < cur_time then
        return true
    end
    if thing.uid ~= cid then
        local sex = getPlayerSex(thing.uid)
        local message = "You see " .. getPlayerName(thing.uid) .. " (Level " .. getPlayerLevel(thing.uid) .. "). " .. getPlayerName(thing.uid) .. " is BLESSED BY ODIN."
        if(getPlayerFlagValue(thing.uid, PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION)) then
            message = message .. " " .. (sex == PLAYERSEX_FEMALE and "She" or "He") .. " is a " .. getPlayerGroupName(thing.uid) .. "."
        elseif(getPlayerVocation(thing.uid) ~= 0) then
            message = message .. " " .. (sex == PLAYERSEX_FEMALE and "She" or "He") .. " is a " .. getPlayerVocationName(thing.uid):lower() .. "."
        else
            message = message .. " " .. (sex == PLAYERSEX_FEMALE and "She" or "He") .. " has no vocation."
        end

        if(getPlayerNameByGUID(getPlayerPartner(thing.uid), false, false) ~= nil) then
            message = message .. " " .. (sex == PLAYERSEX_FEMALE and "She" or "He") .. " is " .. (sex == PLAYERSEX_FEMALE and "wife" or "husband") .. " of " .. getPlayerNameByGUID(getPlayerPartner(thing.uid)) .. "."
        end

        if(getPlayerGuildId(thing.uid) > 0) then
            message = message .. " " .. (sex == PLAYERSEX_FEMALE and "She" or "He") .. " is " .. (getPlayerGuildRank(thing.uid) == "" and "a member" or getPlayerGuildRank(thing.uid)) .. " of the " .. getPlayerGuildName(thing.uid)
            message = getPlayerGuildNick(thing.uid) ~= "" and message .. " (" .. getPlayerGuildNick(thing.uid) .. ")." or message .. "."
        end

        if(getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS)) then
            message = message .. "\nHealth: [" .. getCreatureHealth(thing.uid) .. " / " .. getCreatureMaxHealth(thing.uid) .. "], Mana: [" .. getCreatureMana(thing.uid) .. " / " .. getCreatureMaxMana(thing.uid) .. "]."
        end

        if(getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEEPOSITION)) then
            message = message .. "\nPosition: [X: " .. position.x .. "] [Y: " .. position.y .. "] [Z: " .. position.z .. "]."
        end

        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, message)
        return false
    elseif thing.uid == cid then
        local message = "You see yourself. You are BLESSED BY ODIN."
        if(getPlayerFlagValue(cid, PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION)) then
            message = message .. " You are " .. getPlayerGroupName(cid) .. "."
        elseif(getPlayerVocation(cid) ~= 0) then
            message = message .. " You are a " .. getPlayerVocationName(cid):lower() .. "."
        else
            message = message .. " You have no vocation."
        end

        if(getPlayerNameByGUID(getPlayerPartner(cid), false, false) ~= nil) then
            message = message .. " You are " .. (getPlayerSex(cid) == PLAYERSEX_FEMALE and "wife" or "husband") .. " of " .. getPlayerNameByGUID(getPlayerPartner(cid)) .. "."
        end

        if(getPlayerGuildId(cid) > 0) then
            message = message .. " You are " .. (getPlayerGuildRank(cid) == "" and "a member" or getPlayerGuildRank(cid)) .. " of the " .. getPlayerGuildName(cid)
            message = getPlayerGuildNick(cid) ~= "" and message .. " (" .. getPlayerGuildNick(cid) .. ")." or message .. "."
        end

        if(getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS)) then
            message = message .. "\nHealth: [" .. getCreatureHealth(cid) .. " / " .. getCreatureMaxHealth(cid) .. "], Mana: [" .. getCreatureMana(cid) .. " / " .. getCreatureMaxMana(cid) .. "]."
        end

        if(getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEEPOSITION)) then
            message = message .. "\nPosition: [X: " .. position.x .. "] [Y: " .. position.y .. "] [Z: " .. position.z .. "]."
        end

        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, message)
        return false
    end

    return true
end
 
So when set time VIP, will the player receive the tag of Blessed by Odin?
By the time your VIP time runs out, will tag disappear?
@edit

I need to inset in addvip.lua your system? Or create new .lua and add in XML?
 
So when set time VIP, will the player receive the tag of Blessed by Odin?
By the time your VIP time runs out, will tag disappear?
@edit

I need to inset in addvip.lua your system? Or create new .lua and add in XML?
When they have VIP the tag will auto-show, and auto-remove when they have no vip.
data/creaturescripts/creturescripts.xml
XML:
 <event type="look" name="onLook_blessedByOdin" event="script" value="onLook_blessedByOdin.lua"/>
data/creaturescripts/scripts/login.lua [somewhere near to bottom with the other registered events]
Lua:
registerCreatureEvent(cid, "onLook_blessedByOdin")
 
At work so my mind is a bit occupied.
Try this.
Lua:
local days = 30
local vip_storage = 13540

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local daysvalue = days * 3600 * 24
    local timenow = os.time()
    local storageplayer = getPlayerStorageValue(cid, vip_storage) 
    local new_value = 0
    if storageplayer == -1 or storageplayer == 0 then
        new_value = timenow + daysvalue
    else
        new_value = storageplayer + daysvalue
    end
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Were added ".. days .." VIP day on your character.")
    setPlayerStorageValue(cid, vip_storage, new_value)
    quantity = math.floor((getPlayerStorageValue(cid, vip_storage) - timenow)/(3600*24))
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have ".. quantity .." days of VIP time.")
    return true
end
 
Last edited:
-bump
Hail @Xikini , not working the system :/

vocations::getVocation Vocation 429496577295 not found

oops, my error hahaha the character doesn't have vocation, i had the repair at now. Thanks !
However... please read my message in your inbox Xikini
 
Last edited:
Back
Top