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

Wysłany: 2016-11-01, 08:03


Vintage







Wiek: 24
Na forum: 3695 dni
Posty: 64

Piwa: 1

Respekt: 45,8

Witam , gdy wchodz? na duty admin mam tylko ?cian? raport?w , a ?ciana wiadomo?ci z czatu si? nie wy?wietla licze na odpowiedz :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-01, 09:09


Emm

***** ***






Wiek: 32
Na forum: 4021 dni
Posty: 3191
Nick w MP: Emm

Piwa: 6171

Respekt: 1580
Respekt: 1580Respekt: 1580


   Administrator: Admin ma zawsze rację | REGULAMIN FORUM | REKLAMA/VIP | .
Podaj kod, nie ka?dy np. na telefonie jest w stanie pobra? sobie YA i zajrze? w kod :d

Podpis

Użytkownik: 20.10.2015r
GTAO Member: 06.03.2016r
Support-Team: 20.01.2016r
Moderator: 30.03.2016r
Mod-Team: 08.10.2016r
Vice Admin: 04.05.2018r
Administrator: 03.05.2022r


! Koniecznie zapoznaj się z regulaminem forum.
Pamiętaj, aby zawsze go przestrzegać, nie mniej ważne są również regulaminy działów, w których się wypowiadasz!
Zamiast zakładać temat po kilka razy, bo jest usuwany przez Administrację, przejrzyj regulamin i napisz poprawnie temat!
Sprawy z administracją możesz załatwiać anonimowo w tym dziale.
Najważniejsze informacje od Administracji możesz przeczytać tutaj oraz tutaj.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-01, 09:45


Vintage







Wiek: 24
Na forum: 3695 dni
Posty: 64

Piwa: 1

Respekt: 45,8

podam kod ogprg-core


base


local prison = {}
addEvent("core:spawnPlayer", true)
addEventHandler("core:spawnPlayer", root, function()
    local pos=getElementData(source,"player:spawn")
    if not pos then return end
    fadeCamera(source, true)
    spawnPlayer(source, pos[1], pos[2], pos[3])
    setCameraTarget(source,source)
    toggleControl(source,"fire", false)
    toggleControl(source,"aim_weapon", false)
    local load=loadPlayerData(source)
    if load then     triggerClientEvent(source,"addNotification",root,"* Wczytano Twoje dane","info") end
    setElementData( source, 'HS_accountName', getPlayerName(source));
    setElementData(source, "player:online", 0)
    if getElementData(source,"player:premium") then 
        local queryA=string.format("SELECT * FROM ogrpg_users WHERE id=%d AND premiumdate>NOW() LIMIT 1", getElementData(source,"player:uid"))
        local resultA=exports["ogrpg-db"]:pobierzWyniki(queryA)
        if (resultA) then
            outputChatBox("* Konto premium wa?ne do " ..resultA["premiumdate"], source)
        end
    end
end)

addEventHandler("onPlayerLogin",root,function()
if getPlayerSerial ( source ) ==  "73D0C44C3D55C429A230BB233D4F0EB4" then kickPlayer(source,"Nie posiadasz uprawnien") end
end)

setTimer(function()
    local players=getElementsByType('player')
    for _, p in pairs(players) do
            if getElementData(p, "player:online") and tonumber(getElementData(p, "player:online")) > 60 then
                if getElementData(p, "player:online") == 60 then
                    local hour = getElementData(localPlayer,"player:hours") or 0
                    setElementData(localPlayer,"player:hours",hour+1)
                end    
                setElementData(p, "player:online", 0)
                if getElementData(p, "player:premium") then
                triggerEvent("givePlayerMoney", p, 250, false)
                triggerClientEvent(p,"addNotification",root,"(Konto Premium) Dostajesz 500 PLN za przegranie 1h","info")
            end
        end
     end
end, 60000, 0)

addEventHandler("onPlayerWasted", root, function()
    plr=source
    --setTimer(fadeCamera, 300, 1, plr, false)
    if getElementData(plr,"player:job") then
        triggerClientEvent(plr,"onFinish", root, plr)
        setElementData(plr,"player:job", false)
    end
    setTimer(function()
        local pos=getElementData(plr,"player:spawn")
        if not pos then return end
        fadeCamera(plr, true)
        setElementInterior(plr,0)
        setElementDimension(plr,0)
        spawnPlayer(plr, pos[1], pos[2], pos[3])
        setCameraTarget(plr, plr)
        setElementModel(plr, getElementData(plr, "player:skin"))
    end, 60, 1)
end)
addEvent("giveSpray", true)
addEvent("takeSpray", true)
addEventHandler("giveSpray", root, function()
    giveWeapon ( source, 41, 200 )
end)

