addCommandHandler("pmoff", function(plr,cmd,...)
local arg = {...}
local powod=table.concat(arg," ")
if (not powod or string.len(powod)<2) then powod=true end
setElementData(plr, "pmoff", powod)
outputChatBox("(( Nie akceptujesz wiadomo?ci PM. ))", plr)
return
end)
Podmieni?em i dalej nie dzia?a . Tu jest caly kod jak teraz wygl?da:
--[[
Komendy dla gracza: /zaplac, /pm
@copyright 2013-2014 Split <split@go-life.pl>
@author Split <split@go-life.pl>
Nie masz prawa u?ywac tego kodu bez mojej zgody.
Napisz do mnie by? mo?e si? zgodz? na u?ycie kodu.
]]--
function prywatnaWiadomosc(plr, cmd, cel, ...)
if getElementData(plr, "gracz_mute") == 1 then
outputChatBox("* Jeste? wyciszony i nie mo?esz pisa? prywatnych wiadomo?ci.", plr, 255, 0, 0)
return
end
if (#arg<=0 or (not cel)) then
outputChatBox("* U?yj: /pm <nick/ID> <tresc>", plr)
return
end
local target = znajdzGracza(plr, cel)
local tresc = table.concat(arg, " ")
if not(target) then
outputChatBox("* Nie znaleziono gracza o podanym ID/nicku!", plr)
return
end
--[[
local pmoff=getElementData(target,"pmoff")
if (pmoff) then
outputChatBox(getPlayerName(target).." nie akceptuje wiadomo?ci PM.", plr)
if (type(pmoff)=="string") then
outputChatBox("Pow?d: " .. pmoff, plr)
end
return
end
if getElementData(plr,"pmoff") then
outputChatBox("Posiadasz wy??czone wiadomo?ci PM. Ta osoba nie b?dzie mog?a Ci odpisa?.", plr)
end
if getElementData(target, "gracz_mute") == 1 then
outputChatBox("* Ten gracz jest wyciszony, nie odpisze ci!", plr)
return
end
addCommandHandler("pmon", function(plr,cmd)
removeElementData(plr,"pmoff")
outputChatBox("(( Akceptujesz wszystkie wiadomo?ci PM. ))", plr)
return
end)
addCommandHandler("pmoff", function(plr,cmd,...)
local arg = {...}
local powod=table.concat(arg," ")
if (not powod or string.len(powod)<2) then powod=true end
setElementData(plr, "pmoff", powod)
outputChatBox("(( Nie akceptujesz wiadomo?ci PM. ))", plr)
return
end)
--]]
outputChatBox("#DDDDDDpw << #0066FF"..getPlayerName(plr).."(#DDDDDD"..getElementData(plr, "id").."#0066FF): #DDDDDD".. tresc, target,255,0,0,true)
outputChatBox("#DDDDDDpw >> #0066FF"..getPlayerName(target).."(#DDDDDD"..getElementData(target, "id").."#0066FF): #DDDDDD".. tresc, plr,255,0,0,true)
playSoundFrontEnd(target, 12)
outputDebugString("pw << "..getPlayerName(plr).. " ".. tresc)
end
addCommandHandler("pm", prywatnaWiadomosc)
addCommandHandler("pw", prywatnaWiadomosc)
function zaplacPieniadze(plr, cmd, cel, value)
if not(value or cel) then
outputChatBox("#0066FF* U?yj: /przelej <nick/ID> <kwota>", plr,255,0,0,true)
return
end
local target = znajdzGracza(plr, cel)
if not(target) then
outputChatBox("#0066FF* Nie znaleziono gracza o podanym ID/nicku!", plr,255,0,0,true)
return
end
if tonumber(value) < 0 then return end
if (not tonumber(value)) then return end
if getPlayerMoney(plr) < tonumber(value) then
outputChatBox("#0066FF* Nie posiadasz wystarczaj?cej ilo?ci pieni?dzy!", plr, 255, 0, 0,true)
return
end
takePlayerMoney(plr, tonumber(value))
givePlayerMoney(target, tonumber(value))
outputChatBox("#0066FF* Gracz #DDDDDD"..getPlayerName(plr).." #0066FFprzekazuje Ci #DDDDDD"..tonumber(value).." #FF007EZ?.", target,255,0,0,true)
outputChatBox("* #0066FFPrzekazujesz #DDDDDD"..tonumber(value).." #0066FFZ? graczowi #DDDDDD"..getPlayerName(target).."", plr ,255,0,0,true)
end
addCommandHandler("przelej", zaplacPieniadze)
addCommandHandler("zaplac", zaplacPieniadze)
addCommandHandler("dajkase", zaplacPieniadze)
--[[
Komendy dla gracza: /zaplac, /pm
@copyright 2013-2014 Split <split@go-life.pl>
@author Split <split@go-life.pl>
Nie masz prawa u?ywac tego kodu bez mojej zgody.
Napisz do mnie by? mo?e si? zgodz? na u?ycie kodu.
]]--
function prywatnaWiadomosc(plr, cmd, cel, ...)
if getElementData(plr, "gracz_mute") == 1 then
outputChatBox("* Jeste? wyciszony i nie mo?esz pisa? prywatnych wiadomo?ci.", plr, 255, 0, 0)
return
end
if (#arg<=0 or (not cel)) then
outputChatBox("* U?yj: /pm <nick/ID> <tresc>", plr)
return
end
local target = znajdzGracza(plr, cel)
local tresc = table.concat(arg, " ")
if not(target) then
outputChatBox("* Nie znaleziono gracza o podanym ID/nicku!", plr)
return
end
local pmoff=getElementData(target,"pmoff")
local powod=table.concat(arg," ")
if (pmoff) then
outputChatBox(getPlayerName(target).." nie akceptuje wiadomo?ci PM.", plr)
if (type(pmoff)=="string") then
outputChatBox("Pow?d: " .. pmoff, plr)
end
return
end
if getElementData(plr,"pmoff") then
outputChatBox("Posiadasz wy??czone wiadomo?ci PM. Ta osoba nie b?dzie mog?a Ci odpisa?.", plr)
end
if getElementData(target, "gracz_mute") == 1 then
outputChatBox("* Ten gracz jest wyciszony, nie odpisze ci!", plr)
return
end
addCommandHandler("pmon", function(plr,cmd)
removeElementData(plr,"pmoff")
outputChatBox("(( Akceptujesz wszystkie wiadomo?ci PM. ))", plr)
return
end)
addCommandHandler("pmoff", function(plr,cmd,...)
local powod=table.concat(arg,"")
if (not powod or string.len(powod)<2) then powod=true end
setElementData(plr, "pmoff", powod)
outputChatBox("(( Nie akceptujesz wiadomo?ci PM. ))", plr)
return
end)
--]]
outputChatBox("#DDDDDDpw << #0066FF"..getPlayerName(plr).."(#DDDDDD"..getElementData(plr, "id").."#0066FF): #DDDDDD".. tresc, target,255,0,0,true)
outputChatBox("#DDDDDDpw >> #0066FF"..getPlayerName(target).."(#DDDDDD"..getElementData(target, "id").."#0066FF): #DDDDDD".. tresc, plr,255,0,0,true)
playSoundFrontEnd(target, 12)
outputDebugString("pw << "..getPlayerName(plr).. " ".. tresc)
end
addCommandHandler("pm", prywatnaWiadomosc)
addCommandHandler("pw", prywatnaWiadomosc)
function zaplacPieniadze(plr, cmd, cel, value)
if not(value or cel) then
outputChatBox("#FF007E* U?yj: /przelej <nick/ID> <kwota>", plr,255,0,0,true)
return
end
local target = znajdzGracza(plr, cel)
if not(target) then
outputChatBox("#FF007E* Nie znaleziono gracza o podanym ID/nicku!", plr,255,0,0,true)
return
end
if tonumber(value) < 0 then return end
if (not tonumber(value)) then return end
if getPlayerMoney(plr) < tonumber(value) then
outputChatBox("#FF007E* Nie posiadasz wystarczaj?cej ilo?ci pieni?dzy!", plr, 255, 0, 0,true)
return
end
takePlayerMoney(plr, tonumber(value))
givePlayerMoney(target, tonumber(value))
outputChatBox("#FF007E* Gracz #DDDDDD"..getPlayerName(plr).." #FF007Eprzekazuje Ci #DDDDDD"..tonumber(value).." #FF007EZ?.", target,255,0,0,true)
outputChatBox("* #FF007EPrzekazujesz #DDDDDD"..tonumber(value).." #FF007EZ? graczowi #DDDDDD"..getPlayerName(target).."", plr ,255,0,0,true)
end
addCommandHandler("przelej", zaplacPieniadze)
addCommandHandler("zaplac", zaplacPieniadze)
addCommandHandler("dajkase", zaplacPieniadze)
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach