• 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]Onlook With Pvp Mode By Azi

FeragonOnline

Im Bored!
Joined
Jan 19, 2010
Messages
98
Reaction score
1
Location
USA
Example:
Lua:
function onLook(cid, thing, position, lookDistance)
        if(isPlayer(thing.uid) == true) then
                    if (getPlayerPVPMode(cid) == 1 and getPlayerPVPMode(target) == 1) or isPlayer(target) == FALSE then
					else
                        doPlayerSendCancel(cid, "He Is Pvp Disabled.")
					end
        return true
    end
i dont know if this script work xD
 
well..
IAM NOT GOOD ON IT S: IF IT DONT WORK PM ME :)


go to iologindata.cpp and on line 50
change
Code:
query << "SELECT `id`, `name`, `password`, `premdays`, `lastday`, `key`, `warnings` FROM `accounts` WHERE `id` = " << accountId << " LIMIT 1"
for
Code:
query << "SELECT `id`, `name`, `password`, `pvp`, `premdays`, `lastday`, `key`, `warnings` FROM `accounts` WHERE `id` = " << accountId << " LIMIT 1"

then add
Code:
account.pvp = result->getDataInt("pvp");


ok, now on account.h
search
Code:
int32_t warnings;
and down add
Code:
int32_t pvp;

now on players.cpp change
Code:
lastAttack = idleTime = marriage = blessings = balance = premiumDays = mana = manaMax = manaSpent = 0;
to
Code:
lastAttack = idleTime = marriage = blessings = balance = premiumDays = mana = manaMax = manaSpent = pvp = 0;

on player.h search
Code:
int32_t premiumDays;
and add
Code:
int32_t pvp;

now on player.cpp search
Code:
bool Player::isPremium() const
and down of the function add
Code:
bool Player::isPVP() const
{
	return pvp;
}
and on player.h declare it, search
Code:
bool isPremium() const;
and below add
Code:
bool isPVP() const;

all ok! :D

now on player.cpp search
Code:
std::string Player::getDescription(int32_t lookDistance) const
and change all the function for:

Code:
std::string Player::getDescription(int32_t lookDistance) const
{
	std::stringstream s;
	if(lookDistance == -1)
	{
		s << "yourself.";
		if(hasFlag(PlayerFlag_ShowGroupNameInsteadOfVocation))
			s << " You are " << group->getName();
		else if(vocation_id != 0)
			s << " You are " << vocation->getDescription();
		else
			s << " You have no vocation";
		if(isPVP())
			s << "\nYour PvP is << " (isPVP() != 0 ? "Enabled" : "Disabled") << ".";
	}
	else
	{
		s << nameDescription;
		if(!hasCustomFlag(PlayerCustomFlag_HideLevel))
			s << " (Level " << level << ")";

		s << ". " << (sex % 2 ? "He" : "She");
		if(hasFlag(PlayerFlag_ShowGroupNameInsteadOfVocation))
			s << " is " << group->getName();
		else if(vocation_id != 0)
			s << " is " << vocation->getDescription();
		else
			s << " has no vocation";
		if(isPVP())
			s << "\n" << (sex % 2 ? "His" : "Her"); << " PvP is " << (isPVP() != 0 ? "Enabled" : "Disabled") << ".";

		s << getSpecialDescription();
	}

	std::string tmp;
	if(marriage && IOLoginData::getInstance()->getNameByGuid(marriage, tmp))
	{
		s << ", ";
		if(vocation_id == 0)
		{
			if(lookDistance == -1)
				s << "and you are";
			else
				s << "and is";

			s << " ";
		}

		s << (sex % 2 ? "husband" : "wife") << " of " << tmp;
	}

	s << ".";
	if(guildId)
	{
		if(lookDistance == -1)
			s << " You are ";
		else
			s << " " << (sex % 2 ? "He" : "She") << " is ";

		s << (rankName.empty() ? "a member" : rankName)<< " of the " << guildName;
		if(!guildNick.empty())
			s << " (" << guildNick << ")";

		s << ".";
	}

	return s.str();
}

Rebuild
Done :)
It should work :D
 
Won't work?

Code:
if(hasFlag(PlayerFlag_ShowGroupNameInsteadOfVocation))
	s << " You are " << group->getName();
else if(vocation_id != 0)
	s << " You are " << vocation->getDescription();
else
	s << " You have no vocation";
if(isPVP())
	s << "\nYour PvP is << " (isPVP() != 0 ? "Enabled" : "Disabled") << ".";
 
ok i try to do it xD
but why in account? the script is in players not in accounts
query << "SELECT `id`, `name`, `password`, `pvp`, `premdays`, `lastday`, `key`, `warnings` FROM `accounts` WHERE `id` = " << accountId << " LIMIT 1"
 
good point! xddd well w8 :)

JBD*
change
s << "\nYour PvP is << " (isPVP() != 0 ? "Enabled" : "Disabled") << ".";
to
s << "\nYour PvP is " << (isPVP() != 0 ? "Enabled" : "Disabled") << ".";

Fera*
Well, you have 2 solutions xd, change the pvp to accounts or create a new query or something like that, iam not good on c++ ):
 
yo? pero si he estudiado el ingles en una universidad
ademas me gusta hablar asi, estilo informal, callejero y corto
si es a mi q te referias ^^
 
yo? pero si he estudiado el ingles en una universidad
ademas me gusta hablar asi, estilo informal, callejero y corto
si es a mi q te referias ^^

si lo c, io tambien soy mexicano ajjajaa
bueno nos vemos luego me saldre a jugar fut
with my friends xDDD
well you can do the script :D
 
I made a storage value script that sort of works.
What happens is when you turn pvp mode off, you can still lock on and get skull, but you don't do damage. :eek:
 
Okay so I have been messing around with it and I think it's going to be working soon.

So Far:
"!pvpmode off"
If you attack someone with pvp off, it says "John has PVP OFF" and doesn't let you attack him, but you get skull still (have to fix that).

"!pvpmode on"
If you attack someone with pvp on, then it lets you attack like normal.

Hopefully I will be able to finish this soon, but I am pretty busy in RL.
 
Back
Top