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

Wysłany: 2017-05-02, 14:26


Matkiller12







Wiek: 33
Na forum: 3912 dni
Posty: 2
Nick w MP: Matkiller12



Respekt: 50

http://www.mediafire.com/...2l43q/Nosze.rar
---
Prosz? o przerobienie tego skryptu tak aby nosze wyci?ga?o si? komend? i chowa?o. ;d
Jeszcze zeby tam gracza polozyc itp.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-05-04, 20:34


Telsky







Wiek: 27
Na forum: 3390 dni
Posty: 8
Nick w MP: Telsky



Respekt: 50

Witam, dopiero zaczynam si? "bawi?" w serwer MTA:SA.
Najwi?kszy prob mam z MySQL, nie mog? znale?? ?adnego poradnika jak podpina? skrypty MTA:SA. Dzi? znalaz?em na waszym forum skrypt odpowiadaj?cy za logowanie/rejestracj? (http://gtao.pl/%3Cfont-colorcccc99%3Eskrypt%3C-font%3E-autorski-panel-logowania-vt100931.htm), ale nie dzia??. Wiem dla czego - ?le podpie?em MySQL.
Dlatego mam kilka pyta?.
1. Mam baz? MySQL (hosting 1shot1kill) i jaki jest port oraz host?
2. Zrobi?em podan? tabel? i jest tak jak tam pisze. Tylko to wystarczy czy trzeba skrypt odpowiadaj?cy g??wnie za MySQL?
3. Prosi?bym o uzupe?nienie mi tego:
addEventHandler("onResourceStart"resourceRoot, function()
    local baza ""
    local host ""
    local user ""
    local pass ""

    db dbConnect("mysql""dbname="..baza..";host="..hostuserpass"share=1")

Zamiast mojego has?a dajcie AAA
Zamiast mojego hosta dajcie BBB
Zamiast mojej nazwy u?ytkownika dajcie CCC
Zamiast mojej nazwy bazy dajcie DDD

Prosz? o wyrozumia?o??.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-05-05, 18:21


Avenged

Młodszy Szkrypter






Wiek: 23
Na forum: 3510 dni
Posty: 654
Nick w MP: Avenged

Piwa: 1570

Respekt: 326,3
Respekt: 326,3Respekt: 326,3Respekt: 326,3

Telsky, hosta i wszystkie dane musisz mie? podane na hostingu, a do po??czenia z baz? MySQL najlepiej stworzy? plik DB. A w przypadku tego wy?ej pomi?dzy tymi " " w tabeli u g?ry skryptu uzupe?niasz dane MySQL ;)

Podpis
LUA, JS, PHP



Zapraszam do skorzystania z moich usług: Klik

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-05-05, 21:52


marcin778

Krytyk serwerów MTA






Wiek: 24
Na forum: 4149 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4662

Respekt: 1436,8
Respekt: 1436,8

BarteQ03, Co ty za bzdury pleciesz Programisto ?? Od kiedy do MySQL tworzymy plik .db? Mylisz MySQL z SQLite.

Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-05-05, 23:33


dancusiu







Wiek: 22
Na forum: 4170 dni
Posty: 18
Nick w MP: Mikes

Piwa: 53

Respekt: 40,5

Witam prosz? jak mo?na na przycisk H to zrobi?.


Simple Police-Lights by MuLTi!

p_lights = {}
p_timer = {}
p_lvar = {}
p_pvar = {}
p_lvar2 = {}
p_lvar3 = {}
p_lvar4 = {}



function toggleLights(thePlayercmdlevel)
local level tonumber(level)
if not(levelthen outputChatBox("#FF0000 By w??czy? syreny Lights [1-2]"thePlayer255255255true) return end
if(level 1) or (level 2then outputChatBox("#FF0000 Please select a level between 1-2!"thePlayer255255255true) return end
local veh getPedOccupiedVehicle(thePlayer)
local id getElementModel(veh)
if (id == 598) or (id == 596) or (id == 597) or (id == 599then
if(level == 1then
if(p_lights[veh] == 0) or(p_lights[veh] == nilthen
p_pvar[veh] = 1
p_lights[veh] = 1
outputChatBox("#FFFFFFYour Police-lights has been #00FF00enabled."thePlayer0200100true)
setVehicleOverrideLights veh)
p_timer[veh] = setTimer(
function()
if(p_lvar[veh] == 0) or (p_lvar[veh] == nilthen
p_lvar[veh] = 1
setVehicleLightState veh10)
setVehicleLightState veh20)
setVehicleLightState veh01)
setVehicleLightState veh31)
setVehicleHeadLightColor(veh00,255)
else
setVehicleLightState veh30)
setVehicleLightState veh00)
setVehicleLightState veh11)
setVehicleLightState veh21)
setVehicleHeadLightColor(veh00255)
p_lvar[veh] = 0
end
end5000)
else
p_lights[veh] = 0
outputChatBox("#FFFFFFYour Police-lights has been #00FF00disabled."thePlayer0200100true)
killTimer(p_timer[veh])
setVehicleLightState veh00)
setVehicleLightState veh10)
setVehicleLightState veh20)
setVehicleLightState veh30)
setVehicleHeadLightColor(veh00,255)
setVehicleOverrideLights veh)
end
elseif(level == 2then
if(p_lights[veh] == 0) or(p_lights[veh] == nilthen
p_lights[veh] = 1
outputChatBox("#FFFFFFYour Police-lights has been #00FF00enabled."thePlayer0200100true)
setVehicleOverrideLights veh)
p_timer[veh] = setTimer(
function()
if(p_lvar3[veh] == 4then
setTimer(function() p_lvar3[veh] = 0 end10001)
setTimer(
function()
if(p_lvar4[veh] == 1)then
p_lvar4[veh] = 0
-- vorne links 1 vorne rechts 2 hinten links 3 hinten rechts
setVehicleLightState veh10)
setVehicleLightState veh20)
setVehicleLightState veh01)
setVehicleLightState veh31)
setVehicleHeadLightColor(veh0,0,255)
else
setVehicleLightState veh30)
setVehicleLightState veh00)
setVehicleLightState veh11)
setVehicleLightState veh21)
setVehicleHeadLightColor(veh0,0,255)
p_lvar4[veh] = 1
end
end505)
return end
if(p_lvar2[veh] == 0) or (p_lvar2[veh] == nilthen
p_lvar2[veh] = 1
-- vorne links 1 vorne rechts 2 hinten links 3 hinten rechts
setVehicleLightState veh10)
setVehicleLightState veh20)
setVehicleLightState veh01)
setVehicleLightState veh31)
setVehicleHeadLightColor(veh00255)
else
setVehicleLightState veh30)
setVehicleLightState veh00)
setVehicleLightState veh11)
setVehicleLightState veh21)
setVehicleHeadLightColor(veh00255)
p_lvar2[veh] = 0
end
if(p_lvar3[veh] == nilthen p_lvar3[veh] = 0 end
p_lvar3[veh] = (p_lvar3[veh]+1)
end5000)
else
p_lights[veh] = 0
outputChatBox("#FFFFFFYour Police-lights has been #00FF00disabled."thePlayer0200100true)
killTimer(p_timer[veh])
setVehicleLightState veh00)
setVehicleLightState veh10)
setVehicleLightState veh20)
setVehicleLightState veh30)
setVehicleHeadLightColor(veh00255)
setVehicleOverrideLights veh)
end
end
end
end

