TalkAction Reward players for a Mistake

Sync

Ø,ø
Joined
May 26, 2009
Messages
1,876
Best answers
0
Reaction score
19
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:

cbrm

Top Class brunet scripter
Staff member
Global Moderator
Joined
Jan 6, 2009
Messages
6,585
Best answers
3
Reaction score
852
Location
Caribbean Sea
Good, but I used to punish my corrupt players lmao
 

chojrak

Banned User
Joined
Oct 25, 2008
Messages
5,832
Best answers
2
Reaction score
158
@Chris:
getPlayerAccountId already exists in 0.3.5 :p
 
OP
Sync

Sync

Ø,ø
Joined
May 26, 2009
Messages
1,876
Best answers
0
Reaction score
19
Location
Canada
Thanks xd
 
Last edited:

president vankk

Web Developer & AuraOT Owner
Joined
Jul 10, 2009
Messages
5,717
Best answers
8
Reaction score
285
never heard speak in this task

Code:
        local t = string.explode(param, ",")
        local gm
        for _, cid in ipairs
 

JDB

OtLand Veteran
Joined
Jun 1, 2009
Messages
4,145
Best answers
2
Reaction score
109
/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:

Cykotitan

Experienced G'
Joined
Nov 4, 2008
Messages
16,894
Best answers
4
Reaction score
817
/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.
 

Elexonic

Well-Known Member
Joined
Jun 18, 2008
Messages
1,921
Best answers
0
Reaction score
56
MM recive Item one for account or for player?

All PLayer offline and online?

Xml? PLeased.
 

Ezzam

New Member
Joined
Jan 16, 2008
Messages
213
Best answers
0
Reaction score
2
It's a usefull script.
Appreciate it. Rep++ (JDB and Sync)
 
Last edited:
OP
Sync

Sync

Ø,ø
Joined
May 26, 2009
Messages
1,876
Best answers
0
Reaction score
19
Location
Canada
Thanks for all the feedback guys.
 

Cykotitan

Experienced G'
Joined
Nov 4, 2008
Messages
16,894
Best answers
4
Reaction score
817
haha noob script flame flame flame aaaaaaaa
 

snacky

New Member
Joined
Apr 16, 2009
Messages
126
Best answers
0
Reaction score
1
Thank you, very usefull, but you should modify, what if you have offline players who suffered the crash?.

Thank you!! :D
 
Top