• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

CreatureEvent Login Message

Eazy M

Developer
Joined
Oct 17, 2010
Messages
911
Reaction score
61
Location
.
Hi, this is maybe useful for someone, idk.

(First login)
2vt3b60.jpg


(Everytime you login)
3448iyv.jpg




Put this code under function onLogin(cid) in login.lua (creaturescripts)

Lua:
local welcomeText = "Welcome " .. getCreatureName(cid) .. ".\n\nOur community would like to welcome you to " .. getConfigValue('serverName') .. ". If you need help with anything, please refer to the help channel.\n\nEnjoy your time!"
local text = "- Welcome to Zelonia, here's a list of commands:\n!aol               -> Buy an amulet of loss\n!spells            -> List of spells available\n!frags             -> Check your amount of kills\n!offer            -> Allow you to buy a certain item from auctions on our homepage\nCtrl+R             -> Report bugs to staff\n- Visit our webpage for a complete list of commands.\n//Zelonia Staff"
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, ""..text.."")

if(getPlayerStorageValue(cid, 19622)) == -1 then
	doBroadcastMessage(""..welcomeText.."")
	setPlayerStorageValue(cid, 19622, 1)
	return true
end

Remember to change the text.


Please, don't post your own codes in my thread. :huh:

Rep++ please, if you're using :)
 
Last edited:
It's simple script, but it can be useful.
Thanks for release!
 
Ill put my code!
Lua:
function onLogin(cid)
  doBroadcastMessage("hello")
return true
end
Fuck the system

Srsly,
you can simple set that:
Lua:
doBroadcastMessage(welcomeText)
exept that:
Lua:
doBroadcastMessage(""..welcomeText.."")


And more hardcore version of this:
Lua:
if(getPlayerStorageValue(cid, 19622)) == -1 then
	[code]
	setPlayerStorageValue(cid, 19622, 1)
	return true
end

is this:
Lua:
local lastLogin = getPlayerLastLoginSaved(cid)
	if(lastLogin == 0) 
		[code]
	end

Anyways, nice

@Edit:
also ive found some kind of bug
Lua:
doBroadcastMessage(""..welcomeText.."")

doBroadcastMessage will show every single online player this message, so its kinda weird.
You can use
Lua:
doPlayerSendTextMessage(cid,22,welcomeText)
 
Last edited:
I would rather put the code under lastLogin in login.lua instead of using storage. :p
 
Back
Top