addCommandHandler("lights"toggleLights)




addEventHandler "onVehicleExplode"getRootElement(),
function()
if(p_lights[source] == 1then
killTimer(p_timer[source])
end
end )

addEventHandler "onVehicleRespawn"getRootElement(),
function()
if(p_lights[source] == 1then
killTimer(p_timer[source])
end
end )

addEventHandler("onElementDestroy"getRootElement(),
function ()
if getElementType(source) == "vehicle" then
if(p_lights[source] == 1then
killTimer(p_timer[source])
end
end
end)


Podpis
Popełniasz błędy ale ktoś ci ich nie wybaczy :(
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-05-05, 23:55


Chrystek.

Programista LUA






Wiek: 26
Na forum: 3378 dni
Posty: 16
Nick w MP: Chrysto.

Piwa: 3

Respekt: 45,3

Ostrzeżeń: 100%
dancusiu, Spr?buj tak jak nie dzia?a to sorry ale jestem na telefonie i ci??ko.

Simple Police-Lights by MuLTi!

p_lights = {}
p_timer = {}
p_lvar = {}
p_pvar = {}
p_lvar2 = {}
p_lvar3 = {}
p_lvar4 = {}



function toggleLights(thePlayercmdlevel)
local level tonumber(level)
if not(levelthen outputChatBox("#FF0000 By w??czy? syreny Lights [1-2]"thePlayer255255255true) return end
if(level 1) or (level 2then outputChatBox("#FF0000 Please select a level between 1-2!"thePlayer255255255true) return end
local veh getPedOccupiedVehicle(thePlayer)
local id getElementModel(veh)
if (id == 598) or (id == 596) or (id == 597) or (id == 599then
if(level == 1then
if(p_lights[veh] == 0) or(p_lights[veh] == nilthen
p_pvar[veh] = 1
p_lights[veh] = 1
outputChatBox("#FFFFFFYour Police-lights has been #00FF00enabled."thePlayer0200100true)
setVehicleOverrideLights veh)
p_timer[veh] = setTimer(
function()
if(p_lvar[veh] == 0) or (p_lvar[veh] == nilthen
p_lvar[veh] = 1
setVehicleLightState veh10)
setVehicleLightState veh20)
setVehicleLightState veh01)
setVehicleLightState veh31)
setVehicleHeadLightColor(veh00,255)
else
setVehicleLightState veh30)
setVehicleLightState veh00)
setVehicleLightState veh11)
setVehicleLightState veh21)
setVehicleHeadLightColor(veh00255)
p_lvar[veh] = 0
end
end5000)
else
p_lights[veh] = 0
outputChatBox("#FFFFFFYour Police-lights has been #00FF00disabled."thePlayer0200100true)
killTimer(p_timer[veh])
setVehicleLightState veh00)
setVehicleLightState veh10)
setVehicleLightState veh20)
setVehicleLightState veh30)
setVehicleHeadLightColor(veh00,255)
setVehicleOverrideLights veh)
end
elseif(level == 2then
if(p_lights[veh] == 0) or(p_lights[veh] == nilthen
p_lights[veh] = 1
outputChatBox("#FFFFFFYour Police-lights has been #00FF00enabled."thePlayer0200100true)
setVehicleOverrideLights veh)
p_timer[veh] = setTimer(
function()
if(p_lvar3[veh] == 4then
setTimer(function() p_lvar3[veh] = 0 end10001)
setTimer(
function()
if(p_lvar4[veh] == 1)then
p_lvar4[veh] = 0
-- vorne links 1 vorne rechts 2 hinten links 3 hinten rechts
setVehicleLightState veh10)
setVehicleLightState veh20)
setVehicleLightState veh01)
setVehicleLightState veh31)
setVehicleHeadLightColor(veh0,0,255)
else
setVehicleLightState veh30)
setVehicleLightState veh00)
setVehicleLightState veh11)
setVehicleLightState veh21)
setVehicleHeadLightColor(veh0,0,255)
p_lvar4[veh] = 1
end
end505)
return end
if(p_lvar2[veh] == 0) or (p_lvar2[veh] == nilthen
p_lvar2[veh] = 1
-- vorne links 1 vorne rechts 2 hinten links 3 hinten rechts
setVehicleLightState veh10)
setVehicleLightState veh20)
setVehicleLightState veh01)
setVehicleLightState veh31)
setVehicleHeadLightColor(veh00255)
else
setVehicleLightState veh30)
setVehicleLightState veh00)
setVehicleLightState veh11)
setVehicleLightState veh21)
setVehicleHeadLightColor(veh00255)
p_lvar2[veh] = 0
end
if(p_lvar3[veh] == nilthen p_lvar3[veh] = 0 end
p_lvar3[veh] = (p_lvar3[veh]+1)
end5000)
else
p_lights[veh] = 0
outputChatBox("#FFFFFFYour Police-lights has been #00FF00disabled."thePlayer0200100true)
killTimer(p_timer[veh])
setVehicleLightState veh00)
setVehicleLightState veh10)
setVehicleLightState veh20)
setVehicleLightState veh30)
setVehicleHeadLightColor(veh00255)
setVehicleOverrideLights veh)
end
end
end
end

