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: 4134 dni
Posty: 445
Nick w MP: _Wolfenstei[N]^.^

Piwa: 1033

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 bymo?e sizgodzna u?ycie kodu.
]]--

function prywatnaWiadomosc(plrcmdcel, ...)
    if getElementData(plr"gracz_mute") == 1 then
        outputChatBox("* Jeste? wyciszony i nie mo?esz pisa? prywatnych wiadomo?ci."plr25500)
        return
    end
    if (#arg<=0 or (not cel)) then
        outputChatBox("* U?yj: /pm <nick/ID> <tresc>"plr)
        return
    end
    
    local target znajdzGracza(plrcel)
    local tresc table.concat(arg"")
    
    if not(targetthen
        outputChatBox("* Nie znaleziono gracza o podanym ID/nicku!"plr)
        return
    end
    
    local pmoff=getElementData(target,"pmoff")
    local powod=table.concat(arg,"")
    if (pmoffthen
      outputChatBox(getPlayerName(target).." nie akceptuje wiadomo?ci PM."plr)
      if (type(pmoff)=="string"then
        outputChatBox("Pow?d: " .. pmoffplr)
      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)<2then 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".. tresctarget,255,0,0,true)
   outputChatBox("#DDDDDDpw >> #0066FF"..getPlayerName(target).."(#DDDDDD"..getElementData(target"id").."#0066FF): #DDDDDD".. trescplr,255,0,0,true)
    playSoundFrontEnd(target12)
   outputDebugString("pw << "..getPlayerName(plr).. " ".. tresc)
end
addCommandHandler("pm"prywatnaWiadomosc)
addCommandHandler("pw"prywatnaWiadomosc)

function zaplacPieniadze(plrcmdcelvalue)
    if not(value or celthen
    outputChatBox("#0066FF* U?yj: /przelej <nick/ID> <kwota>"plr,255,0,0,true)
        return
    end
    
    local target znajdzGracza(plrcel)
    
    if not(targetthen
    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(valuethen
    outputChatBox("#0066FF* Nie posiadasz wystarczaj?cej ilo?ci pieni?dzy!"plr25500,true)
        return
    end
    
    takePlayerMoney(plrtonumber(value))
    givePlayerMoney(targettonumber(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: 26
Na forum: 4771 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: 4134 dni
Posty: 445
Nick w MP: _Wolfenstei[N]^.^

Piwa: 1033

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: 4191 dni
Posty: 95
Nick w MP: Bingwin

Piwa: 2070

Respekt: 98

Ostrzeżeń: 40%

function prywatneWiadomosci(plrcmdcel, ...)
    if (#arg<=0 or (not cel)) then
        outputChatBox("U?yj: /pm <nick/id> <tresc>"plr)
        return
    end
    
    local target findPlayer(plrcel)
    
    if (not targetthen
        outputChatBox("Nie znaleziono gracza o podanym ID/nicku!"plr)
        return
    end
    
    local pwoff getElementData(target"pwoff")
    
    if (pwoffthen
        outputChatBox(getPlayerName(target).." nie akceptuje wiadomo?ci PW."plr)
        if (type(pwoff)=="string"then
            outputChatBox("Pow?d: " .. pwoffplr)
        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 ".. tresctarget255255255true )
    outputChatBox(">> #24BA02".. getPlayerName(target) .."#FFF79C["..getPlayerID(target) .."]:#ffffff ".. trescplr255255255true )

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

addCommandHandler("pmon", function(plrcmd)
  removeElementData(plr"pwoff")
  outputChatBox("(( Odbieranie wiadomo?ci w??czone. ))"plr)
  return
end)

addCommandHandler("pmoff", function(plrcmd, ...)
    local powod table.concat(arg" ")
    if (not powod or string.len(powod)<2then 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 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