Com esse script você pode presentear os players que estão online no seu server, usando o comando /bonus ou !bonus nome do item e se for itens agrupáveis exemplo dinheiro, potions, runas, arrows, bolts e etc você coloca o numero depois de uma virgula, irá ficar assim "/bonus crystal coin, 50" você dará 50 Crystais Coin para todos os players ONLINE !
Passo a Passo:
1º Crie um arquivo chamado bonusall.lua em data/talkactions/scripts e cole isso dentro dele:
-- By: Alemaooxd
function onSay(cid, words, param, channel)
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
return true
end
for _, pid in ipairs(getPlayersOnline()) do
local t = string.explode(param, ",")
local ret = RETURNVALUE_NOERROR
local pos = getCreaturePosition(cid)
local id = tonumber(t[1])
if(not id) then
errors(false)
id = getItemIdByName(t[1])
errors(true)
if(not id) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Item com esse nome não existe.")
return true
end
end
amount = t[2]
if(not t[2]) then
amount = 1
end
local item = doCreateItemEx(id, amount)
if(t[3] and getBooleanFromString(t[3])) then
if(t[4] and getBooleanFromString(t[4])) then
pos = getCreatureLookPosition(cid)
end
ret = doTileAddItemEx(pos, item)
else
doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, "O "..getCreatureName(cid).." deu ("..amount.."x) "..getItemNameById(id).." para os players que estao online.")
ret = doPlayerAddItemEx(pid, item, true)
end
if(ret ~= RETURNVALUE_NOERROR) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Couldn't add item: " .. t[1])
return true
end
doDecayItem(item)
if(not isPlayerGhost(cid)) then
doSendMagicEffect(pos, CONST_ME_MAGIC_RED)
end
end
return true
end
2º Vá em data/talkactions/talkactions.xml e adicione está tag:
<talkaction words="!bonus;/bonus" access="5" event="script" value="bonusall.lua"/>
Pronto seu script está terminado!
Test:
11:54 /bonus crystal coin, 50
11:54 O [ADM] BBSZ deu (50x) crystal coin para todos os players online.
11:55 /bonus slingshot
11:55 O [ADM] BBSZ deu (1x) slingshot para todos os players online.
Creditos:
TFS Team
Alemaooxd
--> BRUNOCARVALHO <---
Se te ajudei da um "Rep +" Não dói não Dr.