addCommandHandler("lights"toggleLights)
bindKey("h""down"toggleLights)




addEventHandler "onVehicleExplode"getRootElement(),
function()
if(p_lights[source] == 1then
killTimer(p_timer[source])
end
end )

addEventHandler "onVehicleRespawn"getRootElement(),
function()
if(p_lights[source] == 1then
killTimer(p_timer[source])
end
end )

addEventHandler("onElementDestroy"getRootElement(),
function ()
if getElementType(source) == "vehicle" then
if(p_lights[source] == 1then
killTimer(p_timer[source])
end
end
end)


Podpis



Programista LUA





Postęp prac: 15%

Forum: http://b-w.ct8.pl
TeamSpeak: FR3.ts-3.cx:11740
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-05-06, 00:03


Avenged

Młodszy Szkrypter






Wiek: 23
Na forum: 3510 dni
Posty: 654
Nick w MP: Avenged

Piwa: 1570

Respekt: 326,3
Respekt: 326,3Respekt: 326,3Respekt: 326,3

marcin778, chodzi?o mi o skrypt DB czyli po??czenie z baz? tzn. zale?y bo to w GM si? stosuje.

Podpis
LUA, JS, PHP



Zapraszam do skorzystania z moich usług: Klik

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-05-07, 14:24


MichalskY







Wiek: 31
Na forum: 3405 dni
Posty: 24



Respekt: 20,5

prosz? o przerobienie skryptu tak by by?y blipy punkt?w na radarze i ?eby blip znika? jak sie wlatuje w punkt

createBlip 1393.811251.2810.82462255002550400local missionTimer
local missionVehicle
local missionWysypiskaD = {
    {1393.811251.2810.82}, 
}
local missionPointsD = {


    {1510.021469.23183.85},
    {1454.081620.11183.85},
    {1339.481593.27183.85},
    {1432.731780.4671.95},
    {1428.171948.3462.25},
    {1437.012124.7742.10},
    {1487.962203.8069.20},
    {1538.712197.8569.20},
    {1657.532177.7169.20},
   

}
local countMarkers=#missionPointsD

for i,v in ipairs(missionWysypiskaD) do
    local marker=createMarker(v[1], v[2], v[3]-1"cylinder"4071255,100)
    createPickup v[1], v[2], v[3]+131318 )
    setElementData(marker,"wysypisko",true)
    --createBlipAttachedTo(marker52)
    

    local t=createElement("text")
    setElementData(t,"name","Miejsce oddania\nzebranych danych!")
    setElementPosition(tv[1], v[2], v[3])