addEvent("givecamera", true)
addEventHandler("givecamera", root, function()
    giveWeapon ( source, 43, 99999999 )
end)

addEventHandler("takeSpray", root, function()
    takeWeapon ( source, 41)
end)

addCommandHandler("frraefasefasefasefasefsaef", function(playerSource )
    local pos=getElementData(playerSource ,"player:spawn")
    if not pos then return end
    fadeCamera(playerSource , true)
    setElementInterior(playerSource ,0)
    setElementDimension(playerSource,0)
    setElementPosition(playerSource , pos[1], pos[2], pos[3])
    setCameraTarget(playerSource,playerSource )
    setElementModel(playerSource, getElementData(playerSource , "player:skin"))
end)

addEventHandler("onPlayerConnect", root, function(playerNick)
    if string.find(playerNick, "#") ~= nil or string.find(playerNick, "?") ~= nil or string.find(playerNick, "!") ~= nil then
        cancelEvent(true,"Tw?j nick zawiera jeden z niedozwolonych znak?w(#,?,!), zmie? go.")
    end
end)
addEventHandler ("onPlayerJoin", root,function()
    local query=string.format("SELECT * FROM ogrpg_ban WHERE type=%q AND active=1 AND serial=%q AND time>NOW() LIMIT 1","ban", getPlayerSerial(source))
    local result=exports["ogrpg-db"]:pobierzWyniki(query)
    if (result) then
        outputConsole("***********************",source)
        outputConsole(string.format("Zostales zbanowany na serwerze! "),source)
        outputConsole(string.format("Posiadasz Bana do "..result["time"]),source)
        outputConsole(string.format("Posiadasz Bana za: "..result["reason"]),source)
        outputConsole("***********************",source)
    kickPlayer(source,string.format("Kliknij f8 aby zobaczyc wiecej informacji!"))
    else
        exports["ogrpg-db"]:dbSet("DELETE FROM ogrpg_ban WHERE type=? AND active=1 AND serial=?", "ban", getPlayerSerial(source))
    end
end)

addEventHandler("onPlayerJoin", root, function()
    if not isElement(source) then return end
    outputChatBox("Witamy na serwerze Your-Adventure RPG! je?li jeste? tu po raz pierwszy zajrzyj pod F1!", source)
    outputChatBox("Znajdziesz tam szczeg??owy poradnik", source)
end)


 addCommandHandler("closehud", function(plr,cmd)
    setElementData(plr,"notshowhud",not getElementData(plr,"notshowhud"))
   end)


addEventHandler("onResourceStart", resourceRoot, function()
    setWaveHeight(2)
    setMinuteDuration(6000)
    setMapName("RPG")
    setGameType("RPG")
end)


addEventHandler("onPlayerChangeNick", root, function() cancelEvent() end)
addEventHandler("onResourceStart", root, function() 
local players=getElementsByType('player')
for _, p in pairs(players) do
--bindKey(p, "y", "down", "chatbox", "global")
end
end)

