Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: sprayem
1. Leczenie sprayem, łokieć
Witam, posiadam kod splita na leczenie sprayem, odkry?em bug ?e je?li medyk jest za blisko gracza, mo?e po prostu bi? go ramieniem i otrzymywa? ca?y czas pieni?dze za ka?de uderzenie.
Client:
local koszt = 5 -- tutaj ustawiamy koszt za uleczonego gracza.

-- 
Leczenie sprayem
addEventHandler
("onClientPlayerDamage", root, function(attacker, weapon)
    if 
getElementData(el,"player:faction") ~= 6 then
    
if weapon == 41 then cancelEvent() end -- blokujemy zabijanie
        
if weapon == 41 and attacker then -- sprawdzamy bro?
            
local hp = getElementHealth(localPlayer) -- pobieramy hp
            local health 
= hp+math.random(2,3) -- losujemy ilo?c hp
            
if health > hp and health <= 100 then -- sprawdza hp
                setElementHealth
(localPlayer, health) -- ulecza gracza
                
if health > 80 then triggerServerEvent("givePlayerMoney", attacker, koszt) end -- otrzymuje kas?
            
end    
        end
    end
end
)

Za pomoc b?d? piffka
2. Malowanie pojazdu Sprayem
Witajcie. Chcia?em zrobi? malowanie pojazdu sprayem lecz napotka?em problem:


function kolor_czerwony(thePlayer)
    
giveWeapon (thePlayer, 41, 999)
    
setVehicleColor (thePlayer, 255, 0, 0)
    
takePlayerMoney (thePlayer, 200)
    
outputDebugString ("Gracz kupil spray:red")
end
addCommandHandler 
("spray:red", kolor_czerwony)


Daje spray, pobiera kase lecz nie maluje pojazdu, I chcia?bym aby malowanie by?o p?ynne a nie raz klikne i ju? auto pomalowane :(
[/code]