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

Wysłany: 2020-10-28, 16:20


NoNamik







Wiek: 35
Na forum: 2185 dni
Posty: 289
Nick w MP: JestemNoNamem

Piwa: 374

Respekt: 60

Witam pisze tutaj poniewaz od ostatniego czasu nie dziala komenda /pm /pw oraz /w zadnych bledow w db3 nizej przesylam core jest z psrpg
s_commands.lua

function RGBToHex(redgreenbluealpha)
    if((red or red 255 or green or green 255 or blue or blue 255) or (alpha and (alpha or alpha 255))) then
        return nil
    end
    if(alphathen
        return string.format("#%.2X%.2X%.2X%.2X"red,green,blue,alpha)
    else
        return string.format("#%.2X%.2X%.2X"red,green,blue)
    end
end

local settings = {
['swearFilter'] = {
    ['enabled'] = true,
    ['swears'] = { -- Allows you to set the blocked swear wordssyntax is ['WORD'] = 'REPLACEMENT'
        ['k****'] = '****',
        ['cwel'] = '****',
        ['k****?'] = '****',
        ['c w e l'] = '****',
        ['k u r w a'] = '****',
        ['cwelem'] = '******',
        ['c w e l e m'] = '****',
        ['k u r w ?'] = '****',
        ['szmata'] = '****',
        ['dziwka'] = '****',
        ['*****'] = '****',
        ['jajebie'] = '****',
        ['j***e'] = '****',
        ['*****'] = '****',
        ['*****'] = '****',
        ['k****'] = '****',
        ['frajer'] = '****',
        ['frajerze'] = '****',
        ['*****'] = '****',
        ['ja *****'] = '****',
        ['*****'] = '****',
        ['*****'] = '****',
        ['c***'] = '****',
        ['szmato'] = '****',
        ['dziwko'] = '****',
        ['peda?'] = '****',
        ['pedal'] = '****',
        ['peda?y'] = '****',
        ['frjerzy'] = '****',
        ['frajerka'] = '****',
        ['p****'] = '****',
        ['p****'] = '****',
        ['p****'] = '****',
        ['s********j'] = '****',
        ['suka'] = '****',
        ['sukinsyn'] = '****',
        ['wyjebie'] = '****',
        ['*****'] = '****',
        ['wypierdalaj'] = '****',
        ['****'] = '****',
        ['****'] = '****',
        ['k?rwa'] = '****',
        ['k?rva'] = '****',
        ['kurva'] = '****',
        ['k***'] = '****',
        ['sukinsyn'] = '****',
        ['*****'] = '****',
        ['*****'] = '****',
        ['*****'] = '****',
        ['wypierdalajcie'] = '****',
        ['k***'] = '****',
        ['k***'] = '****',
        ['k***'] = '****',
        ['wk?rwiajcie'] = '****',
        ['fk?rwiajcie'] = '****',
        ['k***'] = '****',
        ['wk?rwiacie'] = '****',
        ['wk?rwiony'] = '****',
        ['wkurviony'] = '****',
        ['wk?rviony'] = '****',
        ['jebne'] = '****',
        ['*****'] = '****',
        ['*****'] = '****',
        ['jebni?ty'] = '****',
        ['*****'] = '****',
        ['zjebusie'] = '****',
        ['k***'] = '****',
        ['k***'] = '****',
        ['k***'] = '****',
        }
},
}

local words = {"22003",":220","78.157","23.235","22015","22010","22020","22017","mtasa://"}

function onPrivateMessage(plrcmdtarget, ...)
    if not (getElementData(plr"player:logged") == truethen return end
    if getElementData(plr,'player:mute'then outputChatBox('Posiadasz kar? wyciszenia! Uwa?asz ?e kara jest nies?uszna? Zaapeluj na forum mta-psrpg.xaa.pl.',plr) return end
    if not target or not {...} then
        outputChatBox('#007aff(&#9432;) #FFFFFFPoprawne u?ycie: /pm <nick/ID> <tre??>'plr255,255,255,true)
        outputChatBox('#007aff(&#9432;) #FFFFFFPoprawne u?ycie: /pw <nick/ID> <tre??>'plr255,255,255,true)
        outputChatBox('#007aff(&#9432;) #FFFFFFPoprawne u?ycie: /w <nick/ID> <tre??>'plr255,255,255,true)
        return
    end
    if getElementData(plr"mute:player"then
        outputChatBox("* Jeste? wyciszony!"plr)
        return
    end
    if getElementData(plr"antyspam:pw") == 2 then return end
    setElementData(plr"antyspam:pw"2)
    setTimer(function()
    setElementData(plr"antyspam:pw"false)
    end30001)
    if ninjaban(msgthen
    kickPlayer(plr"Anty-Reklama")
    triggerClientEvent(root"admin:rendering"root"* ["..getElementData(plr,"id").."]"..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").." zosta?(a) wyrzucony(a) przez System, pow?d: Reklama")
    return end
    local text=table.concat({...}, ' ')
    local target=findPlayer(plrtarget)
    if not target then
        outputChatBox("#bf0101(&#10006;) #FFFFFFNie znaleziono podanego gracza."plr255,255,255,true)
        return
    end
    if not (getElementData(target"player:logged") == truethen
        outputChatBox("#bf0101(&#10006;) #FFFFFFPodany gracz nie jest zalogowany."plr255,255,255,true)
    return end

    local pmoff=getElementData(target,"pmoff")
    if (pmoffthen
        outputChatBox("#007aff(&#9432;) #FFFFFFGracz: #007aff"..getPlayerName(target):gsub("#%x%x%x%x%x%x","").." #FFFFFFposiada w??czony tryb ignorowania wiadomo?ci prywatnych."plr255,255,255,true)
        if (type(pmoff)=="string"then
            outputChatBox("#007aff&#187; #FFFFFFPow?d ignorowania: #007aff" .. pmoffplr255,255,255,true)
        end
    return
    end

    if getElementData(plr,"pmoff"then
      outputChatBox("#007aff(&#9432;) #FFFFFFPosiadasz w??czony tryb ignorowania wiadomo?ci prywatnych. Osoba do kt?rej napisa?e?/a? nie b?dzie mog?a Ci odpisa?."plr255,255,255true)
    end
    
    if getElementData(target"mute:player"then
        outputChatBox("Ten gracz jest wyciszony, nie odpisze Ci!"plr)
        return
    end

    outputChatBox("#007aff&#187; #FFFFFF(#007aff"..getElementData(target,"id").."#FFFFFF) #007aff"..getPlayerName(target):gsub("#%x%x%x%x%x%x","").."#FFFFFF: "..text..""plr2452190true)
    outputChatBox("#007aff&#171; #FFFFFF(#007aff"..getElementData(plr,"id").."#FFFFFF) #007aff"..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").."#FFFFFF: "..text..""target2251990true)
    playSoundFrontEnd(target12)
      local pm_text=('[PM] [%d]%s(sid:%d) >> [%d]%s(sid:%d): %s'):format(getElementData(plr,"id"), getPlayerName(plr):gsub("#%x%x%x%x%x%x",""), getElementData(plr,"player:sid"), getElementData(target,"id"), getPlayerName(target):gsub("#%x%x%x%x%x%x",""), getElementData(target,"player:sid"), text)
    triggerEvent("admin:addText"resourceRootRGBToHex(255,0,0)..pm_text..RGBToHex(255,255,255),math.random(0,99))
    triggerEvent("admin:logs"rootpm_text)
    triggerClientEvent(root"onDebugMessage"resourceRootpm_text:gsub("#%x%x%x%x%x%x",""),1"PM")
    outputServerLog(pm_text)
end
addCommandHandler('pw'onPrivateMessage)
addCommandHandler('pm'onPrivateMessage)
addCommandHandler('w'onPrivateMessage)

function RGBToHex(redgreenbluealpha)
    if((red or red 255 or green or green 255 or blue or blue 255) or (alpha and (alpha or alpha 255))) then
        return nil
    end
    if(alphathen
        return string.format("#%.2X%.2X%.2X%.2X"red,green,blue,alpha)
    else
        return string.format("#%.2X%.2X%.2X"red,green,blue)
    end
end

 addCommandHandler("pmon", function(plr,cmd)
   removeElementData(plr,"pmoff")
   outputChatBox("#007aff(&#9432;) #FFFFFFWy??czono tryb ignorowania wiadomo?ci prywatnych."plr255,255,255,true)
   return
   end)

   addCommandHandler("pmoff", function(plr,cmd,...)
   local powod=table.concat({...}, ' ')
   if (not powod or string.len(powod)<2then powod=true end
   setElementData(plr"pmoff"powod)
   outputChatBox("#007aff(&#9432;) #FFFFFFW??czono tryb ignorowania wiadomo?ci prywatnych."plr255,255,255,true)
   return
   end)

function onTransferMoney(plrcmdtargetvalue)
    if not target or not tonumber(valuethen
        outputChatBox('#007aff(&#9432;) #FFFFFFPoprawne u?ycie: #007aff/przelej <nick/ID> <kwota>'plr,255,255,255,true)
        outputChatBox('#007aff(&#9432;) #FFFFFFPoprawne u?ycie: #007aff/zaplac <nick/ID> <kwota>'plr,255,255,255,true)

        return
    end
    value=string.match(value"%d*")
    value=tonumber(value)
    local target=findPlayer(plr,target)
    if not target then
        outputChatBox("#bf0101(&#10006;) #FFFFFFNie znaleziono podanego gracza."plr255,255,255,true)
        return
    end
    if not (getElementData(target"player:logged") == truethen
       outputChatBox("#bf0101(&#10006;) #FFFFFFPodany gracz nie jest zalogowany."plr255,255,255,true)
    return end
    if getPlayerMoney(plr) < value then
        outputChatBox("#bf0101(&#10006;) #FFFFFFNie posiadasz wystarczaj?cych ?rodk?w przy sobie."plr255,255,255,true)
        return
    end
    if value == or value 0 then
        outputChatBox("#bf0101(&#10006;) #FFFFFFPodano nie prawid?ow? warto??."plr255,255,255,true)
        return
    end
    
    if getElementData(plr"antyspam:przelej") == 2 then return end
    setElementData(plr"antyspam:przelej"2)
    setTimer(function()
    setElementData(plr"antyspam:przelej"false)
    end25001)
    
    takePlayerMoney(plrvalue)
    givePlayerMoney(target ,value)

    outputChatBox("#007aff(&#9432;) #FFFFFFPrzela?e?/a? got?wk? graczowi: (#007aff"..getElementData(target,"id").."#FFFFFF) #007aff"..getPlayerName(target):gsub("#%x%x%x%x%x%x","").."#FFFFFF, ilo?? przelanej got?wki: #007aff"..valueplr,  2452190true)
    outputChatBox("#007aff(&#9432;) #FFFFFFOtrzyma?e?/a? got?wk? od gracza: (#007aff"..getElementData(plr,"id").."#FFFFFF) #007aff"..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").."#FFFFFF, ilo?? otrzymanej got?wki: #007aff"..valuetarget,  2251990true)

    local transfer_text=('(Przelew) [%d]%s(sid:%d) >> [%d]%s(sid:%d): %s'):format(getElementData(plr,"id"), getPlayerName(plr):gsub("#%x%x%x%x%x%x",""), getElementData(plr,"player:sid"), getElementData(target,"id"), getPlayerName(target):gsub("#%x%x%x%x%x%x",""), getElementData(target,"player:sid"), value)
    triggerClientEvent("onDebugMessage"resourceRoottransfer_text,4"PRZELEWY")
    triggerEvent("admin:addText"resourceRootRGBToHex(203,0,255)..transfer_text..RGBToHex(255,255,255),math.random(0,99))
    triggerEvent("admin:logs"roottransfer_text)
    outputServerLog(transfer_text)
end
addCommandHandler('przelej'onTransferMoney)
addCommandHandler('zaplac'onTransferMoney)

addEventHandler("onPlayerCommand"root, function(command)
if command == "register" then cancelEvent() return end
if command == "msg" then cancelEvent() return end
if command == "Toggle" then return end
if command == "Next" then  return end
if command == "Previous" then  return end
if command == "say" then  return end
end
)

function ninjaban(ip)
    if ip == nil or type(ip) ~= "string" then
        return false
    end

    local chunks = {ip:match("(%d+)%.(%d+)%.(%d+)%.(%d+)")}
    if (#chunks == 4) then
        for _,v in pairs(chunks) do
            if (tonumber(v) < or tonumber(v) > 255then
                return false
            else
            return true
            end
        end
    else
        return false
    end

    return false
end

PS komenda typu przelej itp dziala jak wgrywalem innego cory to tez nie dzialalo

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-10-28, 16:22


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Plik po stronie serwera?

Dla pewno?ci:
- /debugscript 3
- /cleardebug
- /restart <nazwa skryptu>
- u?yj komendy, kt?ra rzekomo nie dzia?a i wy?lij zdj?cie debugu nawet jak nie b?dzie tam nic zwi?zanego (albo nic nie b?dzie)

Mo?esz tak?e w warunki wprowadza? funkcje

Więcej informacji znajdziesz w Wikipedii MTA:

outputDebugString

w celu odnalezienia miejsca, w kt?rym kod przestaje si? wykonywa?.

Mo?esz tak?e poczyta?:

Więcej informacji znajdziesz w Wikipedii MTA:

Debugging


Ostatnio zmieniony przez Wilq 2020-10-28, 16:28, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
NoNamik
Wysłany: 2020-10-28, 16:28


NoNamik







Wiek: 35
Na forum: 2185 dni
Posty: 289
Nick w MP: JestemNoNamem

Piwa: 374

Respekt: 60

tak plik po stronie serwera o to ss jak widac nic sie nie pojawilo w db3 po wpisanu lecz po restarcie sie pojawilo tylko warning https://imgur.com/XEa0DzY

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-10-28, 16:29


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

No to poka? ten plik. Zastosuj te porady debugowania i w ka?dy warunek w tej komendzie wklej jaki? outputDebugString.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-10-28, 16:36


NoNamik







Wiek: 35
Na forum: 2185 dni
Posty: 289
Nick w MP: JestemNoNamem

Piwa: 374

Respekt: 60

dobra okazalo sie ze wystarczy usunac z tego linijke
if not (getElementData(plr"player:logged") == truethen return end

i juz dziala zamykam temat dziekuje za pomoc

Postaw piwo autorowi tego posta
 

 
Tagi: nie :: dziala :: komenda :: /pm :: /pw
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Nie dziala komenda /pm /pw /w 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