Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2015-09-19, 11:32


jg2aviva1

Rusek :D






Wiek: 25
Na forum: 4275 dni
Posty: 446
Nick w MP: _Wolfenstei[N]^.^

Piwa: 1034

Respekt: 240
Respekt: 240Respekt: 240

Ostrzeżeń: 60%
Cze??. Mam problem z systemem pm'ek, poniewa? dzia?a ju? /pmoff ale wiadomo?ci nie maj? spacji, czyli "/pm 1 jestem tu" wychodzi "(0): jestemtu". Wiecie co jest ?le? Stawiam :piwo:


--[[
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("#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)


Podpis



GTAO Member: 2015-08-23, 14:26

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-19, 11:57


#404







Wiek: 27
Na forum: 4912 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
O ile si? nie myl?

table.concat(arg, " ")


Tylko ja tu jeszcze nie widz? tego arg, na pewno je zdefiniowa?e? ? Masz jedynie "..."

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-19, 12:04


jg2aviva1

Rusek :D






Wiek: 25
Na forum: 4275 dni
Posty: 446
Nick w MP: _Wolfenstei[N]^.^

Piwa: 1034

Respekt: 240
Respekt: 240Respekt: 240

Ostrzeżeń: 60%
"DestroY" napisał/a:

O ile si? nie myl?

table.concat(arg, " ")


Tylko ja tu jeszcze nie widz? tego arg, na pewno je zdefiniowa?e? ? Masz jedynie "..."


Ja w?a?nie nie wiem co jest ?le, bo kolega mi to wys?a?

[ Dodano: 2015-09-19, 12:38 ]
OK, dzia?a ale jeszcze taki problem. Jak wpisz? /pmoff to mam spam wiadomo?ci? "((Nie akceptujesz wiadomo?ci PM))" i tak samo jak wpisz? /pmon. W tym gdzie jest b??d??

Podpis



GTAO Member: 2015-08-23, 14:26

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-19, 19:53


Bingwin

LUA MTA






Wiek: 27
Na forum: 4332 dni
Posty: 95
Nick w MP: Bingwin

Piwa: 2070

Respekt: 98

Ostrzeżeń: 40%

function prywatneWiadomosci(plr, cmd, cel, ...)
    if (#arg<=0 or (not cel)) then
        outputChatBox("U?yj: /pm <nick/id> <tresc>", plr)
        return
    end
    
    local target = findPlayer(plr, cel)
    
    if (not target) then
        outputChatBox("Nie znaleziono gracza o podanym ID/nicku!", plr)
        return
    end
    
    local pwoff = getElementData(target, "pwoff")
    
    if (pwoff) then
        outputChatBox(getPlayerName(target).." nie akceptuje wiadomo?ci PW.", plr)
        if (type(pwoff)=="string") then
            outputChatBox("Pow?d: " .. pwoff, plr)
        end
        return
    end
    
    if getElementData(plr, "pwoff") then
        outputChatBox("Posiadasz wy??czone odbieranie wiadomo?ci, ta osoba nie b?dzie mog?a Ci odpisa?.", plr)
    end
    
    local tresc = table.concat(arg, " ")
    outputChatBox("<< #24BA02".. getPlayerName(plr) .."#FFF79C[".. getPlayerID(plr) .."]:#ffffff ".. tresc, target, 255, 255, 255, true )
    outputChatBox(">> #24BA02".. getPlayerName(target) .."#FFF79C["..getPlayerID(target) .."]:#ffffff ".. tresc, plr, 255, 255, 255, true )

    playSoundFrontEnd(target,12)
end
addCommandHandler("pm", prywatneWiadomosci)
addCommandHandler("pw", prywatneWiadomosci)

addCommandHandler("pmon", function(plr, cmd)
  removeElementData(plr, "pwoff")
  outputChatBox("(( Odbieranie wiadomo?ci w??czone. ))", 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, "pwoff", powod)
    outputChatBox("(( Odbieranie wiadomo?ci wy??czone. ))", plr)
    return
end)

Zamie? sobie tw?j kod na ten :) Dzia?a na 100% testowa?em :D

Podpis


RolePlayGaming - KLIKNIJ (ZEBRAKI)
Numer GG: 49514852|Skype: parabol235
Postaw piwo autorowi tego posta
 

 
Tagi: /pmoff
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » /pmoff Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

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
Dodaj temat do Ulubionych
Wersja do druku