end

function showMarker()
     for i,rnd in ipairs(missionPointsD) do
        markerr=createMarker(rnd[1], rnd[2], rnd[3], "arrow"7080180,255)


       
       setElementData(markerr,"wlasnosc",getPlayerName(localPlayer))

     end
end

addEventHandler("onClientVehicleExit",root,function (plr,seat)
    if plr == localPlayer and seat == and getElementData(source,"zapelnienie"then
        triggerServerEvent("cancelJob",resourceRoot,source)
        setElementData(plr,"player:job",nil)
        for i,v in ipairs(getElementsByType("marker")) do
            if getElementData(v,"wlasnosc") == getPlayerName(plrthen
                destroyElement(v)
            end
        end
    end
end)

addEventHandler("onClientMarkerHit"resourceRoot, function(el,md)
    if el~=localPlayer then return end
    local veh=getPedOccupiedVehicle(localPlayer)
    if not veh then return end -- nie powinno sie wydarzyc
    if getVehicleController(veh) ~= localPlayer then return end
        if getElementData(veh,"vehicle:pracaD") and getElementData(veh,"vehicle:pracaD")=="Dodo" then
            if getElementData(source,"wysypisko"then
            local zapelnienie getElementData(veh,"zapelnienie")
            --outputChatBox(zapelnienie)
                if zapelnienie and zapelnienie == 0 then -- procenty
                   outputChatBox ("#0055B5☞  #FFFFFFTw?j dysk jest pusty."255255255true )
                return
                end
            
            if countMarkers == 0 then
            showMarker()
            end
        setElementData(veh,"zapelnienie",0)
        setElementData(veh,"vehicle:desc","Dane 0%")
        triggerServerEvent("wyplacPieniadze"localPlayerzapelnienie)
        return
        end
    if countMarkers == 0 then
        showMarker()
    else
        local zapelnienie=getElementData(veh,"zapelnienie")
        if zapelnienie and zapelnienie >= 100 then -- procenty
            outputChatBox("#0055B5☞  #FFFFFFPosiadasz ju? #919191: "..zapelnienie.."#0053FFGB."25500true )
            return
        end
        marker=source
        --outputChatBox("#0053FF Trwa Ladowanie..."000true )
        
        if not isTimer(missionTimerthen
            missionTimer=setTimer(function()
                countMarkers=countMarkers-1
                local poziom=getElementData(veh,"zapelnienie") or 0
                poziom=math.min(poziom+math.random(1,3),100)
                setElementData(veh,"zapelnienie"poziom)
                setElementData(veh,"vehicle:desc","Dane: "..poziom.."%")
                outputChatBox("#0055B5☞  #FFFFFFZawartosc Dysku#919191: "..poziom.."%"000true)
                destroyElement(marker)
            end5001)
        else
            killTimer(missionTimer)
        end
     end
end
end)

setTimer(function()
    for _,player in ipairs(getElementsByType("player")) do
        if getElementData(player,"player:job") == "Generator" then
            if not getPedOccupiedVehicle(player) and getPedOccupiedVehicle(player) ~= missionVehicle then
                for _,marker in ipairs(getElementsByType("marker"resourceRoot)) do
                    if getElementData(marker,"wlasnosc") == getPlayerName(playerthen
                        destroyElement(marker)
                        setElementData(player"player:job"false)
                    end
                end
            end
        end
    end
end10000)

addEventHandler("onClientVehicleEnter"resourceRoot, function(plr,seat)
     if plr~=localPlayer then return end
     if seat~=0 then return end
     missionVehicle=source
     setElementData(source,"zapelnienie",0)
     setElementData(source,"vehicle:desc","Dane: 0%")
     setElementData(plr,"player:job","Generator")
     outputChatBox ("#0055B5☞  #FFFFFFRozpoczynasz prace, lataj nad #0055B5Las Venturas i zbieraj dane."255255255true )
     outputChatBox ("#0055B5☞  #FFFFFFPo uzbieraniu min 1% mozesz odeslac zapisana mape na #0053FFStacji#919191."255255255true )
     outputChatBox ("#0055B5☞  #FFFFFFOznaczonej #0055B5W  #FFFFFF na lotnisku LV."255255255true )
     showMarker()
end)

addEventHandler("onClientResourceStop"resourceRoot, function()
    if getElementData(localPlayer,"player:job") == "Dodo" then
        setElementData(localPlayer,"player:job",false)
    end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-05-08, 21:05


dancusiu







Wiek: 22
Na forum: 4170 dni
Posty: 18
Nick w MP: Mikes

Piwa: 53

Respekt: 40,5

"Chrystek." napisał/a:

dancusiu, Spr?buj tak jak nie dzia?a to sorry ale jestem na telefonie i ci??ko.

Simple Police-Lights by MuLTi!

p_lights = {}
p_timer = {}
p_lvar = {}
p_pvar = {}
p_lvar2 = {}
p_lvar3 = {}
p_lvar4 = {}



function toggleLights(thePlayercmdlevel)
local level tonumber(level)
if not(levelthen outputChatBox("#FF0000 By w??czy? syreny Lights [1-2]"thePlayer255255255true) return end
if(level 1) or (level 2then outputChatBox("#FF0000 Please select a level between 1-2!"thePlayer255255255true) return end
local veh getPedOccupiedVehicle(thePlayer)
local id getElementModel(veh)
if (id == 598) or (id == 596) or (id == 597) or (id == 599then
if(level == 1then
if(p_lights[veh] == 0) or(p_lights[veh] == nilthen
p_pvar[veh] = 1
p_lights[veh] = 1
outputChatBox("#FFFFFFYour Police-lights has been #00FF00enabled."thePlayer0200100true)
setVehicleOverrideLights veh)
p_timer[veh] = setTimer(
function()
if(p_lvar[veh] == 0) or (p_lvar[veh] == nilthen
p_lvar[veh] = 1
setVehicleLightState veh10)
setVehicleLightState veh20)
setVehicleLightState veh01)
setVehicleLightState veh31)
setVehicleHeadLightColor(veh00,255)
else
setVehicleLightState veh30)
setVehicleLightState veh00)
setVehicleLightState veh11)
setVehicleLightState veh21)
setVehicleHeadLightColor(veh00255)
p_lvar[veh] = 0
end
end5000)
else
p_lights[veh] = 0
outputChatBox("#FFFFFFYour Police-lights has been #00FF00disabled."thePlayer0200100true)
killTimer(p_timer[veh])
setVehicleLightState veh00)
setVehicleLightState veh10)
setVehicleLightState veh20)
setVehicleLightState veh30)
setVehicleHeadLightColor(veh00,255)
setVehicleOverrideLights veh)
end
elseif(level == 2then
if(p_lights[veh] == 0) or(p_lights[veh] == nilthen
p_lights[veh] = 1
outputChatBox("#FFFFFFYour Police-lights has been #00FF00enabled."thePlayer0200100true)
setVehicleOverrideLights veh)
p_timer[veh] = setTimer(
function()
if(p_lvar3[veh] == 4then
setTimer(function() p_lvar3[veh] = 0 end10001)
setTimer(
function()
if(p_lvar4[veh] == 1)then
p_lvar4[veh] = 0
-- vorne links 1 vorne rechts 2 hinten links 3 hinten rechts
setVehicleLightState veh10)
setVehicleLightState veh20)
setVehicleLightState veh01)
setVehicleLightState veh31)
setVehicleHeadLightColor(veh0,0,255)
else
setVehicleLightState veh30)
setVehicleLightState veh00)
setVehicleLightState veh11)
setVehicleLightState veh21)
setVehicleHeadLightColor(veh0,0,255)
p_lvar4[veh] = 1
end
end505)
return end
if(p_lvar2[veh] == 0) or (p_lvar2[veh] == nilthen
p_lvar2[veh] = 1
-- vorne links 1 vorne rechts 2 hinten links 3 hinten rechts
setVehicleLightState veh10)
setVehicleLightState veh20)
setVehicleLightState veh01)
setVehicleLightState veh31)
setVehicleHeadLightColor(veh00255)
else
setVehicleLightState veh30)
setVehicleLightState veh00)
setVehicleLightState veh11)
setVehicleLightState veh21)
setVehicleHeadLightColor(veh00255)
p_lvar2[veh] = 0
end
if(p_lvar3[veh] == nilthen p_lvar3[veh] = 0 end
p_lvar3[veh] = (p_lvar3[veh]+1)
end5000)
else
p_lights[veh] = 0
outputChatBox("#FFFFFFYour Police-lights has been #00FF00disabled."thePlayer0200100true)
killTimer(p_timer[veh])
setVehicleLightState veh00)
setVehicleLightState veh10)
setVehicleLightState veh20)
setVehicleLightState veh30)
setVehicleHeadLightColor(veh00255)
setVehicleOverrideLights veh)
end
end
end
end

