• 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 Gateway Channel

Syntax

Developer
Joined
Oct 10, 2007
Messages
2,890
Reaction score
458
Location
Texas
A request from Sportacus from our thread.

Included is manual install and ill release a mod if anyone wants.

login.lua
Lua:
function onLogin(cid)
--configuration--
local config = {
	texttype = TALKTYPE_CHANNEL_W,
	channelID = 11,
	textprefix = "Login:",
	textsuffix = "has logged in!"
}
--end config--
local showGamemasters = getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand'))
	for _, pid in ipairs(getChannelUsers(config.channelID)) do
		if((showGamemasters or getPlayerCustomFlagValue(pid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES) or not getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) and (not isPlayerGhost(cid) or getPlayerGhostAccess(pid) >= getPlayerGhostAccess(cid))) then
			doPlayerSendChannelMessage(pid, cid, config.textprefix.." "..getCreatureName(cid).." "..config.textsuffix, config.texttype, config.channelID)
		end
	end
	return true
end

logout.lua
Lua:
function onLogout(cid)
--configuration--
local config = {
	texttype = TALKTYPE_CHANNEL_RA,
	channelID = 11,
	textprefix = "Logout:",
	textsuffix = "has left!"
}
--end config--
local showGamemasters = getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand'))
	for _, pid in ipairs(getChannelUsers(config.channelID)) do
		if((showGamemasters or getPlayerCustomFlagValue(pid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES) or not getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) and (not isPlayerGhost(cid) or getPlayerGhostAccess(pid) >= getPlayerGhostAccess(cid))) then
			doPlayerSendChannelMessage(pid, cid, config.textprefix.." "..getCreatureName(cid).." "..config.textsuffix, config.texttype, config.channelID)
		end
	end
	return true
end
 
Tested?

Because I tested the ones i requested and none worked. Lol, doubt this one will.

Mind testing your shit before releasing?
 
Personally I feel that isn't my concern...if your getting something for free at no expense, you can test and report bugs. But yes I have tested it and it did work. Don't bother requesting anymore shit from me cause I won't make it.
 
Personally I feel that isn't my concern...if your getting something for free at no expense, you can test and report bugs. But yes I have tested it and it did work. Don't bother requesting anymore shit from me cause I won't make it.

Well, can't take that i actually believe your shit is crap? You created 2 of 2 requests, great. You got +rep.

But what the fuck mate, 2 out of those 2 did not work, not even clsoe of working. That means, your just filling the forum with crap with "nearly completed" scripts.
 
Don't really give a shit what you think of my scripts... I'm not gunna put a whole lot of time and effort into public scripts. But I will provide support. Maybe you should learn it yourself and fix it. Ever think of that? People can learn more trying to fix a half-done script than copying and pasting one.
 
Don't really give a shit what you think of my scripts... I'm not gunna put a whole lot of time and effort into public scripts. But I will provide support. Maybe you should learn it yourself and fix it. Ever think of that? People can learn more trying to fix a half-done script than copying and pasting one.

Shit, didn't know that. Thanks Yoda.

I feel the powers are overwhelming.
 
Frankfarmer you are asking us to make your scripts because your to much of an idiot to actually make it, Then when he does something for you and makes it, You basically tell him that you beleive his code is Shit and it wont work and your to lazy to actually test it. so beleive me, you have lost his and my respect and i will never help you.
 
Frankfarmer you are asking us to make your scripts because your to much of an idiot to actually make it, Then when he does something for you and makes it, You basically tell him that you beleive his code is Shit and it wont work and your to lazy to actually test it. so beleive me, you have lost his and my respect and i will never help you.

Hahaha, seriously. Did he call you and told you to come here to "save your service", save the whales instead.

First of all, I like your service.. I like the idea, and I like that Syntax responded quickly with scripts that I requested.

Second, what I don't like.. is that there just some crappy scripts that's not been tested, not working and.. best thing of all, after someone test the script, he don't give a rats ass of it.

