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

[REQUEST] Log in (Text Message)

Erik

hi
Joined
Dec 12, 2008
Messages
260
Reaction score
9
Location
Sweden
Example: When you log in to a Ot server.

When the player joined the game server it says

Welcome back! / (server name)

With orange text

Rep+
 
LUA:
function onLogin(cid)
local serverName = getConfigInfo('serverName')
local storage = getPlayerStorageValue(cid, 15004) 
if storage == -1 then
doPlayerSendTextMessage(cid, 22, "Hello "..getPlayerName(cid).." this is your first visit to "..serverName..". Enjoy your time on "..serverName..".")
setPlayerStorageValue(cid, 15004, 1)
else
doPlayerSendTextMessage(cid, 22, "Welcome back "..getPlayerName(cid).."!")
return TRUE
end
end
 
yes
add this to creaturescript.xml
XML:
    	<event type="login" name="welcome" event="script" value="welcome.lua"/>
and this to login.lua
LUA:
	registerCreatureEvent(cid, "welcome")
 
Thanks bogart.

What should i change, if im only want "Elminera!"?

Elminera!

lol, so when they log and theres a message that says Elminera?
if yes then
LUA:
function onLogin(cid)
doPlayerSendTextMessage(cid, 22, "Elminera"..getPlayerName(cid).."!")
return TRUE
end
 
Easier to add to login.lua.

LUA:
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, getConfigInfo('serverName') .. "! " .. getCreatureName(cid))
 
Back
Top