if(getPlayerItemCount(itemid) >= 1) then
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
end
put it in login if i want it make effect every login?Code:if(getPlayerItemCount(itemid) >= 1) then doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) end
Not sure if the function names are correct tho![]()
put it in login if i want it make effect every login?
local config = {
loginMessage = getConfigValue('loginMessage'),
useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}
function onLogin(cid)
doChangeSpeed(cid, 750)
doCreatureSay(cid, "Welcome!", 19)
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
end
return true
end
local accountManager = getPlayerAccountManager(cid)
if(accountManager == MANAGER_NONE) then
local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
if(lastLogin > 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
else
str = str .. " Please choose your outfit."
doPlayerSendOutfitWindow(cid)
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
elseif(accountManager == MANAGER_NAMELOCK) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
elseif(accountManager == MANAGER_ACCOUNT) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
end
if(not isPlayerGhost(cid)) then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
end
registerCreatureEvent(cid, "Mail")
registerCreatureEvent(cid, "Forever Amulet")
registerCreatureEvent(cid, "onPrepareDeath")
registerCreatureEvent(cid, "ZombieAttack")
registerCreatureEvent(cid, "removeghostspell")
registerCreatureEvent(cid, "removeghostcombat")
registerCreatureEvent(cid, "AutoBuyer")
registerCreatureEvent(cid, "skullsystem")
registerCreatureEvent(cid, "BlockEffect")
registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid, "Idle")
if(config.useFragHandler) then
registerCreatureEvent(cid, "SkullCheck")
end
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "AdvanceSave")
return true
end
local config = {
loginMessage = getConfigValue('loginMessage'),
useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}
function onLogin(cid)
doChangeSpeed(cid, 750)
doCreatureSay(cid, "Welcome!", 19)
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
end
local item = 1234 -- Change item
if(getPlayerItemCount(item) >= 1) then
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
end
local accountManager = getPlayerAccountManager(cid)
if(accountManager == MANAGER_NONE) then
local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
if(lastLogin > 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
else
str = str .. " Please choose your outfit."
doPlayerSendOutfitWindow(cid)
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
elseif(accountManager == MANAGER_NAMELOCK) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
elseif(accountManager == MANAGER_ACCOUNT) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
end
if(not isPlayerGhost(cid)) then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
end
registerCreatureEvent(cid, "Mail")
registerCreatureEvent(cid, "Forever Amulet")
registerCreatureEvent(cid, "onPrepareDeath")
registerCreatureEvent(cid, "ZombieAttack")
registerCreatureEvent(cid, "removeghostspell")
registerCreatureEvent(cid, "removeghostcombat")
registerCreatureEvent(cid, "AutoBuyer")
registerCreatureEvent(cid, "skullsystem")
registerCreatureEvent(cid, "BlockEffect")
registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid, "Idle")
if(config.useFragHandler) then
registerCreatureEvent(cid, "SkullCheck")
end
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "AdvanceSave")
return true
end
function onLogin(cid)
doChangeSpeed(cid, 750)
doCreatureSay(cid, "Welcome!", 19)
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
end
local accountManager = getPlayerAccountManager(cid)
if(accountManager == MANAGER_NONE) then
local lastLogin, str = getPlayerLastLoginSaved(cid), getConfigValue('loginMessage')
if(lastLogin > 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
else
str = str .. " Please choose your outfit."
doPlayerSendOutfitWindow(cid)
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
elseif(accountManager == MANAGER_NAMELOCK) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
elseif(accountManager == MANAGER_ACCOUNT) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
end
if(not isPlayerGhost(cid)) then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
end
registerCreatureEvent(cid, "Mail")
registerCreatureEvent(cid, "Forever Amulet")
registerCreatureEvent(cid, "onPrepareDeath")
registerCreatureEvent(cid, "ZombieAttack")
registerCreatureEvent(cid, "removeghostspell")
registerCreatureEvent(cid, "removeghostcombat")
registerCreatureEvent(cid, "AutoBuyer")
registerCreatureEvent(cid, "skullsystem")
registerCreatureEvent(cid, "BlockEffect")
registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid, "Idle")
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "AdvanceSave")
if(getBooleanFromString(getConfigValue('useFragHandler'))) then
registerCreatureEvent(cid, "SkullCheck")
end
if(getPlayerItemCount(itemid) >= 1) then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
end
return true
end
and maybe replace this function for it?Code:if(getPlayerItemCount(itemid) >= 1) then doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) end
local specialItem = 2432
if getPlayerItemCount(cid, specialItem) >= 1 then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
elseif(not isPlayerGhost(cid)) then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
end
@WibbenZ shouldnt "itemid" declared somewhere?
local itemid = 2432
and maybe replace this function for it?
else it will show 2 login effects?Code:local specialItem = 2432 if getPlayerItemCount(cid, specialItem) >= 1 then doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) elseif(not isPlayerGhost(cid)) then doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) end
Miseed the itemidwas in a hurry.
About the effects, well I guess but still you would have to be a GM+ and have the item.
elseif(not isPlayerGhost(cid)) then
show us the script that shows the login message with automatic blessings..Thanks guys alot work's perfect
but i have proplem in other script i made an script if player use item he will get storage that storage in login make everyone have it able to say work "automatic blessings" when he login it work's perfect but only with normal characters with my admin account it said 1 time and didn't said it more
if (getPlayerStorageValue(cid, storageItem) == 1 and getPlayerBlessing(cid, 1) == false) then
doPlayerAddItem(cid, 2173, 1)
for i = 1,5 do
doPlayerAddBlessing(cid, i)
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You received free AOL and BLESS.")
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
function onUse(cid, item, fromPos, item2, toPos)
if (getPlayerStorageValue(cid, storageItem) < 1) then
doPlayerSetStorageValue(cid, storageItem, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Congratulations, now you have AOL and BLESS forever.")
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
doRemoveItem(item.uid)
else
doPlayerSendCancel(cid, "You already have your forever AOL/BLESS active.")
end
return true
end
@Danger II here you areCode:if (getPlayerStorageValue(cid, storageItem) == 1 and getPlayerBlessing(cid, 1) == false) then doPlayerAddItem(cid, 2173, 1) for i = 1,5 do doPlayerAddBlessing(cid, i) end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You received free AOL and BLESS.") doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
PHP:function onUse(cid, item, fromPos, item2, toPos) if (getPlayerStorageValue(cid, storageItem) < 1) then doPlayerSetStorageValue(cid, storageItem, 1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Congratulations, now you have AOL and BLESS forever.") doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) doRemoveItem(item.uid) else doPlayerSendCancel(cid, "You already have your forever AOL/BLESS active.") end return true end
local storageItem = 11741
function onUse(cid, item, fromPos, item2, toPos)
if (getPlayerStorageValue(cid, storageItem) < 1) then
doPlayerSetStorageValue(cid, storageItem, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Congratulations, now you have AOL and BLESS forever.")
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
doRemoveItem(item.uid)
else
doPlayerSendCancel(cid, "You already have your forever AOL/BLESS active.")
end
return true
end
local storageItem = 11741
if (getPlayerStorageValue(cid, storageItem) > 0) and (getPlayerBlessing(cid, 1) == false) then
doPlayerAddItem(cid, 2173, 1)
for i = 1,5 do
doPlayerAddBlessing(cid, i)
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You received free AOL and BLESS.")
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
end
work's perfect but this send message when player dei i want it when player login if he login always get message explain"every login
understood me?
local storageItem = 11741
if (getPlayerStorageValue(cid, storageItem) > 0) and (getPlayerBlessing(cid, 1) == false) then
doPlayerAddItem(cid, 2173, 1)
for i = 1,5 do
doPlayerAddBlessing(cid, i)
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You received free AOL and BLESS.")
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Your character have all blessings.")
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
end