<event type="combat" name="vocPrevent" event="script" value="vocPrevent.lua"/>
registerCreatureEvent(cid, "vocPrevent")
function onCombat(cid, target)
if(isPlayer(cid) and isPlayer(target)) then
if(getPlayerVocation(cid) == getPlayerVocation(target)) then
return false
end
end
return true
end
function getPlayerGrade(cid)
local Field = db.getResult("SELECT `Grade` FROM `players` WHERE `name` = " .. getPlayerName(cid) .. " LIMIT 1")
if Field:getID() ~= LUA_ERROR then
local value = Field:getDataInt("Grade")
Field:free()
return value
end
return LUA_ERROR
end
function onCombat(cid, target)
if(isPlayer(cid) and isPlayer(target)) then
if(getPlayerGrade(cid) == getPlayerGrade(target)) then
return false
end
end
return true
end
fixedLUA:local Field = db.getResult("SELECT `Grade` FROM `players` WHERE `id` = " .. getPlayerGUID(cid))
fixed
if the name contains spaces/quotes, bad things would happenWhy by name wont work Cyko?