Hello, like in topic...
This is simple script for killing players, when you kill someone you recive reputation "Value of Storage".
I have 2 problems:
1st:
-When i killed player with lvl 201+ (ex. 234) i have got 50 rep,
-When lvl is less than 201 i recived 50+25 reputation (75) not 25...
-When i killed player with lvl 140 i have got 50+25+5 rep (80rep), but not 5 rep.
2nd:
How to use doCreatureSay option for more info?
For example:
"You have added: +"v[2]" Total reputation points: "getCreatureStorage(cid, rep_storage)
This is simple script for killing players, when you kill someone you recive reputation "Value of Storage".
I have 2 problems:
1st:
-When i killed player with lvl 201+ (ex. 234) i have got 50 rep,
-When lvl is less than 201 i recived 50+25 reputation (75) not 25...
-When i killed player with lvl 140 i have got 50+25+5 rep (80rep), but not 5 rep.
2nd:
How to use doCreatureSay option for more info?
For example:
"You have added: +"v[2]" Total reputation points: "getCreatureStorage(cid, rep_storage)
LUA:
local rep_storage = 73337 --storagevalue for your rep
local REWARDS = {
{301, 50}, --everyone higher than level 301 that dies will give 50 rep
{201, 25}, --everyone higher than level 201 that dies will give 25 rep
{150, 5} --etc...
}
function onKill(cid, target, lastHit)
if isPlayer(cid) then
local level = getPlayerLevel(target)
for i, v in ipairs(REWARDS) do
if v[1] >= level then
doCreatureSetStorage(cid, rep_storage, getCreatureStorage(cid, rep_storage) + v[2])
doCreatureSay(cid, v[2], TALKTYPE_ORANGE_1)
end
end
end
return TRUE
end