• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TalkAction Reward players for a Mistake

/reward 2160, 100

Lua:
function onSay(cid, words, param, channel)  
    local t = string.explode(param, ",")
    for _, cid in ipairs(getPlayersOnline()) do
        if(getNotationsCount(getPlayerAccount(cid)) < 1) then
            doPlayerAddItem(cid, t[1], t[2] or 1)
            doBroadcastMessage("Everyone have been rewarded ".. t[2] .."x ".. getItemNameById(t[1]) .." from ".. getCreatureName(cid) .." due to a server mistake."), MESSAGE_STATUS_EVENT)             
        end
    end
    return true
end

Good script mate! Thanks! :thumbup:
 
Code:
-- Cykestyled
function onSay(cid, words, param, channel)
	local t = string.explode(param, ",")
	if (#t < 2) then return end

	for _, pid in ipairs(getPlayersOnline()) do
		return getNotationsCount(getPlayerAccount(pid)) < 1 and doPlayerAddItem(pid, t[1], 1), doPlayerSendTextMessage(pid, MESSAGE_INFO_DESCR, Everyone have been rewarded a "..getItemNameById(t[1]).." by "..getCreatureName(cid).." for the reason: "..tostring(t[2]).."."), doSendMagicEffect(getCreaturePosition(pid), CONST_ME_GIFT_WRAPS)
	end
	return true
end
 
Code:
-- Cykestyled
function onSay(cid, words, param, channel)
	local t = string.explode(param, ",")
	if (#t < 2) then return end

	for _, pid in ipairs(getPlayersOnline()) do
		return getNotationsCount(getPlayerAccount(pid)) < 1 and doPlayerAddItem(pid, t[1], 1), doPlayerSendTextMessage(pid, MESSAGE_INFO_DESCR, Everyone have been rewarded a "..getItemNameById(t[1]).." by "..getCreatureName(cid).." for the reason: "..tostring(t[2]).."."), doSendMagicEffect(getCreaturePosition(pid), CONST_ME_GIFT_WRAPS)
	end
	return true
end

Rox _/
 
Code:
-- Cykestyled
function onSay(cid, words, param, channel)
	local t = string.explode(param, ",")
	if (#t < 2) then return end

	for _, pid in ipairs(getPlayersOnline()) do
		return getNotationsCount(getPlayerAccount(pid)) < 1 and doPlayerAddItem(pid, t[1], 1), doPlayerSendTextMessage(pid, MESSAGE_INFO_DESCR, Everyone have been rewarded a "..getItemNameById(t[1]).." by "..getCreatureName(cid).." for the reason: "..tostring(t[2]).."."), doSendMagicEffect(getCreaturePosition(pid), CONST_ME_GIFT_WRAPS)
	end
	return true
end
lol, did that just become a meme?
and why return true in the end?
 
Well this is a little script that im just messing around with ipairs learning etc, (By the help of Cykotitan) So basically what the script does is a GM chooses a item and a reason why every player except players with notations get the item.

Lua:
function onSay(cid, words, param, channel)  
local t = string.explode(param, ",")
local gm = getCreatureName(cid)
for _, cid in ipairs(getPlayersOnline()) do
local accId = getPlayerAccount(cid)
if(getNotationsCount(accId) < 1) then
    doPlayerAddItem(cid, t[1], 1)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Everyone have been rewarded a "..getItemNameById(t[1]).." by "..gm.." for the reason: "..tostring(t[2])..".")
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)       
end
end
return TRUE
end

Code:
/reward 2160, The server crashed so everyone is rewarded a crystal coin.

Lua:
19:26 Everyone have been rewarded a crystal coin by Chris for the reason: The server crashed so everyone is rewarded a crystal coin.


how do i install this. need it ;)
 
Well this is a little script that im just messing around with ipairs learning etc, (By the help of Cykotitan) So basically what the script does is a GM chooses a item and a reason why every player except players with notations get the item.

Lua:
function onSay(cid, words, param, channel)  
    local t = string.explode(param, ",")
    local gm = getCreatureName(cid)
    for _, cid in ipairs(getPlayersOnline()) do
        local accId = getPlayerAccount(cid)
        if(getNotationsCount(accId) < 1) then
            doPlayerAddItem(cid, t[1], 1)
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Everyone have been rewarded a "..getItemNameById(t[1]).." by "..gm.." for the reason: "..tostring(t[2])..".")
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)           
        end
    end
    return TRUE
end

Code:
/reward 2160, The server crashed so everyone is rewarded a crystal coin.

Lua:
19:26 Everyone have been rewarded a crystal coin by Chris for the reason: The server crashed so everyone is rewarded a crystal coin.

Can upgrade for 1.x tfs please?
 
Back
Top