Wysłany: 2016-11-17, 18:16
macieq.
Grafik
Wiek: 28 Na forum: 3513 dni Posty: 42
Nick w MP: 1Macieq
Od kiedy wgra?em blipy, na serwer kiedy osoba wyjdzie z serwera.. blipy zostaj? :\
Wysłany: 2016-11-17, 18:19
Barcioo
Kiedyś to było ST
Wiek: 26 Na forum: 4048 dni Posty: 458
Nick w MP: Bartek.
Piwa : 1887
poka? kod
Podpis
Kanał Youtube;
A tu zapraszam
[you]
, pomogłem Ci? Wynagrodź mnie
SUPPORT TEAM - 2016-09-03 do 2018-05-25
Test Mod - 2018-05-25
1k dni na Forum - 2018-01-28
GG: 62111935
Wysłany: 2016-11-17, 18:21
macieq.
Grafik
Wiek: 28 Na forum: 3513 dni Posty: 42
Nick w MP: 1Macieq
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 r , g , b = getPlayerNametagColor ( player )
local blip = createBlipAttachedTo ( player , 0 , 2 , r , g , b , 255 , 1 )
setElementParent ( blip , playerBlipRoot )
end
end
end
addEventHandler ( "onClientResourceStart" , root , resourceStart )
-- This function creates a blip for new players when they join .
local function playerJoin ()
local r , g , b = getPlayerNametagColor ( source )
local blip = createBlipAttachedTo ( source , 0 , 2 , r , g , b , 255 , 1 )
setElementParent ( blip , playerBlipRoot )
setTimer ( updateBlipColor , 5000 , 1 , blip ) -- Upadate in 5 seconds , in case the server sets the color .
end
addEventHandler ( "onClientPlayerJoin" , root , playerJoin )
-- 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" , root , playerQuit )
-- 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
Wysłany: 2016-11-17, 18:24
PapaSmerf
Wiek: 25 Na forum: 3525 dni Posty: 237
Piwa : 3857
Wysłany: 2016-11-17, 22:10
Pawel5321
Szkrypter
Wiek: 36 Na forum: 3809 dni Posty: 237
Nick w MP: Pawell
Piwa : 2315
oto kod + wytlumaczenie
playerBlips = { } -- tabela zawerajaca informacje o blipach
for index , value in ipairs ( getElementsByType ( "player" )) do -- petla
if( playerBlips [ value ] ) then
destroyElement ( playerBlips [ value ] )
playerBlips [ value ] = nil -- jezeli gracz ma blip to go usun
else
playerBlips [ value ] = createBlipAttachedTo ( value , 0 ) -- jezeli nie to stworz nowy
end
end
addEventHandler ( "onPlayerJoin" , root ,function()
playerBlips [ source ] = createBlipAttachedTo ( source , 0 )
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
Tagi: blipy :: zostaja
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: