Jump to content

Ayuda :P


Flipi

Recommended Posts

Hola, necesito ayuda con este script (editar)

Lo que realiza este script es cambiar el color del nitro, pero solo el que pone el comando puedes verlo, los demás no, la cosa es que quiero que sea visible para todos, ej: "/nitro 255 0 0" y que todos vean mi color de nitro.

addEventHandler("onClientResourceStart",resourceRoot, 
function() 
    nitroShader = dxCreateShader("nitro.fx") 
end) 
  
function updateNitroColor(r,g,b) 
    if nitroShader then 
        if r and g and b then 
            engineApplyShaderToWorldTexture (nitroShader,"smoke") 
            dxSetShaderValue (nitroShader, "gNitroColor", r/255, g/255, b/255 ) 
        end 
    end 
end 
  
function resetNitroColor() 
    if nitroShader then 
        engineRemoveShaderFromWorldTexture(nitroShader,"smoke") 
    end 
end 
  
  
addCommandHandler("nitro", 
function(command,r,g,b) 
    if r and g and b then 
        local r,g,b = tonumber(r),tonumber(g),tonumber(b) 
        if r <= 0 and g <= 128 and b <= 255 then 
            updateNitroColor(r,g,b) 
            outputChatBox("Nuevo color de nitro!", 0, 128, 255, true) 
        else 
            outputChatBox("Los colores deben ser entre 0 y 255", 0, 128, 255, true) 
        end 
    else 
        resetNitroColor() 
        outputChatBox("El color del nitro volvio al original!", 0, 128, 255, true) 
    end 
end) 
  

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...