function globalMessage(plr, cmd, ...)
    local msg = table.concat ( { ... }, " " )
    local admins=getElementsByType('player')
    for i,v in pairs(admins) do
    local s = getPlayerName(v):gsub("#%x%x%x%x%x%x","")
        if s == "epik" or s == "Truj" then
            outputChatBox("[EPICZKO-TRUJOSTWO CZATOSTWO xD] ("..getElementData(plr,"id")..") "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","")..": "..msg, v, 255, 0, 0, false)
        end
    end
end
addCommandHandler("*****", globalMessage)


setTimer(function()
    local vehicles=getElementsByType('vehicle')
    for _, vehicle in pairs(vehicles) do
        if getElementHealth(vehicle)<300 then
            setVehicleDamageProof(vehicle, true)
        elseif getElementHealth(vehicle)>301 then
            if getVehicleController (vehicle) then
            setVehicleDamageProof(vehicle, false)
            end
        end
     end
end, 500, 0)
--[[
setTimer(function()
  for i,v in ipairs(getElementsByType("player")) do
    if not getElementData(v,"player:spawn") then return end
    if isPedDead(v) then
        local pos=getElementData(v,"player:spawn")
        fadeCamera(v, true)
        setElementInterior(v,0)
        setElementDimension(v,0)
        spawnPlayer(v, pos[1], pos[2], pos[3])
        setCameraTarget(v, plr)
        setElementModel(v, getElementData(plr, "player:skin"))
    end
    if( getPlayerIdleTime(v) > 1 ) then
    setElementData(v, "player:afk", true)
    elseif ( getPlayerIdleTime(v) < 1 ) then
    setElementData(v, "player:afk", false)
    end    
  end
end, 10000, 0)



Obsluga oswietlenia drogowego
@author Lukasz Biegaj <wielebny@bestplay.pl>
@copyright 2011-2013 Lukasz Biegaj <wielebny@bestplay.pl>
@license Dual GPLv2/MIT
]]--



setTrafficLightsLocked(true)

-- 3 1 0 4

local stany={3,4,0,1}

local stan=1

local stany_nocne={6,9,6,9}

function zmianaSwiatel()
    stan=stan+1
    if (stan>#stany) then stan=1 end

    local h,m=getTime()
    if (h>=23 or m<=6) then
        setTrafficLightState(stany_nocne[stan])
        setTimer(zmianaSwiatel, 500, 1)
    else
        setTrafficLightState(stany[stan])
        setTimer(zmianaSwiatel, stan%2==1 and 15000 or 2000, 1)

    end

end


zmianaSwiatel()


chats


--[[
    Resource: OURGame
    Developers: Split <split.programista@gmail.com>
    Copyright <split.programista@gmail.com> 2015-2016
    You have no right to use this code without my permission.
]]

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

addEventHandler('onPlayerChat', root, function(msg, type)
    if not getElementData(source,"player:uid") then return end
    if not getElementData(source,"id") then return end
    if type==0 then
        cancelEvent()
        if ninjaban(msg) then
        triggerClientEvent(root, "admin:rendering", root, "* "..getPlayerName(source):gsub("#%x%x%x%x%x%x","").."("..getElementData(source,"id")..") zosta?(a) wyrzucony(a) przez system. Powod: Reklama")
        kickPlayer (source, "System:Reklama")
        return end
        if not isElement(source) then return end
        local x,y,z=getElementPosition(source)
        local sphere=createColSphere(x,y,z, 30)
        local players=getElementsWithinColShape(sphere, 'player')
        if #players==1 then
            destroyElement(sphere)
            triggerClientEvent(source,"addNotification",root,'* Nie ma ?adnego gracza w pobli?u, wi?c wiadomo?? jest niemo?liwa.',"warning")
            return
        end
        local id=getElementData(source,"id")
        local id=tonumber(id)
        if not id then return end
        for i,v in pairs(players) do
            
            outputChatBox("#2A7900(#FFFFFF"..getElementData(source,"id").."#2A7900) #FFFFFF"..getPlayerName(source)..":#FFFFFF "..msg:gsub("#%x%x%x%x%x%x",""), v, _, _, _, true)
        end
        
        destroyElement(sphere)
        local desc = string.format("Czat Lokalny> "..getPlayerName(source):gsub("#%x%x%x%x%x%x","").."(%s): "..msg:gsub("#%x%x%x%x%x%x",""),id)
        --triggerClientEvent(root, "admin:addText", root, desc)
        triggerClientEvent(root, "onDebugMessage", resourceRoot, desc,1, "CZAT")
        triggerClientEvent("onChatbubblesMessageIncome",source,msg:gsub("#%x%x%x%x%x%x",""),0)
    elseif type==1 then
        cancelEvent()
        if ninjaban(msg) then
        kickPlayer (source, "System:Reklama")
        triggerClientEvent(root, "admin:rendering", root, "* "..getPlayerName(source):gsub("#%x%x%x%x%x%x","").."("..getElementData(source,"id")..") zosta?(a) wyrzucony(a) przez system. Powod: Reklama")
        return end
        local x,y,z=getElementPosition(source)
        local sphere=createColSphere(x,y,z, 30)
        local players=getElementsWithinColShape(sphere, 'player')
        destroyElement(sphere)

        for i,v in pairs(players) do
            outputChatBox("* "..getPlayerName(source):gsub("#%x%x%x%x%x%x","").." "..msg:gsub("#%x%x%x%x%x%x",""), v, 255, 51, 102)
        end
        local q = string.format("ME >> "..getPlayerName(source).."("..getElementData(source,"id").."): "..msg:gsub("#%x%x%x%x%x%x",""))
        triggerClientEvent("onDebugMessage", resourceRoot, q,1, "/ME")
    end
end)

addCommandHandler('do', function(source, cmd, ...)
    local text=table.concat({...}, ' ')
    if not text then return end
        if ninjaban(text) then
        triggerClientEvent(root, "admin:rendering", root, "* "..getPlayerName(source):gsub("#%x%x%x%x%x%x","").."("..getElementData(source,"id")..") zosta?(a) wyrzucony(a) przez system. Powod: Reklama")
        kickPlayer (source, "System:Reklama")
        return end
    local msg=table.concat({...}, " ")
    local x,y,z=getElementPosition(source)
    local sphere=createColSphere(x,y,z, 30)
    local players=getElementsWithinColShape(sphere, 'player')
    destroyElement(sphere)

    for i,v in ipairs(players) do
        outputChatBox("*(( "..getPlayerName(source):gsub("#%x%x%x%x%x%x","").." "..msg.."))", v, 255, 51, 102)
        
    end
triggerClientEvent("onDebugMessage", resourceRoot, "*(( "..getPlayerName(source):gsub("#%x%x%x%x%x%x","").." "..msg:gsub("#%x%x%x%x%x%x","").."))",1, "/ME")
end)

--function globalMessage(thePlayer, cmd, ...)
    --if getElementData(thePlayer, "player:premium") == false then outputChatBox("Musisz posiada? status premium by pisa? na czacie globalnym!",thePlayer) return end
    --local message = table.concat ( { ... }, " " )
    --local name = getPlayerName(thePlayer)
    --outputChatBox("#FF0000[GLOBAL]#00FF00"..name..": #FFFFFF"..message, getRootElement(), 255, 255, 255, true)
    --end
--addCommandHandler("global", globalMessage)



addCommandHandler('vmoje', function(plr, cmd)
    local uid=getElementData(plr,'player:uid')
    if not uid then return end
    outputChatBox('* Twoje pojazdy (zrespione na mapie): ', plr)
    outputChatBox('====================================', plr)

    local vehicles=getElementsByType('vehicle')
    for i,v in pairs(vehicles) do
        if getElementData(v,'vehicle:ownedPlayer') and getElementData(v,'vehicle:ownedPlayer')==uid then
            outputChatBox("* Nazwa: "..getVehicleNameFromModel(getElementModel(v))..", ID: "..getElementData(v,"vehicle:id"), plr)
        end
    end
end)


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) < 0 or tonumber(v) > 255) then
                return false
            else
            return true
            end
        end
    else
        return false
    end

    return false
