Jump to content

replace all blips with new blips


Desaster

Recommended Posts

This is a simple example from my script, it will change all the hud(and blips)of youre server.

Client side:

local huds = { 
    "arrow", 
    "fist", 
    "font1", 
    "font2", 
    "radardisc", 
    "radarRingPlane", 
    "radar_airYard", 
    "radar_ammugun", 
    "radar_barbers", 
    "radar_BIGSMOKE", 
    "radar_boatyard", 
    "radar_bulldozer", 
    "radar_burgerShot", 
    "radar_cash", 
    "radar_CATALINAPINK", 
    "radar_centre", 
    "radar_CESARVIAPANDO", 
    "radar_chicken", 
    "radar_CJ", 
    "radar_CRASH1", 
    "radar_dateDisco", 
    "radar_dateDrink", 
    "radar_dateFood", 
    "radar_diner", 
    "radar_emmetGun", 
    "radar_enemyAttack", 
    "radar_fire", 
    "radar_Flag", 
    "radar_gangB", 
    "radar_gangG", 
    "radar_gangN", 
    "radar_gangP", 
    "radar_gangY", 
    "radar_girlfriend", 
    "radar_gym", 
    "radar_hostpital", 
    "radar_impound", 
    "radar_light", 
    "radar_LocoSyndicate", 
    "radar_MADDOG", 
    "radar_mafiaCasino", 
    "radar_MCSTRAP", 
    "radar_modGarage", 
    "radar_north", 
    "radar_OGLOC", 
    "radar_pizza", 
    "radar_police", 
    "radar_propertyG", 
    "radar_propertyR", 
    "radar_qmark", 
    "radar_race", 
    "radar_runway", 
    "radar_RYDER", 
    "radar_saveGame", 
    "radar_school", 
    "radar_spray", 
    "radar_SWEET", 
    "radar_tattoo", 
    "radar_THETRUTH", 
    "radar_TORENO", 
    "radar_TorenoRanch", 
    "radar_triads", 
    "radar_triadsCasino", 
    "radar_truck", 
    "radar_tshirt", 
    "radar_waypoint", 
    "radar_WOOZIE", 
    "radar_ZERO", 
    "siteM16", 
    "siterocket", 
    "skipicon", 
} 
  
function replaceHuds() 
    for key,hud in ipairs(huds) do 
    texShader = dxCreateShader ( "shader/shader.fx" ) 
    createdHud = dxCreateTexture("img/hud/"..hud..".png") 
    dxSetShaderValue(texShader,"gTexture",createdHud) 
    engineApplyShaderToWorldTexture(texShader,tostring(hud)) 
    end 
end 
addEventHandler("onClientResourceStart", resourceRoot, replaceHuds) 

Shader.fx(important)

texture gTexture; 
  
technique TexReplace 
{ 
    pass P0 
    { 
        Texture[0] = gTexture; 
    } 
} 

Edited by Guest
Link to comment

He said not to create a fully new one, so he's meaning to replace a blip with another blip.

On the wiki is a example:

https://wiki.multitheftauto.com/wiki/GetBlipIcon

-- Retrieve a table containing all the blips that exist 
blips = getElementsByType ( "blip" ) 
-- Loop through the list, storing the blip from the table in the variable blipValue 
for blipKey, blipValue in ipairs(blips) do 
    -- Retrieve the blip's icon into the variable 'blipIcon' 
    blipIcon = getBlipIcon ( blipValue ) 
    -- If the blip's icon wasn't the default already 
    if ( blipIcon ~= 0 ) then 
        -- Set the blip's icon to the default 
        setBlipIcon ( blipValue, 0 ) 
    end 
end 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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