addCommandHandler("lights"toggleLights)
bindKey("h""down"toggleLights)




addEventHandler "onVehicleExplode"getRootElement(),
function()
if(p_lights[source] == 1then
killTimer(p_timer[source])
end
end )

addEventHandler "onVehicleRespawn"getRootElement(),
function()
if(p_lights[source] == 1then
killTimer(p_timer[source])
end
end )

addEventHandler("onElementDestroy"getRootElement(),
function ()
if getElementType(source) == "vehicle" then
if(p_lights[source] == 1then
killTimer(p_timer[source])
end
end
end)



Nie masz inny spos?b?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-05-19, 17:42


Gravgor







Wiek: 22
Na forum: 3620 dni
Posty: 380
Nick w MP: 1944

Piwa: 702

Respekt: 57,8

Chce zeby gracz ktory wjedzie w marker nie mogl z niego wyjechac przed zaplata.
Czyli trzeba dodac frozena i zeby nie mogl placic jak nie ma 20pln


c.lua
local marker=createMarker(1710.05176, -808.8296556.35443'corona', -1235155,0,250)

function MarkerHit hitPlayermatchingDimension )
    outputChatBox " Tak Naprawde Wesley to cj")
    
end

addEventHandler("onClientMarkerHit"getRootElement(), MarkerHit )
    
        
function zaplac thePlayercommand ,amount)
            takePlayerMoney thePlayertonumber20 ) )
