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

what is wrong with this

Doggynub

LUA / C++
Joined
Sep 28, 2008
Messages
2,541
Reaction score
186
LUA:
function onCombat(cid, target)
   
    if getPlayerStorageValue(cid,2345) == 2 and getPlayerStorageValue(target,2345) == 2 then 
        doCreatureSay(cid,"You cannot attack players which pvp mode is off.", TALKTYPE_ORANGE_1)
    else
	  return true
    end

end


it works fine no errors but when i relog server close any idea why?>
 
I don't really understand what is wrong with the script. Can you explain?

try?
PHP:
  function onCombat(cid, target)
   
    if getPlayerStorageValue(cid,2345) == 2 and getPlayerStorageValue(target,2345) == 2 then
        doCreatureSay(cid,"You cannot attack players which pvp mode is off.", TALKTYPE_ORANGE_1)
        return false
    end
return true
end
 
with yours every thing messed no one can attack any
but thx for try i fixed it.It has some troubles with return in my server.
 
Code:
function onCombat(cid, target)
	if getPlayerStorageValue(cid, 2345) == 2 and getPlayerStorageValue(target, 2345) == 2 then
		doCreatureSay(cid, "You cannot attack players which pvp mode is off.", 19)
		return false
	end
	return true
end
 
Last edited:
Code:
function onCombat(cid, target)
	if getPlayerStorageValue(cid, 2345) == 2 and getPlayerStorageValue(target, 2345) == 2 then
		return doCreatureSay(cid, "You cannot attack players which pvp mode is off.", 19)
	end
	return true
end
doCreatureSay returns true, ffs
 
Back
Top