You guys, make 1 script.. (that won't work) then you leave it, make another one until you have 10 un-working scripts and you'll decide it's best to make the 11th one.

Before making scripts, please.. finish the ones you started at.
 
Tested?

Because I tested the ones i requested and none worked. Lol, doubt this one will.

Mind testing your shit before releasing?

Just because your unable to fix any bugged script here at OTLand, doesn't mean that you crying people will fix it for you :peace:
 
Thank you Syntax, this works just great. ^.^

@Frankfarmer, It's not that I don't agree with what you are saying, you just need to say it tactfully, and test it on your server, and post the problems involved with the script, and try to work togather to get the script working.

I believe that.. OTs, in general, are "open source" and we should work togather to provide resources for people to better their servers.


But.. back on topic, thank you again Syntax, it worked just fine.

For those wanting a more detialed installition guide..

Create a file in creature-scripts called "login1.lua" and paste this:

Code:
function onLogin(cid)
--configuration--
local config = {
        texttype = TALKTYPE_CHANNEL_W,
        channelID = 11,
        textprefix = "Login:",
        textsuffix = "has logged in!"
}
--end config--
local showGamemasters = getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand'))
        for _, pid in ipairs(getChannelUsers(config.channelID)) do
                if((showGamemasters or getPlayerCustomFlagValue(pid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES) or not getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) and (not isPlayerGhost(cid) or getPlayerGhostAccess(pid) >= getPlayerGhostAccess(cid))) then
                        doPlayerSendChannelMessage(pid, cid, config.textprefix.." "..getCreatureName(cid).." "..config.textsuffix, config.texttype, config.channelID)
                end
        end
        return true
end

Create another file in creature-scripts called "logout.lua" and paste this:

Code:
function onLogout(cid)
--configuration--
local config = {
        texttype = TALKTYPE_CHANNEL_RA,
        channelID = 11,
        textprefix = "Logout:",
        textsuffix = "has left!"
}
--end config--
local showGamemasters = getBooleanFromString(getConfigValue('displayGamemastersWithOnlineCommand'))
        for _, pid in ipairs(getChannelUsers(config.channelID)) do
                if((showGamemasters or getPlayerCustomFlagValue(pid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES) or not getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) and (not isPlayerGhost(cid) or getPlayerGhostAccess(pid) >= getPlayerGhostAccess(cid))) then
                        doPlayerSendChannelMessage(pid, cid, config.textprefix.." "..getCreatureName(cid).." "..config.textsuffix, config.texttype, config.channelID)
                end
        end
        return true
end

Add this to "login.lua":

Code:
	registerCreatureEvent(cid, "Login1")
	registerCreatureEvent(cid, "Logout")

And this to creaturescripts.xml:

Code:
	<event type="login" name="Login" event="script" value="login1.lua"/>
	<event type="logout" name="Logout" event="script" value="logout.lua"/>

Now go to "data/XML/channels.xml" and paste this:

Code:
	<channel id="11" active="no" name="Gateway"/>

And paste this in "data/lib/constant.lua" (After CHANNEL_HELP):

Code:
CHANNEL_GATEWAY = 11


You may have to change ID=11 if you don't already have an ID for talk channels set to 10.
 
@Grehy:
Code:
	local killer = type(deathList[1]) == "number" and getCreatureName(deathList[1]) or deathList[1]
	for _, player in ipairs(getChannelUsers(CHANNEL_DEATH)) do
		doPlayerSendChannelMessage(player, "[* R.I.P. *]", getCreatureName(cid) .." was killed at level ".. getPlayerLevel(cid) .." by ".. killer ..".", TALKTYPE_CHANNEL_O, CHANNEL_DEATH)
	end
 
@frank
Stop crying and try making it your self then.
quiet-faggot.jpg


on topic:
Nice script again xD rep++
 
@Grehy:
Code:
	local killer = type(deathList[1]) == "number" and getCreatureName(deathList[1]) or deathList[1]
	for _, player in ipairs(getChannelUsers(CHANNEL_DEATH)) do
		doPlayerSendChannelMessage(player, "[* R.I.P. *]", getCreatureName(cid) .." was killed at level ".. getPlayerLevel(cid) .." by ".. killer ..".", TALKTYPE_CHANNEL_O, CHANNEL_DEATH)
	end

Correct me if I am wrong, but won't that just show if a player died to a monster or player?

I think what the other guy wanted was to show only pvp related deaths, such as

Sportacus (100) was killed by Evil Pker Man (250).

And it would show up in red, if it was an unjustified kill, or it would show up in white if it was a justified kill.
 
Correct me if I am wrong, but won't that just show if a player died to a monster or player?

I think what the other guy wanted was to show only pvp related deaths, such as

Sportacus (100) was killed by Evil Pker Man (250).

And it would show up in red, if it was an unjustified kill, or it would show up in white if it was a justified kill.

Yes, only pvp deaths. And I never thought about the unjust thing, nice idea
 
Well, my fault, just add simple isPlayer + getPlayerLevel :p. I had to go while posting, so just took it from my data. ;d
 
Back
Top