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

Wysłany: 2016-02-09, 19:25


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4470 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Witam, czy jest jakas funkcja na zrobienie dla gracza blipu? Czy musze lecie? z createBlipAttachtedTo?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-09, 19:39


#404







Wiek: 27
Na forum: 4912 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
BlackTen, eem w?a?ciwie to w?a?nie tej funkcji co napisa?e? si? u?ywa, nie widz? jakiego? problemu w u?yciu jej. Nie rozumiesz czego? odno?nie u?ycia czy co?? Bo w tym momencie nie rozumiem Cie, je?eli tak to napisz a wyt?umaczymy.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-09, 20:08


MIKAELmta







Wiek: 25
Na forum: 4120 dni
Posty: 311

Piwa: 10631

Respekt: 355,3
Respekt: 355,3Respekt: 355,3Respekt: 355,3Respekt: 355,3

root = getRootElement ()
color = { 0, 255, 0 }
players = {}
resourceRoot = getResourceRootElement ( getThisResource () )

function onResourceStart ( resource )
      for id, player in ipairs( getElementsByType ( "player" ) ) do
        if ( players[player] ) then
            createBlipAttachedTo ( player, 0, 2, players[source][1], players[source][2], players[source][3] )
        else
            createBlipAttachedTo ( player, 0, 2, color[1], color[2], color[3] )
        end
    end
end

function onPlayerSpawn ( spawnpoint )
    if ( players[source] ) then
        createBlipAttachedTo ( source, 0, 2, players[source][1], players[source][2], players[source][3] )
    else
        createBlipAttachedTo ( source, 0, 2, color[1], color[2], color[3] )
    end
end

function onPlayerQuit ()
    destroyBlipsAttachedTo ( source )
end

function onPlayerWasted ( totalammo, killer, killerweapon )
    destroyBlipsAttachedTo ( source )
end

function setBlipsColor ( source, commandName, r, g, b )
    if ( tonumber ( b ) ) then
        color = { tonumber ( r ), tonumber ( g ), tonumber ( b ) }
          for id, player in ipairs( getElementsByType ( "player" ) ) do
            destroyBlipsAttachedTo ( player )
            if ( players[player] ) then
                createBlipAttachedTo ( player, 0, 2, players[source][1], players[source][2], players[source][3] )
            else
                createBlipAttachedTo ( player, 0, 2, color[1], color[2], color[3] )
            end
        end
    end
end

function setBlipColor ( source, commandName, r, g, b )
    if ( tonumber ( b ) ) then
        destroyBlipsAttachedTo ( source )
        players[source] = { tonumber ( r ), tonumber ( g ), tonumber ( b ) }
          createBlipAttachedTo ( source, 0, 2, players[source][1], players[source][2], players[source][3] )
    end
end

addCommandHandler ( "setblipscolor", setBlipsColor )
addCommandHandler ( "setblipcolor", setBlipColor )
addEventHandler ( "onResourceStart", resourceRoot, onResourceStart )
addEventHandler ( "onPlayerSpawn", root, onPlayerSpawn )
addEventHandler ( "onPlayerQuit", root, onPlayerQuit )
addEventHandler ( "onPlayerWasted", root, onPlayerWasted )

function destroyBlipsAttachedTo(player)
    local attached = getAttachedElements ( player )
    if ( attached ) then
        for k,element in ipairs(attached) do
            if getElementType ( element ) == "blip" then
                destroyElement ( element )
            end
        end
    end
end


o.0
O g?ry zmieniasz kolor.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-10, 15:42


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4470 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Ja nie chce YWG bo robie WG, wi?c si? pytam, a nie prosz? o gotowca...

Postaw piwo autorowi tego posta
 

 
Tagi: blip
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