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

Advanced NonPvp/Pvp System (tested- Not working) fix??

Boza

New Member
Joined
Feb 16, 2010
Messages
184
Reaction score
0
1.) I am looking for a system were both Non-Pvp and Pvp Players can be on the same world.

2.) Also I would like a scroll that could change a player from pvp-enabled to disabled. I'm not sure how it would work. (maybe with a storage value)??

3.) Is this possible.. To look at a player in game (shift +left click) And see if their pvp-enabled/disabled?
You see Test (Level 1337). He is a sorcerer. He is Pvp-Enabled.

Or
You see Test (Level 1337). He is a sorcerer. He is Pvp-Disabled.

This would be very cool. I know it's possible
Will Rep++
 
NOT TESTED

Creature script:
Lua:
function onAttack(cid, target)

local storage = 65535

	if not isPlayer(target) then
		return true
	end

	if(getPlayerStorageValue(cid, storage) > 0) then
		doPlayerSendCancel(cid, "You have Pvp-Disabled.")
		return false
	end

	if(getPlayerStorageValue(target, storage) > 0) then
		doPlayerSendCancel(cid, "You cannot attack this player.")
		return false
	end
	return true
end

Action...
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)

local storage = 65535

	if(getPlayerStorageValue(cid, storage) > 0) then
		doPlayerSetStorageValue(cid, storage, 0)
	else
		doPlayerSetStorageValue(cid, storage, 1)
	end
	
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You set Pvp-" .. (getPlayerStorageValue(cid, storage) > 0 and "Enabled" or "Disabled") .. ".")
	doPlayerSetSpecialDescription(cid, (getPlayerSex(cid) == 1 and "He" or "She") .. " is Pvp-" .. (getPlayerStorageValue(cid, storage) > 0 and "Enabled" or "Disabled") .. ".")
	return true
end
 
The script sets the storage value, but the creaturescripts is not working right. I can still attack people with a Non-pvp enabled player
 
Last edited:
The script sets the storage value, but the creaturescripts is not working right. I can still attack people with a Non-pvp enabled player

Did you add this?

creaturescripts.xml
PHP:
<event type="attack" name="PvP" event="script" value="pvp.lua"/>

login.lua
Lua:
registerCreatureEvent(cid, "PvP")
 
Problem is players would level to high ass lvl as non pvp, then go to pvp and rape all

Best system would be, You can make pvp char or a non pvp char. through website would be sick.

I would pay for it seriously.
 
Problem is players would level to high ass lvl as non pvp, then go to pvp and rape all

Best system would be, You can make pvp char or a non pvp char. through website would be sick.

I would pay for it seriously.

Simple scripting, Ill pm you =]
 
Back
Top