end
addCommandHandler "zaplac" zaplac)


s.lua


function toggleFreezeStatus thePlayer )
 
        local playerVehicle getPlayerOccupiedVehicle thePlayer )
        
        local currentFreezeStatus isElementFrozen playerVehicle )
    
        local newFreezeStatus not currentFreezeStatus
        
        setElementFrozen playerVehiclenewFreezeStatus )
    end


Podpis
Portfolio marceliborowczak.me
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-05-28, 18:14


Nieznajomy12







Wiek: 24
Na forum: 3914 dni
Posty: 6
Nick w MP: Graczowsky

Piwa: 28

Respekt: 60

Problem w panelu logowania
ERROR:PanelLogowania\Login_c.lua:122: attempt to perform arithmetic on global 'TK1'(a nil value)

Pomo?e kto??

http://www111.zippyshare.com/v/qp0RCiWL/file.html

Ostatnio zmieniony przez Nieznajomy12 2017-05-28, 18:28, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-05-30, 22:48


koj155







Wiek: 42
Na forum: 4823 dni
Posty: 3
Nick w MP: Speed



Respekt: 50

witam mam pro?b? o napisanie skryptu na towary i na hud kt?ry ma liczb? towar?w i stan pojazd?w i walut? pln i zycie i kamizelke towary dok?adnie to legalne i nie legalne w za?oczniku daje wam markery i liste towar?w

http://www21.zippyshare.com/v/xASPbm3H/file.html
http://www21.zippyshare.com/v/RGpaWG3S/file.html
Ps towary mog? wozi? tiry z naczep? i wszystkie busy opr?cz monbeam

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-14, 12:53


JoKeR7026







Wiek: 29
Na forum: 3478 dni
Posty: 6



Respekt: 50

Prosze o przerobienie skryptu na rozmowy mi?dzy frakcjami.
Kiedy jestem na s?u?bie to chat widz? gracze kt?rzy nie s? na s?u?bie.
Kod:


addCommandHandler("frakcja",function(plr, cmd, ...)
if not getElementData(plr, "player:duty") then return end
local msg = table.concat ( { ... }, " " )
for i,v in pairs(getElementsByType("player")) do
if getElementData(plr, "player:duty")=="SPD" then
outputChatBox("#FFFFFF[#2AD7DEFrakcja#FFFFFF]#0000FF SPD #FF9933"..getPlayerName(plr).."#FFFFFF"..msg.."",v,255,255,255,true)
elseif getElementData(plr,"player:duty")=="SES" then
outputChatBox("#FFFFFF[#2AD7DEFrakcja#FFFFFF]#25D6BE SES #FF2266"..getPlayerName(plr).." #FFFFFF "..msg.."",v,255,255,255,true)
elseif getElementData(plr,"player:duty")=="SATC" then
outputChatBox("#FFFFFF[#2AD7DEFrakcja#FFFFFF]#EBF711 SATC #FF2266"..getPlayerName(plr).." #FFFFFF "..msg.."",v,255,255,255,true)
elseif getElementData(plr,"player:duty")=="FBSA" then
outputChatBox("#FFFFFF[#2AD7DEFrakcja#FFFFFF]#F71115 FBSA #FF2266"..getPlayerName(plr).." #FFFFFF "..msg.."",v,255,255,255,true)
end
end
end)

