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

Only Premium Players can Login C++ [REQUEST]

Not so hard, just edit protocolgame.cpp and paste this 3 lines under "Temple position is wrong. Contact with the administration."

Code:
if(!player->isPremium())
{
	disconnectClient(0x14, "Your premium time for this account is out.\nTo re-active your account, please buy additional premium time from http://XXXXXX.com.");
	return false;
}

This will prompt message when player choose character from list and tries to login, I think its better to have it there.
 
It didnt work..

This is how I added the code

Code:
		player->setOperatingSystem(operatingSystem);
		player->setClientVersion(version);
		if(!g_game.placeCreature(player, player->getLoginPosition()) && !g_game.placeCreature(player, player->getMasterPosition(), false, true))
		{
			disconnectClient(0x14, "Temple position is wrong. Contact with the administration.");
			return false;

        if(!player->isPremium())
        {
        	disconnectClient(0x14, "Your premium time for this account is out.\nTo re-active your account, please buy additional premium time from: \nhttp://XXXXXX.com.");
        	return false;
        }
		}
 
Code:
		player->setOperatingSystem(operatingSystem);
		player->setClientVersion(version);
		if(!g_game.placeCreature(player, player->getLoginPosition()) && !g_game.placeCreature(player, player->getMasterPosition(), false, true))
		{
			disconnectClient(0x14, "Temple position is wrong. Contact with the administration.");
			return false;
		}

        if(!player->isPremium())
        {
        	disconnectClient(0x14, "Your premium time for this account is out.\nTo re-active your account, please buy additional premium time from: \nhttp://XXXXXX.com.");
        	return false;
        }

this.
 
Guys, both of your codes do compile. However they don't stop free accounts from loging in..

I think that is because it can't see how many prem days that there are left. It only says free account. It's just a random guess or maybe if we could put it in the place where they do login
 
Last edited:
Are you sure you're trying to login with a character that doesn't have a "Permanent premium account" flag, and you have freePremium disabled in config? This code should work IMO, I can't find nothing wrong with it.

BTW. these codes are same, you just moved it 2 lines, not 3 as you should :p
 
Are you sure you're trying to login with a character that doesn't have a "Permanent premium account" flag, and you have freePremium disabled in config? This code should work IMO, I can't find nothing wrong with it.

BTW. these codes are same, you just moved it 2 lines, not 3 as you should :p

The important thing is that it works :thumbup: Which it does now. Thanks for the help. I repped both of u guys :D
 
Back
Top