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

CreatureEvent Walk thru Non Pvp Players

Sync

Ø,ø
Joined
May 26, 2009
Messages
1,901
Reaction score
26
Location
Canada
Now you just have to make a function that allows players with PvP mode to walk through Non-PvPers

Ain't there already something existing allowing players to walk through players below protection level? Shouldn't be hard to edit it to fit these scripts! :D

What i've done is made a new group which has the flags of a normal player and custom flags that allow any player to walk through them.

http://otland.net/f118/optional-pvp-script-s-72857/

Code:
<?xml version="1.0" encoding="UTF-8"?>
<groups>
	<group id="1" name="Player" flags="17592186044416"/>
	<group id="2" name="Tutor" flags="16809984" customFlags="2" access="1" violationReasons="4" nameViolationFlags="2"/>
	<group id="3" name="Senior Tutor" flags="68736352256" customFlags="14" access="2" violationReasons="10" nameViolationFlags="2" statementViolationFlags="63" maxVips="200"/>
	<group id="4" name="Gamemaster" flags="3808558964575" customFlags="257215" access="3" violationReasons="19" nameViolationFlags="10" statementViolationFlags="69" depotLimit="3000" maxVips="300" outfit="75"/>
	<group id="5" name="Community Manager" flags="3840774348794" customFlags="781823" access="4" violationReasons="23" nameViolationFlags="42" statementViolationFlags="213" depotLimit="4000" maxVips="400" outfit="266"/>
	<group id="6" name="God" flags="3845069447162" customFlags="2097151" access="5" violationReasons="23" nameViolationFlags="426" statementViolationFlags="469" depotLimit="5000" maxVips="500" outfit="302"/>
	<group id="7" name="Non Pvp Player" flags="17592186044416" customFlags="16777216"/>
</groups>

Lua:
function getPlayerPVPMode(uid)
  local result = db.getResult("SELECT `pvpmode` FROM `players` WHERE `name` = '" .. getPlayerName(uid) .. "' LIMIT 1;")
   if(result:getID() ~= -1) then
    local mode = result:getDataInt("pvpmode")
    return mode
   else
    return FALSE
   end
   result:free()
 end
 
function onLogin(cid)
if(getPlayerGroupId(cid) == 1) and (getPlayerPVPMode(cid) == 0) then
        setPlayerGroupId(cid, 7)
    end
       return TRUE 
    end
 
Last edited:
good for anti noob protection
 
elf should make

doPlayerSetFlagValue
doPlayerSetCustomFlagValue
 
Where can I place that? creaturescripts?

Code:
function getPlayerPVPMode(uid)
  local result = db.getResult("SELECT `pvpmode` FROM `players` WHERE `name` = '" .. getPlayerName(uid) .. "' LIMIT 1;")
   if(result:getID() ~= -1) then
    local mode = result:getDataInt("pvpmode")
    return mode
   else
    return FALSE
   end
   result:free()
 end
 
function onLogin(cid)
if(getPlayerGroupId(cid) == 1) and (getPlayerPVPMode(cid) == 0) then
        setPlayerGroupId(cid, 7)
       return TRUE 
    end
 
When i use this script i got this error

PHP:
18/03/2010 22:03:07] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/lowpvp.lua)
[18/03/2010 22:03:07] data/creaturescripts/scripts/lowpvp.lua:16: 'end' expected (to close 'function' at line 12) near '<eof>'


And i used this in creaturescript
PHP:
	<event type="think" name="Lowpvp" event="script" value="lowpvp.lua"/>

and i typed this at login.lua
PHP:
        registerCreatureEvent(cid, "Lowpvp")

And i changed my groups.xml to this
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<groups>
	<group id="1" name="Player" flags="17592186044416"/>
	<group id="2" name="Tutor" flags="16809984" customFlags="2" access="1" violationReasons="4" nameViolationFlags="2"/>
	<group id="3" name="Senior Tutor" flags="68736352256" customFlags="14" access="2" violationReasons="10" nameViolationFlags="2" statementViolationFlags="63" maxVips="200"/>
	<group id="4" name="Gamemaster" flags="3808558964575" customFlags="257215" access="3" violationReasons="19" nameViolationFlags="10" statementViolationFlags="69" depotLimit="3000" maxVips="300" outfit="75"/>
	<group id="5" name="Community Manager" flags="3840774348794" customFlags="781823" access="4" violationReasons="23" nameViolationFlags="42" statementViolationFlags="213" depotLimit="4000" maxVips="400" outfit="266"/>
	<group id="6" name="God" flags="3845069447162" customFlags="2097151" access="5" violationReasons="23" nameViolationFlags="426" statementViolationFlags="469" depotLimit="5000" maxVips="500" outfit="302"/>
	<group id="7" name="Non Pvp Player" flags="17592186044416" customFlags="16777216"/>
</groups>

I need help with this!
 
Last edited:
@up ye, i was gonna say he missed an end to end "function onLogin" just put an end at the end of the script and it will work
 
It's a very fine piece of work, but I would write down for which versions it work so you woulnd't have members confused over this script. Just saying ;p
 
It's a very fine piece of work, but I would write down for which versions it work so you woulnd't have members confused over this script. Just saying ;p

It requires a Mind to know how to run an OT, if they cant figure that out perhaps they shouldnt be running a OT or attempting to script.
 
Great.
I wondered how to allow players to walk through others, but how is it possible to do it only for curtain in guild war?
 
i want it but without the 'both world type system'
only walk over 'protected level players'
 

Similar threads

Back
Top