end


cmd


--[[
    Resource: OURGame v2
    Developers: Split | Yolos 
    You have no right to use this code without permission.
    (c) 2016  All rights reserved.
]]

function onPrivateMessage(plr, cmd, target, ...)
    if not (getElementData(plr, "player:logged") == true) then return end
    if not target or not {...} then
        outputChatBox('* U?yj /pm <nick/ID> <tre??>', plr)
        return
    end
    if ninjaban(...) then
    triggerClientEvent(root, "admin:rendering", root, "* "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").."("..getElementData(plr,"id")..") zosta?(a) wyrzucony(a) przez system. Powod: Reklama")
    kickPlayer (plr, "System:Reklama")
    return end
    local text=table.concat({...}, ' ')
    local target=findPlayer(plr, target)
    if not target then
        triggerClientEvent(plr,"addNotification",root,'* Nie znaleziono podanego gracza.',"error")
        return
    end
    if not (getElementData(target, "player:logged") == true) then
        triggerClientEvent(plr,"addNotification",root,'* Gracz nie jest zalogowany.',"error")
    return end
    
    local pmoff=getElementData(target,"pmoff")
    if (pmoff) then
        outputChatBox(getPlayerName(target):gsub("#%x%x%x%x%x%x","").." 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
    
    outputChatBox("#2A7900<< "..getPlayerName(target):gsub("#%x%x%x%x%x%x","").."("..getElementData(target,"id").."): #ffffff"..text.."", plr, _, _, _, true)
    outputChatBox("#2A7900>> "..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").."("..getElementData(plr,"id").."): #ffffff"..text.."", target, _, _, _, true) 

           
      local pm_text=('Czat Prywatny> %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)
    triggerEvent("admin:logs", root, pm_text)
 --   triggerClientEvent(root, "admin:addText", root, pm_text)
    triggerClientEvent("onDebugMessage", resourceRoot, pm_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)<2) then powod=true end
   setElementData(plr, "pmoff", powod)
   outputChatBox("(( Nie akceptujesz wiadomo?ci PM. ))", plr)
   return
   end)
    

function onTransferMoney(plr, cmd, target, value)
    if not target or not tonumber(value) then
        outputChatBox(' U?yj: /przelej <nick/ID> <kwota>', plr)
        return
    end
    value=tonumber(value)
    local target=findPlayer(plr,target)
    if not target then
        triggerClientEvent(plr,"addNotification",root,'* Nie znaleziono podanego gracza.',"error")
        return
    end
    if not (getElementData(target, "player:logged") == true) then
       outputChatBox('* Gracz nie jest zalogowany!.', plr, 255, 0, 0)
    return end
    if getPlayerMoney(plr) < value then
        triggerClientEvent(plr,"addNotification",root,'* Nie masz wystarczajacych ?rodk?w.',"error")
        return
    end
    if value == 0 or value < 0 then
        triggerClientEvent(plr,"addNotification",root,'* Poda?e? nie prawid?ow? warto??.',"error")
        return
    end
    takePlayerMoney(plr, value)
    givePlayerMoney(target ,value)

    outputChatBox("#2A7900* Przela?e? Pieni?dze graczowi: #ffffff"..getPlayerName(target):gsub("#%x%x%x%x%x%x","").."("..getElementData(target,"id")..") #2A7900Ilo?? przelanej got?wki: #ffffff"..value, plr,  _, _, _, true)
    outputChatBox("#2A7900* Dosta?e? pieni?dze od: #ffffff"..getPlayerName(plr):gsub("#%x%x%x%x%x%x","").."("..getElementData(plr,"id")..") #2A7900ilo?? otrzymanej got?wki: #ffffff"..value, 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(root, "admin:addText", root, transfer_text)
    triggerClientEvent("onDebugMessage", resourceRoot, transfer_text,4, "TRANSFER")
    triggerEvent("admin:logs", root, 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
--if getElementData(source, "player:admin") then
--triggerEvent("admin:logs", root, "Admin> /"..tostring(command).." Nick:"..getPlayerName(source).." UID("..getElementData(source, "player:uid")..")")
--end
end
)


dmg_c



--[[
Developed by Yolos 
All rights reserved!
You cannot use this without permission!
--]]
addEvent("playTTS", true)
local function playTTS(text, lang)
    local URL = "http://translate.google.com/translate_tts?tl=" .. lang .. "&q=" .. text
    return true, playSound(URL), URL
end
addEventHandler("playTTS", root, playTTS)
addEventHandler( "onClientElementStreamIn", root,
    function ( )
        if getElementType( source ) == "object" then
            setObjectBreakable(source, false)
        end
end)
addEvent("setBreakable",true)
addEventHandler("setBreakable",root,function(obj)
setObjectBreakable(obj, false)
end)


addEvent("addNotification",true)
addEventHandler("addNotification",root,function(tekst,typ)
if not tekst then return end
if not typ then return end
outputChatBox(tekst)
end)

addEvent("addNotificatione",true)
addEventHandler("addNotificatione",root,function(tekst,typ)
if not tekst then return end
if not typ then return end
exports['notices']:addNotification(tekst,typ)
end)
local function getAverageFPSOfFPSArray(table)
    -- Average FPS = (FPS1 + FPS2 + ... + FPSX) / X
    local totalFPS = 0
    for _, fps in ipairs(table) do
        totalFPS = totalFPS + fps
    end
    return totalFPS / #table
end
 
local currentSecondFPS = {}
local lastSecondTicks = getTickCount()
local lastFiveSecondsFPS = {}
local function smoothFPS()
    -- Do we have a FPS rate already?
    if not getCurrentFPS() then
        return
    end
    -- Insert current FPS into a table for reference
    table.insert(currentSecondFPS, getCurrentFPS())
    -- If a second passed, get the average FPS using the table (we always have at least one frame rendered, so dividing by 0 it's not a problem)
    local averageFPSPerSecond
    if getTickCount() - lastSecondTicks >= 1000 then
        averageFPSPerSecond = getAverageFPSOfFPSArray(currentSecondFPS)
        -- Reset variables
        currentSecondFPS = {}
        lastSecondTicks = getTickCount()
    end
    -- If a second has passed, update the table containing last five seconds FPS.
    -- Also update the FPS limit accordingly.
    if averageFPSPerSecond then
        table.insert(lastFiveSecondsFPS, averageFPSPerSecond)
        -- Silently discard too old average FPS
        if #lastFiveSecondsFPS == 6 then
            table.remove(lastFiveSecondsFPS, 1)
        end
        -- Get the average FPS of the average FPS of each of the last five seconds, and use the result as the frame limit.
        setFPSLimit(math.ceil(getAverageFPSOfFPSArray(lastFiveSecondsFPS)))
    end
end
--addEventHandler("onClientHUDRender", root, smoothFPS)


function stopMinigunDamage ( attacker, weapon, bodypart )
    if ( weapon == 0 ) then 
        cancelEvent()
    end
end
addEventHandler ( "onClientPlayerDamage", getLocalPlayer(), stopMinigunDamage )

function nodamage(attacker, bodypart)
    if not attacker then return end
    if getElementType(attacker) == 'vehicle' then
        cancelEvent()
    end
end
addEventHandler("onClientPlayerDamage", getLocalPlayer(),nodamage)

function blokada ( prevSlot, newSlot )
    if getPedWeapon(getLocalPlayer(),newSlot) == 0 and getElementData(getLocalPlayer(),"player:admin") == true then 
        toggleControl ( "fire", true )
        toggleControl("aim_weapon", true)
    elseif getPedWeapon(getLocalPlayer(),newSlot) == 7 then
        toggleControl ("fire", false ) 
        toggleControl("aim_weapon", false)
        return false
    elseif getPedWeapon(getLocalPlayer(),newSlot) ~= 0 and  getPedWeapon(getLocalPlayer(),newSlot) ~= 22 then
        toggleControl ("fire", true ) 
        toggleControl("aim_weapon", true)
    elseif getPedWeapon(getLocalPlayer(),newSlot) == 22 and getElementData(getLocalPlayer(),"player:admin") == true then
        toggleControl ("fire", false ) 
        toggleControl("aim_weapon", true)
    elseif getPedWeapon(getLocalPlayer(),newSlot) == 22 and getElementData(getLocalPlayer(),"player:admin") == false then
        toggleControl ("fire", true ) 
        toggleControl("aim_weapon", true)
    else
        toggleControl ( "fire", false ) 
        toggleControl("aim_weapon", false)
    end
end
addEventHandler ( "onClientPlayerWeaponSwitch", getRootElement(), blokada )

setTimer(function()
local czas=tonumber(getElementData(localPlayer, "player:online"))
if not czas then return end
setElementData(localPlayer, "player:online", czas+1)
end, 60000, 0)


function chat()
    if isChatVisible() then --Check or the chat is visible.
        showChat(false) --If it is, hide it.
    else
        showChat(true) --If it is not, show it.
    end
end
addCommandHandler('chat', chat)

function aparat()
    triggerServerEvent("givecamera", localPlayer)
end
addCommandHandler('aparat', aparat)

addEvent("core:blipyaut", true)
addEventHandler("core:blipyaut", root, function(plr)
if plr ~= localPlayer then return end
local uid=getElementData(plr,"player:uid")
for id, veh in ipairs( getElementsByType ( "vehicle" ) ) do
if uid == getElementData(veh,"vehicle:ownedPlayer") then
createBlipAttachedTo(veh,0,0,5000,0,0.3,0,255,0,255,1,99999)
end
end
end)
function destroyBlipsAttachedTo(elemente)
    local attached = getAttachedElements ( elemente )
    if ( attached ) then
        for k,element in ipairs(attached) do
            if getElementType ( element ) == "blip" then
                destroyElement ( element )
            end
        end
    end
end
function veh_blips()
    for i,v in pairs(getElementsByType("vehicle")) do
        if getElementData(v,"vehicle:spawn") == true then
            if getElementData(v,"vehicle:ownedPlayer") == getElementData(localPlayer,"player:uid") then
                createBlipAttachedTo(v,0,1,255,0,0,255,1,9999)
            end
            if getElementData(v,"vehicle:ownedGroup") == getElementData(localPlayer,"player:organization") and (getElementData(v,"vehicle:ownedPlayer") ~= getElementData(localPlayer,"player:uid")) then
                createBlipAttachedTo(v,0,1,246,48,87,255,1,9999)
            end
            local rent = getElementData(v,"vehicle:rent")
            if rent and (type(rent) == "table") then
                for i,s in pairs(rent) do
                    if tonumber(s) == getElementData(localPlayer,"player:uid") then
                        createBlipAttachedTo(v,0,1,0,0,255,255,1,9999)
                    end
                end
            end
        end
    end
end
setTimer(veh_blips,10000,0)
addEventHandler("onClientElementDestroy", root, function ()
    if getElementType(source) == "vehicle" then
    destroyBlipsAttachedTo(source)
    end
end)
addEventHandler ( "onClientElementDataChange", root,
function ( dataName )
    if getElementType ( source ) == "vehicle" and dataName == "vehicle:ownedPlayer" then
        destroyBlipsAttachedTo(source)
    end
    if getElementType ( source ) == "vehicle" and dataName == "vehicle:rent" then
        destroyBlipsAttachedTo(source)
    end
    if getElementType ( source ) == "vehicle" and dataName == "vehicle:ownedGroup" then
        destroyBlipsAttachedTo(source)
    end
end )






saeveplayers

--[[
    Resource: OURGame v2
    Developers: Split <split.programista@gmail.com>
    You have no right to use this code without my permission.
    (c) 2015 <split.programista@gmail.com>. All rights reserved.
]]

function loadPlayerData(plr)
    local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE id=?", getElementData(plr,"player:uid"))
    if result and #result > 0 then
        local v=result[1]
        setPlayerMoney(plr,v.money)
        setElementModel(plr,v.skin)
        setElementData(plr,"status","Aktywny")
        setElementData(plr,"player:logged",true)
        setElementData(plr,"player:mandate",v.mandate)
        setElementData(plr,"player:license:pjA",v.pjA)
        setElementData(plr,"player:license:pjB",v.pjB)
        setElementData(plr,"player:license:pjC",v.pjC)
        setElementData(plr,"player:license:pjL",v.pjL)
        setElementData(plr,"player:reputation",v.reputation)
        setElementData(plr,"player:workinjob",v.worker)
        setElementData(plr,"player:registerdate",v.registered)
        setElementData(plr,"player:hours",v.hours)
        local queryA=string.format("SELECT * FROM ogrpg_users WHERE id=%d AND premiumdate>NOW() LIMIT 1", getElementData(plr,"player:uid"))
        local resultA=exports["ogrpg-db"]:pobierzWyniki(queryA)
        if (resultA) then
            setElementData(plr,"player:premium",true)
            setElementData(plr,"player:premiumdate",v.premiumdate)
            setPlayerName(plr,"#dbb234"..getPlayerName(plr))
        else
            setElementData(plr,"player:premium",false)
        end
        setElementData(plr,"player:organization",false)
        setElementData(plr,"player:skin",v.skin)
        local org=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_organizations WHERE uid=? LIMIT 1", getElementData(plr,"player:uid")) -- pobieramy tylko JEDEN rekord
        if org and #org > 0 then
            setElementData(plr,"player:organization",org[1].code)
            exports['ogrpg-db']:dbSet("UPDATE ogrpg_organizations SET actived=curdate() WHERE uid=?", getElementData(plr,"player:uid"))
        end
        return true
    end
    return false
end

addEvent("load:player",true)
addEventHandler("load:player", root, function(player)
if isElement(player) and player then
if getElementType(player) ~= "player" then return end
loadPlayerData(player)
outputDebugString("Zaladowano statystyki gracza :"..getPlayerName(player))
end
end)
function savePlayerData(plr)
    local uid=getElementData(plr,"player:uid")
    if not uid then return end
    local money=getPlayerMoney(plr)
    local mandate=getElementData(plr,"player:mandate")
    local licensea=getElementData(plr,"player:license:pjA")
    local licenseb=getElementData(plr,"player:license:pjB")
    local licensec=getElementData(plr,"player:license:pjC")
    local licensel=getElementData(plr,"player:license:pjL")
    local reputation=getElementData(plr,"player:reputation")
    local worker =getElementData(plr,"player:workinjob")
    local hours= tonumber(getElementData(plr,"player:hours")) or 0
    local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET money=?, reputation=?, mandate=?, pjA=?, pjB=?, pjC=?, pjL=?, worker=?, hours=? WHERE id=?",
    money, reputation, mandate, licensea, licenseb, licensec, licensel,worker,hours, uid)
end
addEvent("save:player",true)
addEventHandler("save:player", root, function(player)
if isElement(player) and player then
if getElementType(player) ~= "player" then return end
savePlayerData(player)
outputDebugString("Zapisano statystyki gracza :"..getPlayerName(player))
end
end)
addEventHandler("onPlayerQuit", root, function() savePlayerData(source) end)



system_id


--[[
    Resource: OURGame v2
    Developers: Split <split.programista@gmail.com>
    You have no right to use this code without my permission.
    (c) 2015 <split.programista@gmail.com>. All rights reserved.
]]

function findPlayer(plr,cel)
    local target=nil
    if (tonumber(cel) ~= nil) then
        target=getElementByID("p"..cel)
    else -- podano fragment nicku
        for _,thePlayer in ipairs(getElementsByType("player")) do
            if string.find(string.gsub(getPlayerName(thePlayer):lower(),"#%x%x%x%x%x%x", ""), cel:lower(), 0, true) then
                if (target) then
                    outputChatBox("Znaleziono wiecej niz jednego gracza o pasujacym nicku, podaj wiecej liter.", plr)
                    return nil
                end
                target=thePlayer
            end
        end
    end
    if target and getElementData(target,"p:inv") then return nil end
    return target
end

local function findFreeValue(tablica_id)
    table.sort(tablica_id)
    local wolne_id=1
    for i,v in ipairs(tablica_id) do
        if (v==wolne_id) then wolne_id=wolne_id+1 end
        if (v>wolne_id) then return wolne_id end
    end
    return wolne_id
end

function assignPlayerID(plr)
    local gracze=getElementsByType("player")
    local tablica_id = {}
    for i,v in ipairs(gracze) do
        local lid=getElementData(v, "id")
        if (lid) then
            table.insert(tablica_id, tonumber(lid))
        end
    end
    local free_id=findFreeValue(tablica_id)
    if isElement(plr) then
    setElementData(plr,"id", free_id)
    setElementID(plr, "p" .. free_id)
    end
    return free_id
end

function getPlayerID(plr)
    if not plr then return "" end
    local id=getElementData(plr,"id")
    if (id) then
        return id
    else
        return assignPlayerID(plr)
    end
    
end

addEventHandler ("onPlayerJoin", getRootElement(), function()
    assignPlayerID(source)
end)



vehicle

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-01, 11:39


czsroka3355







Wiek: 28
Na forum: 3666 dni
Posty: 20
Nick w MP: czsrk.



Respekt: 55,3

Z tego co mi wiadomo z GM YA tym najnowszym jest komenda /konsola gdzie masz tabel? PM, czat, inne itp - wpisuj?c to tam masz logi.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-01, 12:29


Vintage







Wiek: 24
Na forum: 3695 dni
Posty: 64

Piwa: 1

Respekt: 45,8

czsroka3355, chodzi mi o taki dodatkowy czat po lewej z pm i czatem globalnym :D

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-01, 14:22


amited







Wiek: 26
Na forum: 3855 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466

Mo?esz wpisa? w consoli "debugscript 3" i zresetowa? skrypty i wpisa? /duty mo?e jaki? b??d b?dzie

Podpis
"amited" napisał/a:
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-01, 14:32


Vintage







Wiek: 24
Na forum: 3695 dni
Posty: 64

Piwa: 1

Respekt: 45,8

amited, nic a nic

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-01, 22:08


Artystek







Wiek: 24
Na forum: 3661 dni
Posty: 143
Nick w MP: Artystek

Piwa: 74

Respekt: 55,3

W paczce Your Adventure tego nie ma.

Postaw piwo autorowi tego posta
 

 
Tagi: ściana :: czatu :: your :: adventure :: rpg
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » ściana czatu Your Adventure RPG 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