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

VIP (Premium) Channel

GuHB

Member
Joined
Dec 14, 2009
Messages
630
Reaction score
9
Location
Brazil
How can i do one Premium Channel?

have one tag to add in channels.xml to only Premium Players open it?

Solution: All credits goes to Cykotitan.

In chat.cpp

Find:
[cpp] if((readXMLString(p, "logged", strValue) || readXMLString(p, "log", strValue)) && booleanString(strValue))
flags |= CHANNELFLAG_LOGGED;[/cpp]
Add this under it:
[cpp] if(readXMLString(p, "premium", strValue) && booleanString(strValue))
flags |= CHANNELFLAG_PREMIUM;[/cpp]
Find:
[cpp] player->getVocationId())))[/cpp]
Replace it with this:
[cpp] player->getVocationId())) || (tmpChannel->hasFlag(CHANNELFLAG_PREMIUM) && !player->isPremium()))[/cpp]
In chat.h

Find:
[cpp] CHANNELFLAG_LOGGED = 1 << 2,[/cpp]
Add this under it:
[cpp] CHANNELFLAG_PREMIUM = 1 << 3,[/cpp]
One of the easiest source edits, ever :).

Oh, and to implement the channel into the server, add something like this in data/XML/channels.xml:
XML:
	<channel id="10" name="Premium Channel" premium="yes"/>
 
Last edited by a moderator:
No, you must edit sources (chat.cpp & chat.h) to add it :p
 
:S
i dont know how to do that. If you can explain.. i'll thanks :p
download the rev. that you're using, and open in devc++, and check the files chat.cpp and chat.h, and edit as desired,

then hit ctrl + f9 = compile! :D
 
Yes. I know it. I dont know how to edit the files :S I'm not an scripter ;/
 
In chat.cpp

Find:
[cpp] if((readXMLString(p, "logged", strValue) || readXMLString(p, "log", strValue)) && booleanString(strValue))
flags |= CHANNELFLAG_LOGGED;[/cpp]
Add this under it:
[cpp] if(readXMLString(p, "premium", strValue) && booleanString(strValue))
flags |= CHANNELFLAG_PREMIUM;[/cpp]
Find:
[cpp] player->getVocationId())))[/cpp]
Replace it with this:
[cpp] player->getVocationId())) || (tmpChannel->hasFlag(CHANNELFLAG_PREMIUM) && !player->isPremium()))[/cpp]
In chat.h

Find:
[cpp] CHANNELFLAG_LOGGED = 1 << 2,[/cpp]
Add this under it:
[cpp] CHANNELFLAG_PREMIUM = 1 << 3,[/cpp]
One of the easiest source edits, ever :).

Oh, and to implement the channel into the server, add something like this in data/XML/channels.xml:
XML:
	<channel id="10" name="Premium Channel" premium="yes"/>
 
Moved to Resources ---> C++ Codes

Thanks Cykotitan for your contribution.
 
Back
Top