SeRoN
Banned User
- Joined
- Feb 6, 2012
- Messages
- 760
- Reaction score
- 32
guys, today i will share 3 amazing scripts for highexp Ots :
if you interested , add Rep ++
1,2. !myhp - !mymp
<talkaction words="!myhp" script="myhp.lua"/>
<talkaction words="!mymp" script="mymana.lua"/>
myhp.lua :
mymana.lua :
3. !myrebirth
<talkaction log="yes" words="!rep;!myrep;!rankrep;!rep-" event="script" value="rep.lua"/>
rep.lua :
if you interested , add Rep ++
1,2. !myhp - !mymp
<talkaction words="!myhp" script="myhp.lua"/>
<talkaction words="!mymp" script="mymana.lua"/>
myhp.lua :
PHP:
function onSay(cid, words, param)
local health = getCreatureHealth(cid)
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_ORANGE, "You Have "..health.." health points.")
end
mymana.lua :
PHP:
function onSay(cid, words, param)
local mana = getCreatureMana(cid)
doPlayerSendTextMessage(cid,MESSAGE_STATUS_CONSOLE_BLUE, "You Have "..mana.." mana points.")
end
3. !myrebirth
<talkaction log="yes" words="!rep;!myrep;!rankrep;!rep-" event="script" value="rep.lua"/>
rep.lua :
PHP:
local configs = {
rephours = 24 -- qntas em qntas horas pode dar rep, 24 para 1 dia.
}
function getTime(s)
local n = math.floor(s / 60)
s = s - (60 * n)
return n, s
end
function onSay(cid, words, param)
local cd = math.ceil(configs.rephours/2)
local storage = 6002
if words == "!rep" then
if getPlayerStorageValue(cid, storage) - os.time() <= 0 then
if getPlayerByName(param) then
local p = getPlayerByName(param)
if getPlayerIp(cid) ~= getPlayerIp(p) and getPlayerAccount(cid) ~= getPlayerAccount(p) then
setPlayerStorageValue(p, 6001, getPlayerStorageValue(p, 6001) + 1)
doPlayerSendTextMessage(cid, 27, "You gave reputation + 1 for " .. getCreatureName(p) .. ".")
doPlayerSendTextMessage(p, 21, "You received reputation + 1 of ".. getCreatureName(cid) ..".")
if getPlayerAccess(cid) == 1 then
setPlayerStorageValue(cid, storage, 3600*cd + os.time())
end
else
doPlayerSendTextMessage(cid, 27, "IP ACCOUNT PROTECT.")
end
else
doPlayerSendTextMessage(cid, 27, "Player Not Found.")
end
else
doPlayerSendTextMessage(cid, 27, "Wait " .. configs.rephours .. " fours for the next rep.")
end
elseif words == "!rep-" then
if getPlayerAccess(cid) > 1 then
if getPlayerByName(param) then
if getPlayerIp(cid) ~= getPlayerIp(getPlayerByName(param)) and getPlayerAccount(cid) ~= getPlayerAccount(getPlayerByName(param)) then
setPlayerStorageValue(getPlayerByName(param), 6001, getPlayerStorageValue(getPlayerByName(param), 6001) - 1)
doPlayerSendTextMessage(cid, 27, "You gave reputation - 1 for ".. getCreatureName(getCreatureByName(param)) .. ".")
doPlayerSendTextMessage(getCreatureByName(param), 27, "You received reputation - 1 for ".. getCreatureName(cid) .. ".")
else
doPlayerSendCancel(cid, "IP ACCOUNT PROTECT.")
end
else
doPlayerSendTextMessage(cid, 27, "Player Not Found.")
end
else
doPlayerSendTextMessage(cid, 27, "You must be at least Tutor to negative someone.")
end
elseif words == "!myrep" then
return doPlayerSendTextMessage(cid, 27, "My Reputation : " .. getPlayerStorageValue(cid, 6001))
elseif words == "!rankrep" then
local e = getPlayersOnline()
local text = ""
for _, pid in ipairs(e) do
text = text .. "[" .. getCreatureName(pid) .. "] Reputation: " .. getPlayerStorageValue(pid, 6001) .. "\n\n"
end
text = "[RANK REPUTATION ONLINES]\n\n" .. text
doShowTextDialog(cid, 2525, text)
end
return TRUE
end
Rep ++