addCommandHandler("sluzba",function(plr, cmd, ...)
if not getElementData(plr, "player:duty") then return end
local msg = table.concat ( { ... }, " " )
for i,v in pairs(getElementsByType("player")) do
if getElementData(v, "player:duty") then
triggerClientEvent(v,"radio",v)
if getElementData(plr,"player:duty") =="SPD" then
outputChatBox("#FFFFFF[#FF0000S?u?by#FFFFFF]#0000FF State Police Department #FF9933"..getPlayerName(plr).." #FFFFFF"..msg.."",plr,255,255,255,true)
elseif getElementData(plr, "player:duty")=="SES" then
outputChatBox("#FFFFFF[#FF0000S?u?by#FFFFFF]#25D6BE State Emergency Services #FF2266"..getPlayerName(plr).." #FFFFFF"..msg.."",v,255,255,255,true)
elseif getElementData(plr, "player:duty") =="SATC" then
outputChatBox("#FFFFFF[#FF0000S?u?by#FFFFFF]#EBF711 SATC #FF2266"..getPlayerName(plr).." #FFFFFF"..msg.."",v,255,255,255,true)
elseif getElementData(plr, "player:duty") =="FBSA" then
outputChatBox("#FFFFFF[#FF0000S?u?by#FFFFFF]#F71115 FBSA #FF2266"..getPlayerName(plr).." #FFFFFF"..msg.."",v,255,255,255,true)
elseif getElementData(plr, "player:duty") =="SBG" then
outputChatBox("#FFFFFF[#FF0000S?u?by#FFFFFF]#F71115 SBG #FF2266"..getPlayerName(plr).." #FFFFFF"..msg.."",v,255,255,255,true)

end
end
end
end)


addEventHandler("onResourceStart",resourceRoot,function()
for _,plajer in pairs(getElementsByType("player")) do
bindKey(plajer, "y", "down", "chatbox", "frakcja")
bindKey(plajer, "u", "down", "chatbox", "sluzba")
end
end)

addEventHandler("onPlayerSpawn",getRootElement(),
function(_)
bindKey(source, "y", "down", "chatbox", "frakcja")
bindKey(source, "u", "down", "chatbox", "sluzba")
end)
--[[
addCommandHandler("test",function(plr)
setElementData(plr, "player:duty","SAMC",false)
setElementData(plr, "player:duty", "SAPD",true)
end)

addCommandHandler("test2",function(plr)
setElementData(plr, "player:duty", "SAPD", false)
setElementData(plr, "player:duty", "SAMC",true)
end)
--]]


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-16, 22:35


gg55







Wiek: 26
Na forum: 3602 dni
Posty: 55
Nick w MP: Kuba56

Piwa: 955

Respekt: 21

Witam ma taki kod i chcia? bym ten kod do ogrpg saveplayers bo ja go nie umiem tam wklej? bo nie wiem jak za to daje :piwo: R* .

Cytat:


local sid = getElementData(plr, "player:uid")

if sid then
local result = exports['ogrpg-db']:dbGet('select * from og_premium where uid=? and date > now()', sid)
if result and #result > 0 then
setElementData(element, 'player:premium', true)

outputChatBox('Posiadasz aktywn? us?ug? Premium.\nJest ona aktywna do: '.. result[1]['premium'] ..'.', plr)
outputChatBox('Aby przed?u?y? us?ug? Premium wpisz /premium.', plr)
end

local result = exports['ogrpg-db']:dbGet('select * from og_premium where uid=? and date < now()', sid)
if result and #result > 0 then
if result[1]['premium'] ~= '0000-00-00 00:00:00' then
local query = exports['ogrpg-db']:dbSet('update og_premium set date="0000-00-00 00:00:00" where uid=?', sid)
if query then
setElementData(element, 'player:premium', false)

outputChatBox('Twoja us?uga Premium wygas?a!', plr)
outputChatBox('Aby zakupi? ponownie us?ug? Premium wpisz /premium.', plr)
end
end
end
end



ten kod do g?ry bym chcia? wklej? do tego kodu zeby dzia?a?o.

Cytat:

--[[
Resource: OURGame v2
Developers: Split <[email protected]>
You have no right to use this code without my permission.
(c) 2015 <[email protected]>. All rights reserved.
]]
function getPremium(plr,premium)
if premium then
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE id=? AND premium=?",getElementData(plr,"player:sid"), premium)
if result and #result > 0 then
return true
else
return false
end
else
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE id=?", getElementData(plr,"player:sid"))
if result and #result > 0 then
return true
else
return false
end
end
end


function loadPlayerData(plr)
local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE id=?", getElementData(plr,"player:sid"))
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:rep",v.rep)
setElementData(plr,"player:workinjob",v.worker)
setElementData(plr,"player:registerdate",v.registered)
setElementData(plr,"player:hours",v.hours)
setElementData(plr,"player:skin",v.skin)

