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

Wysłany: 2017-05-23, 21:04


zombiaczek11







Wiek: 30
Na forum: 3576 dni
Posty: 26
Nick w MP: Danio

Piwa: 2

Respekt: 50

Ostrzeżeń: 100%
Witam mam problem ze skryptem na vdodaj a dok?adnie to danie kluczyk?w do pojazdu danemu graczowi da? mog? ale jak chce zabra? to pisze ze zabra?em ale i tak gracz mo?ne wsi???.

B??d?w ?adnych nie pokazuje.


function getVehicleKey(plr,veh)
    if plr and veh then
        local uid=getElementData(plr,"user:uid")
        if not uid then return end
        if getElementData(plr,"user:duty") or uid == getElementData(veh,"veh:owner"then
            return true
        else
            return false
        end
    end
end
local categoryL={[592] = true,[553] = true,[577] = true,[488] = true,[511] = true,[497] = true,[548] = true,[563] = true,[512] = true,[476] = true,[593] = true,[447] = 

true,[425] = true,[519] = true,[520] = true,[460] = true,[417] = true,[469] = true,[487] = true,[513] = true}
addEventHandler("onVehicleStartEnter"root, function(plr,seat,jacked)
    if getElementHealth(source) < 302 then
        setElementHealth(source,302)
    end
end)
function jestwtabeli(***,truj)
    for k,v in pairs(***) do
        if == truj then
           return true
        end
    end
    return false
end

addCommandHandler("vdodaj",function(plr,cmd,target)
    local veh getPedOccupiedVehicle(plr)
    if not veh then outputChatBox("* Nie siedzisz w aucie!",plr,255,0,0) return end
    if getElementData(veh,"veh:owner") ~= getElementData(plr,"user:uid"then outputChatBox("* Ten pojazd nie nalezy od ciebie!",plr,255,0,0) return end
    if not target then
        outputChatBox("* Zabrano dostep wszystkim gracz?!",plr,255,0,0)
        setElementData(veh,"veh:owner",0)
    else
        local target=findPlayer(plrtarget)
        if not target then
            outputChatBox("* Nie znaleziono gracza online!",plr,255,0,0)
            return
        end
        local rent getElementData(veh,"veh:uid")
        if (type(rent) ~= "table"then
            local tabelka = {}
            table.insert(tabelka,getElementData(target,"user:uid"))
            setElementData(veh,"veh:uid",tabelka)
            outputChatBox(string.format("* Dodano gracza "..getPlayerName(target).."(UID: "..getElementData(target,"user:uid")..") do wypo?ycze?"),plr)
        else
            local tabelka rent
            if jestwtabeli(tabelka,getElementData(target,"user:uid")) then outputChatBox("* Ten gracz aktualnie posiada kluczyki do twojego pojazdu!",plr) return end
             if #tabelka > 2 then outputChatBox("* Mo?esz wypo?yczy? maksymalnie 2 gracz?!",plr) return end
            table.insert(tabelka,getElementData(target,"veh:uid"))
            setElementData(veh,"veh:uid",tabelka)
            outputChatBox(string.format("* Dodano gracza "..getPlayerName(target).."(UID: "..getElementData(target,"user:uid")..") do wypo?ycze?"),plr)
        end
    end
end)


Za pomoc daje :piwo: + R*

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
dawid420
Wysłany: 2017-05-23, 23:56


amited







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

Piwa: 512

Respekt: 466
Respekt: 466

przy outputboxie z wy??czeniem dla wszystkich graczy:

setElementData(veh,"veh:owner",0)

a w skrypcie wsz?dzie operujesz na dacie veh:uid.

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

 
Tagi: kluczyki :: pojazdu
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku