Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local cfg = _PRIVATE_WAR_SYSTEM_CONFIG
- function onPrepareDeath(cid, deathList, mostDamageKiller)
- if isPlayer(cid) then
- team = getPlayerStorageValue(cid, cfg.gbet_sto)
- lib = cfg.teamConfig[team]
- if lib then
- killer = deathList[1]
- if not isPlayer(killer) then
- if isPlayer(getCreatureMaster(killer)) then
- killer = getCreatureMaster(killer)
- else
- return true
- end
- end
- ksto = getPlayerStorageValue(killer, cfg.gbet_sto)
- klib = cfg.teamConfig[ksto]
- if klib then
- life = getCreatureMaxHealth(cid)
- doCreatureAddHealth(cid, life, 0, 0, true) -- Change to: doCreatureAddHealth(cid, life, true)
- --[[ Continuin' The Actions ]]--
- tkills = getGlobalStorageValue(klib.gsto_kills)
- kill_total = getGlobalStorageValue(cfg.gbet_sto)
- if (tkills + 1) >= kill_total then
- --[[ Event is Over ]]--
- doPrivWarEnd(cid, ksto, true)
- else
- setGlobalStorageValue(klib.gsto_kills, (tkills+1))
- doSendAnimatedText(getThingPos(cid), "[ "..(tkills+1).." / "..kill_total.." ]", COLOR_WHITE)
- doBroadcastPrivWar(killer, cid, ksto)
- doTeleportThing(cid, lib.basePos)
- print(''..getCreatureName(cid)..' ['..lib.tname..' Team] was been killed by '..getCreatureName(killer)..' ['..klib.tname..' Team].')
- end
- return false
- else
- return true
- end
- else
- return true
- end
- end
- end
- function onCombat(cid, target)
- if isPlayer(cid) and isPlayer(target) then
- cidsto, tarsto = getPlayerStorageValue(cid, cfg.gbet_sto), getPlayerStorageValue(target, cfg.gbet_sto)
- if cidsto > 0 and tarsto > 0 then
- if cidsto == tarsto then
- doPlayerSendCancel(cid, "You can't do dat.")
- return false
- end
- end
- end
- return true
- end
Advertisement
Add Comment
Please, Sign In to add comment