local queryA=string.format("SELECT * FROM ogrpg_users WHERE id=%d AND premiumdate>NOW() LIMIT 1", getElementData(plr,"player:sid"))
local resultA=exports["DB2"]:pobierzWyniki(queryA)
if (resultA) then
setElementData(plr,"player:premium",true)
setElementData(plr,"player:premiumdate",v.premiumdate)
setPlayerName(plr,"#F6FF00"..getPlayerName(plr))
setElementData(plr,"premium:level",1)
else
setElementData(plr,"player:premium",false)
end

--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"]:dbSet(queryA)
--if (resultA) then


--[[if getPremium(plr,1) then
setElementData(plr,"player:premium",true)
setElementData(plr,"player:premiumdate",v.premiumdate)
setPlayerName(plr,"#FFFF00"..getPlayerName(plr))
else
setElementData(plr,"player:premium",false)
end--]]


-- org
--local org=exports["ogrpg-db"]:dbGet("SELECT * FROM ms_organizacje WHERE code=? AND uid=? LIMIT 1", getElementData(plr,"player:organization"), getElementData(plr,"player:sid")) -- pobieramy tylko JEDEN rekord
--local name = getPlayerName(plr):gsub("#%x%x%x%x%x%x","")
--if org and #org > 0 then
--setElementData(plr,"player:organization",org[1].code)
--outputChatBox("* Jeste? w organizacji, kt?ra nosi nazwe: "..org[1].code.."", plr)
--exports['ogrpg-db']:dbSet("UPDATE ms_organizacje SET actived=curdate() WHERE uid=?", getElementData(plr,"player:sid"))
--end

--local org=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_organizations WHERE code=? AND uid=? LIMIT 1", getElementData(plr,"player:organization"), getElementData(plr,"player:sid"))
--local org=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_organizations WHERE uid=? LIMIT 1", getElementData(plr,"player:sid")) -- pobieramy tylko JEDEN rekord
--if org and #org > 0 then
--setElementData(plr,"player:organization",org[1].code)
--outputChatBox("* Jeste? w organizacji, kt?ra nosi nazwe: "..org[1].code.."", plr)
--exports['ogrpg-db']:dbSet("UPDATE ogrpg_organization_list WHERE id=? AND uid=?", id, uid)
--\\\--exports['ogrpg-db']:dbSet("UPDATE ogrpg_organizations SET actived=curdate() WHERE uid=?", getElementData(plr,"player:sid"))
--end

local org=exports["ogrpg-db"]:dbGet("SELECT * FROM ms_organizacje WHERE code=? AND uid=? LIMIT 1", getElementData(plr,"player:organization"), getElementData(plr,"player:sid")) -- pobieramy tylko JEDEN rekord
local name = getPlayerName(plr):gsub("#%x%x%x%x%x%x","")
if org and #org > 0 then
setElementData(plr,"player:organization",org[1].code)
outputChatBox("✪ Jeste? w organizacji, kt?ra nosi nazwe: "..org[1].code.."", plr)
exports['ogrpg-db']:dbSet("UPDATE ms_organizacje SET actived=curdate() WHERE uid=?", getElementData(plr,"player:sid"))
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("ogrpg_users> Za?adowano statystyki gracza: "..getPlayerName(player))
end
end)
function savePlayerData(plr)
local sid=getElementData(plr,"player:sid")
if not sid 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 srp=getElementData(plr,"player:rep")
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=?, rep=?, mandate=?, pjA=?, pjB=?, pjC=?, pjL=?, worker=?, hours=? WHERE id=?",
money, srp, mandate, licensea, licenseb, licensec, licensel, worker, hours, sid)
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("ogrpg_users> Zapisano statystyki gracza: "..getPlayerName(player))
end
end)
addEventHandler("onPlayerQuit", root, function() savePlayerData(source) end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-06-20, 19:20


KilusTv







Wiek: 28
Na forum: 3999 dni
Posty: 58
Nick w MP: KilusTv

Piwa: 1

Respekt: 50

Kod:

local gate = createObject ( 3089, -6720.42,-1473.60,97.41, 0, 0, 90 )

function open()

moveObject (gate, 1000, -6720.42,-1474.60,97.41 )
if getElementData(thePlayer,'player:duty') and getElementData(thePlayer,'player:duty')=='KGPLV' then
moveObject ( brama1, 2000, -2563.7,617.09998,15.4)
end
end

end


Przerobi mi kto? to, ?eby brama otwiera?a si? gdy gracz jest w mysql we frakcji a nie na sluzbie. Daje zimnego browara ;)

Postaw piwo autorowi tego posta
 

 
Tagi: prośby :: przerobienie :: skryptu
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Zasoby do MTA » PROŚBY O PRZEROBIENIE SKRYPTU Odpowiedz do tematu

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