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

Wysłany: 2017-03-17, 15:33


dida102

LUA To moja Pasja






Wiek: 25
Na forum: 3612 dni
Posty: 86
Nick w MP: Remi

Piwa: 642

Respekt: 20

Ostrzeżeń: 100%
Witam mam paczke Sky life i nie dzia?a pw pisze Nie znaleziono gracza o podanym id

function onPlayerChatSend(msg,type)
if type == 0 then
cancelEvent()
if ninjaban(msgthen
cancelEvent()
triggerClientEvent(root"admin:rendering"root"* "..getPlayerName(source):gsub("#%x%x%x%x%x%x","").."("..getElementData(source,"id")..") zosta? wyrzucony przez ANTY-REKLAMA")
kickPlayer (source"ANTY-REKLAMA")
return end
if getElementData(source"gracz_mute"then
         outputChatBox("* Jeste? wyciszony!"source)
   return
end
if not getElementData(source,"gracz_mute"then
triggerClientEvent("onDebugMessage"resourceRoot"("..getElementData(source,"id")..") "..getPlayerName(source):gsub("#%x%x%x%x%x%x","")..": "..msg,1"CZAT")
local xygetElementPosition(source)
local col createColSphere(xyz50)
   for i,v in ipairs(getElementsWithinColShape(col"player")) do 
   if getElementData(source,"zamaskowany"then
   outputChatBox"#FFFFFFZamaskowana osoba #FF0011( #FFFFFF"..getElementData(source,"id").."#003C05 #FF0011) :#FFFFFF "..msg,v255255255true)
   else   
   outputChatBox"#FFFFFF"..getPlayerName(source).." #FF0011( #FFFFFF"..getElementData(source,"id").."#003C05 #FF0011) :#FFFFFF "..msg,v255255255true)
   end
   end
destroyElement(col)
end
end
end
addEventHandler("onPlayerChat"getRootElement(), onPlayerChatSend)

function onPrivateMessage(plrcmdtarget, ...)
    if not (getElementData(plr"player:logged") == truethen return end
    if not target or not {...} then
        outputChatBox('* U?yj /pm <nick/ID> <tre??>'plr)
        return
    end
    if ninjaban(...) then
    kickPlayer (plr"ANTY-REKALAM")
    triggerClientEvent(root"admin:rendering"root"* "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").."("..getElementData(plr,"id")..") zosta? wyrzucony przez ANTY-REKLAMA")
    return end
    local text=table.concat({...}, ' ')
    local target=exports["ms-core"]:findPlayer(plr,target)
    if not target then
        triggerClientEvent(plr,"dodaj:powiadomienie",root,'* Nie znaleziono podanego gracza.')
        return
    end
    if not (getElementData(target"player:logged") == truethen
        triggerClientEvent(plr,"dodaj:powiadomienie",root,'* Gracz nie jest zalogowany.')
    return end
    
    local pmoff=getElementData(target,"pmoff")
    if (pmoffthen
        outputChatBox(getPlayerName(target):gsub("#%x%x%x%x%x%x","").." 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(plr"gracz_mute"then
         outputChatBox("* Jeste? wyciszony!"plr)
   return
end
if getElementData(target"zamaskowany"then
         outputChatBox("* Ta osoba jest zamaskowana!!"plr255,0,0)
   return
end
    outputChatBox(">> "..getPlayerName(target).." #FF0011( #FFFFFF"..getElementData(target,"id").."#FF0011 ) #FF0011: #ffffff"..text..""plr___true)
    outputChatBox("<< "..getPlayerName(plr).." #FF0011( #FFFFFF"..getElementData(plr,"id").."#FF0011 ) #FF0011: #ffffff"..text..""target___true) 

           
      local pm_text=('PM > %s(%d)(uid:%d) >> %s(%d)(uid:%d): %s'):format(getPlayerName(plr):gsub("#%x%x%x%x%x%x",""), getElementData(plr,"id"), getElementData(plr,"player:uid"), getPlayerName(target):gsub("#%x%x%x%x%x%x",""), getElementData(target,"id"),getElementData(target,"player:uid"), text)
    triggerClientEvent("onDebugMessage"resourceRootpm_text,3"PM")
end
addCommandHandler('pw'onPrivateMessage)
addCommandHandler('pm'onPrivateMessage)

 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({...}, ' ')
   if (not powod or string.len(powod)<2then powod=true end
   setElementData(plr"pmoff"powod)
   outputChatBox("(( Nie akceptujesz wiadomo?ci PM. ))"plr)
   return
   end)

function onTransferMoney(plrcmdtargetvalue)
    if not target or not tonumber(valuethen
        outputChatBox(' U?yj: /przelej <nick/ID> <kwota>'plr)
        return
    end
    value=string.match(value"%d*")
    value=tonumber(value)
    outputDebugString(type(value))
    local target=exports["ms-core"]:findPlayer(plr,target)
    if not target then
        triggerClientEvent(plr,"dodaj:powiadomienie",root,'* Nie znaleziono podanego gracza.')
        return
    end
    if not (getElementData(target"player:logged") == truethen
       outputChatBox('* Gracz nie jest zalogowany!'plr25500)
    return end
    if getPlayerMoney(plr) < value then
        triggerClientEvent(plr,"dodaj:powiadomienie",root,'* Nie masz wystarczajacych ?rodk?w.')
        return
    end
    if value == or value 0 then
        triggerClientEvent(plr,"dodaj:powiadomienie",root,"* Poda?e? nie prawid?ow? warto??.")
        return
    end
if getElementData(target"zamaskowany"then
         outputChatBox("* Ta osoba jest zamaskowana!!"plr255,0,0)
   return
end
    takePlayerMoney(plrvalue)
    givePlayerMoney(target ,value)

    outputChatBox("#FF0011* Przela?e? Pieni?dze graczowi: #FFFFFF"..getPlayerName(target):gsub("#%x%x%x%x%x%x","").." #FF0011( #FFFFFF"..getElementData(target,"id").." #FF0011) Ilo?? przelanej got?wki: #ffffff"..value.." Funt?w."plr,  ___true)
    outputChatBox("#FF0011* Dosta?e? pieni?dze od: #FFFFFF"..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").." #FF0011( #FFFFFF"..getElementData(plr,"id").." #FF0011) ilo?? otrzymanej got?wki: #ffffff"..value.." Funt?w."target,  ___true)

    local transfer_text=('TRANSFER> %s(%d)(uid:%d)>> %s(%d)(uid:%d): %d'):format(getPlayerName(plr):gsub("#%x%x%x%x%x%x",""), getElementData(plr,"id"), getElementData(plr,"player:uid"), getPlayerName(target):gsub("#%x%x%x%x%x%x",""), getElementData(target,"id"),getElementData(target,"player:uid"), value)
    triggerClientEvent("onDebugMessage"resourceRoottransfer_text,4"TRANSFER")
end
addCommandHandler('przelej'onTransferMoney)
addCommandHandler('zaplac'onTransferMoney)

function ninjaban(ip)
    -- must pass in a string value
    if ip == nil or type(ip) ~= "string" then
        return false
    end

    -- check for format 1.11.111.111 for ipv4
    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 

DB 3




Komentarz HazeMaFaze dodany 2017-03-17, 15:42dodano tagi lua... następnym razem dostajesz zakaz pisania
Ostatnio zmieniony przez _Haze 2017-03-17, 15:42, w całości zmieniany 2 razy  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-03-17, 18:55


luki123luki123

Place Game






Wiek: 28
Na forum: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

dida102,
local target=exports["ms-core"]:findPlayer(plr,target)


Nie masz w??czonego takiego zasobu i przez to nie dzia?a. ( "ms-core" )

Postaw piwo autorowi tego posta
 

 
Tagi: system
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