• 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 [HIT!] add items for all online players - by Dubler

Dubler

PHP, LUA, C++
Joined
Aug 3, 2009
Messages
268
Reaction score
11
Location
Poland
Soo... this script will give items for all online players....
to /data/talkactions/talkactions.xml add:
Code:
	<talkaction words="/additem" acces="5" event="script" value="additem.lua"/>

to /data/talkactions/scripts/additem.lua add:
Code:
function onSay(cid, words, param, channel) -- Script by Dubler, written for megaevo.net
local t = string.explode(param, ",")
if t[1] ~= nil and t[2] ~= nil then
local list = {}
for i, tid in ipairs(getPlayersOnline()) do -- Script by Dubler, written for megaevo.net
	list[i] = tid
end
for i = 1, #list do
doPlayerAddItem(list[i],t[1],t[2])
doBroadcastMessage(getPlayerName(cid) .. " has given reward: " .. t[2] .." ".. getItemNameById(t[1]) .. " for all players!")
end -- Script by Dubler, written for megaevo.net
else
doPlayerPopupFYI(cid, "No parm...\nSend:\n /itemadd itemid,how_much_items\nexample:\n /itemadd 2160,10")
end
return true
end -- Script by Dubler, written for megaevo.net
1024886.jpeg


script by me, written for Megaevo.net
1020927.jpeg
 
Lua:
function onSay(cid, words, param, channel) -- Script by Dubler, modified by Darkhaos, written for megaevo.net
	local t = string.explode(param, ",")
	if t[1] ~= nil and t[2] ~= nil then
		for _, tid in ipairs(getPlayersOnline()) do -- Script by Dubler, modified by Darkhaos, written for megaevo.net
			doPlayerAddItem(tid,t[1],t[2])
		end
		return doBroadcastMessage(getPlayerName(cid) .. " has given reward: " .. t[2] .." ".. getItemNameById(t[1]) .. " for all players!")
	else
		return doPlayerPopupFYI(cid, "No param...\nSend:\n /itemadd itemid,how_much_items\nexample:\n /itemadd 2160,10")
	end
	return true
end -- Script by Dubler, modified by Darkhaos, written for megaevo.net
 
Mini Lotto ;D
Random Prizes to All Online Players with Above of choosen level ;D (Didn't tested it lolz XD)

Lua:
-- Made by Leon Zawodowiec --
local config = {
    minLevel = 1
}

function onSay(cid, words, param, channel)
    local items = {
                    [1] = {2160, 10},
                    [2] = {2160, 20},
                    [3] = {2160, 50}
                  }
                  
    for _, pid in ipairs(getPlayersOnline()) do
        if getPlayerLevel(pid) >= config.minLevel then
            wylosowany = math.random(1, #items)
            doPlayerAddItem(pid, items[wylosowany][1], items[wylosowany][2], true)
            doPlayerSendTextMessage(pid, MESSAGE_INFO_DESCR, "You won ".. items[wylosowany][2] .."x ".. getItemNameById(items[wylosowany][1]) ..". Congratulations !")
        end
    end
return true
end
 
@OP
learn to use tabs!!!!!!!!

Lua:
function onSay(cid, words, param, channel) -- Script by Dubler, modified by Darkhaos, written for megaevo.net
	local t = string.explode(param, ",")
	if t[1] ~= nil and t[2] ~= nil then
		for _, tid in ipairs(getPlayersOnline()) do -- Script by Dubler, modified by Darkhaos, written for megaevo.net
			doPlayerAddItem(tid,t[1],t[2])
		end
		return doBroadcastMessage(getPlayerName(cid) .. " has given reward: " .. t[2] .." ".. getItemNameById(t[1]) .. " for all players!")
	else
		return doPlayerPopupFYI(cid, "No param...\nSend:\n /itemadd itemid,how_much_items\nexample:\n /itemadd 2160,10")
	end
	return true
end -- Script by Dubler, modified by Darkhaos, written for megaevo.net

nice clean up =] it looks good
 
Back
Top