• 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

Sync

Ø,ø
Joined
May 26, 2009
Messages
1,901
Reaction score
26
Location
Canada
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.
 
Last edited:
Good, but I used to punish my corrupt players lmao
 
@Chris:
getPlayerAccountId already exists in 0.3.5 :p
 
never heard speak in this task

Code:
        local t = string.explode(param, ",")
        local gm
        for _, cid in ipairs
 
/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
 
Last edited:
/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]) .." by ".. getCreatureName(cid) .."."), MESSAGE_STATUS_EVENT)             
        end
    end
    return true
end
Wannabe? Also that script isn't noob-friendly. Not saying that it should be.
 
MM recive Item one for account or for player?

All PLayer offline and online?

Xml? PLeased.
 
It's a usefull script.
Appreciate it. Rep++ (JDB and Sync)
 
Last edited:
Thank you, very usefull, but you should modify, what if you have offline players who suffered the crash?.

Thank you!! :D
 
Back
Top