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

Wysłany: 2016-11-17, 18:16


macieq.

Grafik






Wiek: 28
Na forum: 3513 dni
Posty: 42
Nick w MP: 1Macieq



Respekt: 50

Od kiedy wgra?em blipy, na serwer kiedy osoba wyjdzie z serwera.. blipy zostaj? :\

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-17, 18:19


Barcioo

Kiedyś to było ST






Wiek: 26
Na forum: 4049 dni
Posty: 458
Nick w MP: Bartek.

Piwa: 1887

Respekt: 460
Respekt: 460

poka? kod

Podpis
Kanał Youtube;
A tu zapraszam
, pomogłem Ci? Wynagrodź mnie :piwo: :)


SUPPORT TEAM- 2016-09-03 do 2018-05-25
Test Mod- 2018-05-25
1k dni na Forum - 2018-01-28


GG: 62111935
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-17, 18:21


macieq.

Grafik






Wiek: 28
Na forum: 3513 dni
Posty: 42
Nick w MP: 1Macieq



Respekt: 50

local playerBlipRoot createElement("playerBlipRoot""playerBlipRoot")

--This function creates blips for all players when the resource starts.
local function resourceStart()
    for _player in ipairs(getElementsByType("player")) do
        if player ~= localPlayer then
            local rggetPlayerNametagColor(player)
            local blip createBlipAttachedTo(player02rgb2551)
            setElementParent(blipplayerBlipRoot)
        end
    end
end
addEventHandler("onClientResourceStart"rootresourceStart)

--This function creates a blip for new players when they join.
local function playerJoin()
    local rggetPlayerNametagColor(source)
    local blip createBlipAttachedTo(source02rgb2551)
    setElementParent(blipplayerBlipRoot)
    setTimer(updateBlipColor50001blip) --Upadate in 5 secondsin case the server sets the color.
end
addEventHandler("onClientPlayerJoin"rootplayerJoin)

--This function destroys a players blip when they quit.
local function playerQuit()
    for _blip in ipairs(getElementChildren(playerBlipRoot)) do
        if getElementAttachedTo(blip) == source then
            destroyElement(blip)
        end
    end
end
addEventHandler("onClientPlayerQuit"rootplayerQuit)

--This function updates a blip's color, ensuring the blip colors always match.
function updateBlipColor(blip)
    local player = getElementAttachedTo(blip)
    if player then
        local r, g, b = getPlayerNametagColor(player)
        setBlipColor(blip, r, g, b, 255)
    end
end 


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-17, 18:24


PapaSmerf







Wiek: 25
Na forum: 3525 dni
Posty: 237

Piwa: 3857

Respekt: 64

https://community.multitheftauto.com/index.php?p=resources&s=details&id=230
pobierz to, i jak mam by? szczery nie wymy?laj bo nie ma co nad blipami, ten skrypt na blipy wiele lepszy :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-11-17, 22:10


Pawel5321

Szkrypter






Wiek: 36
Na forum: 3809 dni
Posty: 237
Nick w MP: Pawell

Piwa: 2315

Respekt: 240
Respekt: 240Respekt: 240

oto kod + wytlumaczenie

playerBlips = { } -- tabela zawerajaca informacje o blipach
for index,value in ipairs(getElementsByType("player")) do --petla
if( playerBlips value ] ) then
destroyElementplayerBlipsvalue ] )
        playerBlips value ] = nil -- jezeli gracz ma blip to go usun
        else
            playerBlips[value] = createBlipAttachedTo value) -- jezeli nie to stworz nowy
end
end
addEventHandler("onPlayerJoin",root,function()
    playerBlips[source] = createBlipAttachedTo source,)
end)     -- tworzenie blipa przy wejsciu gracza na serwer
addEventHandler("onPlayerQuit",root,function()
 if (playerBlips[source]) then
destroyElement(playerBlips[source])
    playerBlips[source] = nil
    end
end) -- niszczenie przy wyjsciu


Postaw piwo autorowi tego posta
 

 
Tagi: blipy :: zostaja
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Blipy zostaja 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