OTS/data/lib/function.lua (or 050-function.lua)
Open and paste :
function addPlayerFrag(cid, amount)
db.executeQuery("UPDATE `players` SET `frags_all` = `frags_all` + " .. amount .. " WHERE `id` = " .. getPlayerGUID(cid) .. ";")
end
OTS/data/creaturescripts/scripts/login.lua opne and paste :
registerCreatureEvent(cid, "Frags")
OTS/data/creaturescripts/ and open creaturescripts.xml add :
<event type="kill" name="Frags" event="script" value="frags.lua"/>
Create in file lua OTS/data/creaturescripts/scripts/
function onKill(cid, target, lastHit)
if(isPlayer(target) ~= true) then
return true
end
if (isPlayer(cid) == true) and (isPlayer(target) == true) then
if getPlayerSkullType(target) == SKULL_WHITE then
addPlayerFrag(cid, 1)
elseif getPlayerSkullType(target) == SKULL_YELLOW then
addPlayerFrag(cid, 1)
elseif getPlayerSkullType(target) == SKULL_RED then
addPlayerFrag(cid, 1)
elseif getPlayerSkullType(target) == SKULL_BLACK then
addPlayerFrag(cid, 1)
elseif getPlayerSkullType(target) == SKULL_NONE then
addPlayerFrag(cid, 1)
end
return TRUE
end
end
Phpmyadmin SQL :
ALTER TABLE players ADD frags_all INTEGER(11) NOT NULL DEFAULT 0;
"Thanks" if I help ;]