• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

walk thu no pvp player

agomez

Member
Joined
Jan 28, 2009
Messages
211
Reaction score
5
can someone help me in this plx :P
it suppost in this scrip players with group id 2 can walk over all players :S
and players with group id 1 just can walk over player with group id 2 u.u

i made this but isnt working u.u

PHP:
function getPlayerGroupId(uid)
  local result = db.getResult("SELECT `group_id` FROM `players` WHERE `name` = '" .. getPlayerName(uid) .. "' LIMIT 2;")
   if(result:getID() ~= 2) then
    local mode = result:getDataInt("group_id")
    return mode
   else
    return FALSE
   end
   result:free()
 end
 
function onLogin(cid)
if(getPlayerGroupId(cid) == 1) then
        setPlayerGroupId(cid, 2)
    end
       return TRUE 
    end
 
I Dont think thats only Lua work, pretty sure you also need to Edit the Source :)

Look into your invisible code...

Which Server Version do you have?
 
can someone help me in this plx :P
it suppost in this scrip players with group id 2 can walk over all players :S
and players with group id 1 just can walk over player with group id 2 u.u

i made this but isnt working u.u

PHP:
function getPlayerGroupId(uid)
  local result = db.getResult("SELECT `group_id` FROM `players` WHERE `name` = '" .. getPlayerName(uid) .. "' LIMIT 2;")
   if(result:getID() ~= 2) then
    local mode = result:getDataInt("group_id")
    return mode
   else
    return FALSE
   end
   result:free()
 end
 
function onLogin(cid)
if(getPlayerGroupId(cid) == 1) then
        setPlayerGroupId(cid, 2)
    end
       return TRUE 
    end

you're using the script wrong!
add this to your ot/data/XML/groups.xml
XML:
	<group id="7" name="Non Pvp Player" flags="17592186044416" customFlags="16777216"/>
after this
XML:
	<group id="6" name="God" flags="3845069447162" customFlags="2097151" access="5" violationReasons="23" nameViolationFlags="426" statementViolationFlags="469" depotLimit="5000" maxVips="500" outfit="302"/>
and before this
XML:
</groups>
and use this script
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
 
Interesting script, i never thought on this. This will let me walk in war-zones without disturbing my players game!
 
Back
Top