Jump to content

SetWeaponProperty Help


ksTakor

Recommended Posts

Posted

Try it

setWeaponProperty (31, "poor", "flags", 0x000004) 
setWeaponProperty (31, "std", "flags", 0x000004) 
setWeaponProperty (31, "pro", "flags", 0x000004) 

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted
  
dxDrawImage 

Events : OnPlayerTarget

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

I have write this script but it don't render the image

Can someone help?

local screenWidth,screenHeight = guiGetScreenSize() 
  
function drawncross ( prevSlot, newSlot ) 
    if getPedWeapon(getLocalPlayer(),newSlot) == 31 then --if the switched weapon is the M4 
        local seconds = getTickCount() / 1000 
        local angle = math.sin(seconds) * 80  
        dxDrawImage ( screenWidth/2 - 637,- 100, 1280, 960, 'arrow.png')--drawn the crosshair 
    else --if it isnt the M4 
        return 
    end 
    end 
end 
addEventHandler ( "onClientPlayerTarget", getRootElement(), drawncross ) 

 

Posted (edited)

EDIT:

--[[ that's not my code, it's csmit195's i just edited it to work with you're script]]-- 
--Client Side 
crosshairShader = dxCreateShader ( "crosshair.fx" ) 
crosshair = dxCreateTexture("arrow.png") 
dxSetShaderValue(crosshairShader,"gTexture",crosshair) 
  
addEventHandler('onClientRender', getRootElement(), 
function() 
    if getControlState('aim_weapon') and getPedTarget(localPlayer) and not active and getPedWeapon(getLocalPlayer(),newSlot) == 31 then 
        engineApplyShaderToWorldTexture(crosshairShader,"sitem16") 
        active = true 
    elseif getControlState('aim_weapon') and getPedTarget(localPlayer) and active then 
        
    elseif active then 
        engineRemoveShaderFromWorldTexture(crosshairShader,"sitem16") 
        active = false 
    end 
end) 

Edited by Guest

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

Yes and crosshair.fx too

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

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...