Well, I was working on a simple script for a War server or something where players gain Addons for the certian total Frags they have.
Add this to your functions.lua
Then make this query to your DataBase
creaturescripts.xml
login.lua
FragAddons.lua
And to make it so the players get a Tfrag onkill add this to a Kill script:
Explanation: After a player receives 5 Total Frags they will receive Full Citizen Addons and once they receive 10 Total Frags they will receive full hunter addon. And so on~
Add this to your functions.lua
Lua:
function doPlayerAddTfrag(cid, add)
return db.executeQuery("UPDATE `players` SET `tfrags` = `tfrags` + "..add.." WHERE `name` = '"..getCreatureName(cid).."';")
end
function getPlayerTfrags(cid)
local DB_points = db.getResult("SELECT `tfrags` FROM `players` WHERE `name` = '"..getCreatureName(cid).."';")
points = DB_points:getDataInt("tfrags")
DB_points:free()
return points
end
Then make this query to your DataBase
PHP:
ALTER TABLE players ADD tfrags varchar(255) NOT NULL
creaturescripts.xml
PHP:
<event type="think" name="FragAddons" event="script" value="FragAddons.lua"/>
login.lua
Lua:
registerCreatureEvent(cid, "FragAddons")
FragAddons.lua
Lua:
function onThink(cid, interval)
if(getPlayerTfrags(cid) == 5) and (getPlayerStorageValue(cid, 1000) == -1)then
doPlayerAddOutfitId(cid,1,3)
doPlayerSendTextMessage(cid,21,"For obtaining 5 Frags total you are rewarded with Full Citizen Addons!")
doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
setPlayerStorageValue(cid,1000,1)
else
return true
end
if(getPlayerTfrags(cid) == 10) and (getPlayerStorageValue(cid, 1001) == -1)then
doPlayerAddOutfitId(cid,2,3)
doPlayerSendTextMessage(cid,21,"For obtaining 10 Frags total you are rewarded with Full Hunter Addons!")
doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
setPlayerStorageValue(cid,1001,1)
else
return true
end
if(getPlayerTfrags(cid) == 20) and (getPlayerStorageValue(cid, 1002) == -1)then
doPlayerAddOutfitId(cid,3,3)
doPlayerSendTextMessage(cid,21,"For obtaining 20 Frags total you are rewarded with Full Mage Addons!")
doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
setPlayerStorageValue(cid,1002,1)
else
return true
end
if(getPlayerTfrags(cid) == 35) and (getPlayerStorageValue(cid, 1003) == -1)then
doPlayerAddOutfitId(cid,4,3)
doPlayerSendTextMessage(cid,21,"For obtaining 35 Frags total you are rewarded with Full Knight Addons!")
doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
setPlayerStorageValue(cid,1003,1)
else
return true
end
if(getPlayerTfrags(cid) == 50) and (getPlayerStorageValue(cid, 1004) == -1)then
doPlayerAddOutfitId(cid,5,3)
doPlayerSendTextMessage(cid,21,"For obtaining 35 Frags total you are rewarded with Full Noble Outfit Addons!")
doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
setPlayerStorageValue(cid,1004,1)
else
return true
end
if(getPlayerTfrags(cid) == 75) and (getPlayerStorageValue(cid, 1005) == -1)then
doPlayerAddOutfitId(cid,6,3)
doPlayerSendTextMessage(cid,21,"For obtaining 75 Frags total you are rewarded with Full Summoner Addons!")
doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
setPlayerStorageValue(cid,1005,1)
else
return true
end
if(getPlayerTfrags(cid) == 100) and (getPlayerStorageValue(cid, 1006) == -1)then
doPlayerAddOutfitId(cid,7,3)
doPlayerSendTextMessage(cid,21,"For obtaining 100 Frags total you are rewarded with Full Warrior Addons!")
doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
setPlayerStorageValue(cid,1006,1)
else
return TRUE
end
if(getPlayerTfrags(cid) == 125) and (getPlayerStorageValue(cid, 1007) == -1)then
doPlayerAddOutfitId(cid,8,3)
doPlayerSendTextMessage(cid,21,"For obtaining 125 Frags total you are rewarded with Full Barbarian Addons!")
doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
setPlayerStorageValue(cid,1007,1)
else
return TRUE
end
if(getPlayerTfrags(cid) == 150) and (getPlayerStorageValue(cid, 1008) == -1)then
doPlayerAddOutfitId(cid,9,3)
doPlayerSendTextMessage(cid,21,"For obtaining 150 Frags total you are rewarded with Full Druid Addons!")
doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
setPlayerStorageValue(cid,1008,1)
else
return TRUE
end
if(getPlayerTfrags(cid) == 175) and (getPlayerStorageValue(cid, 1009) == -1)then
doPlayerAddOutfitId(cid,10,3)
doPlayerSendTextMessage(cid,21,"For obtaining 175 Frags total you are rewarded with Full Wizard Addons!")
doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
setPlayerStorageValue(cid,1009,1)
else
return TRUE
end
if(getPlayerTfrags(cid) == 225) and (getPlayerStorageValue(cid, 1010) == -1)then
doPlayerAddOutfitId(cid,11,3)
doPlayerSendTextMessage(cid,21,"For obtaining 225 Frags total you are rewarded with Full Oriental Addons!")
doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
setPlayerStorageValue(cid,1010,1)
else
return TRUE
end
if(getPlayerTfrags(cid) == 275) and (getPlayerStorageValue(cid, 1011) == -1)then
doPlayerAddOutfitId(cid,12,3)
doPlayerSendTextMessage(cid,21,"For obtaining 275 Frags total you are rewarded with Full Pirate Addons!")
doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
setPlayerStorageValue(cid,1011,1)
else
return TRUE
end
if(getPlayerTfrags(cid) == 325) and (getPlayerStorageValue(cid, 1012) == -1)then
doPlayerAddOutfitId(cid,13,3)
doPlayerSendTextMessage(cid,21,"For obtaining 325 Frags total you are rewarded with Full Assassin Addons!")
doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
setPlayerStorageValue(cid,1012,1)
else
return TRUE
end
if(getPlayerTfrags(cid) == 375) and (getPlayerStorageValue(cid, 1013) == -1)then
doPlayerAddOutfitId(cid,14,3)
doPlayerSendTextMessage(cid,21,"For obtaining 375 Frags total you are rewarded with Full Beggar Addons!")
doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
setPlayerStorageValue(cid,1013,1)
else
return TRUE
end
if(getPlayerTfrags(cid) == 450) and (getPlayerStorageValue(cid, 1014) == -1)then
doPlayerAddOutfitId(cid,15,3)
doPlayerSendTextMessage(cid,21,"For obtaining 450 Frags total you are rewarded with Full Shaman Addons!")
doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
setPlayerStorageValue(cid,1014,1)
else
return TRUE
end
if(getPlayerTfrags(cid) == 525) and (getPlayerStorageValue(cid, 1015) == -1)then
doPlayerAddOutfitId(cid,16,3)
doPlayerSendTextMessage(cid,21,"For obtaining 525 Frags total you are rewarded with Full Norsemen Addons!")
doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
setPlayerStorageValue(cid,1015,1)
else
return TRUE
end
if(getPlayerTfrags(cid) == 600) and (getPlayerStorageValue(cid, 1016) == -1)then
doPlayerAddOutfitId(cid,17,3)
doPlayerSendTextMessage(cid,21,"For obtaining 600 Frags total you are rewarded with Full Nightmare Addons!")
doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
setPlayerStorageValue(cid,1016,1)
else
return TRUE
end
if(getPlayerTfrags(cid) == 700) and (getPlayerStorageValue(cid, 1017) == -1)then
doPlayerAddOutfitId(cid,18,3)
doPlayerSendTextMessage(cid,21,"For obtaining 700 Frags total you are rewarded with Full Jester Addons!")
doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
setPlayerStorageValue(cid,1017,1)
else
return TRUE
end
if(getPlayerTfrags(cid) == 800) and (getPlayerStorageValue(cid, 1018) == -1)then
doPlayerAddOutfitId(cid,19,3)
doPlayerSendTextMessage(cid,21,"For obtaining 800 Frags total you are rewarded with Full Brotherhood Addons!")
doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
setPlayerStorageValue(cid,1018,1)
else
return TRUE
end
if(getPlayerTfrags(cid) == 900) and (getPlayerStorageValue(cid, 1019) == -1)then
doPlayerAddOutfitId(cid,20,3)
doPlayerSendTextMessage(cid,21,"For obtaining 900 Frags total you are rewarded with Full Demonhunter Addons!")
doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
setPlayerStorageValue(cid,1019,1)
else
return TRUE
end
if(getPlayerTfrags(cid) == 1000) and (getPlayerStorageValue(cid, 1020) == -1)then
doPlayerAddOutfitId(cid,21,3)
doPlayerSendTextMessage(cid,21,"For obtaining 1000 Frags total you are rewarded with Full Yalaharian Addons!")
doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
setPlayerStorageValue(cid,1020,1)
else
end
return TRUE
end
And to make it so the players get a Tfrag onkill add this to a Kill script:
Lua:
doPlayerAddTfrag(cid, 1)
Explanation: After a player receives 5 Total Frags they will receive Full Citizen Addons and once they receive 10 Total Frags they will receive full hunter addon. And so on~