Jump to content

#setWeaponProperty


Recommended Posts

Hi guys.

Im work on the weapon level system. But i have a problem.

When i click the DLev1 button, setWeaponProperty event is taking place for everyone.

But I want to happen to people who click.

How do it?

--[[Client-Side]]-- 
local x, y = guiGetScreenSize () 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        DLev1 = guiCreateStaticImage((x/2)-12.5 , (y/2)-17.5, 25, 35, "images/egg.png", false)   
        addEventHandler ( "onClientGUIClick", DLev1, DLev11, false ) 
    end 
) 
  
function DLev11() 
    if (getPlayerMoney(source) >= 2250) then 
        if ( guiGetEnabled (DLev1) == true ) then 
            guiStaticImageLoadImage(DLev1, "images/egg_sel.png" ) 
            guiSetAlpha(DLev1, 1.00) 
            guiSetEnabled ( DLev1, false ) 
        end 
    end 
triggerServerEvent ( "DeagleStats1", root) 
end 

--[[server-Side]]-- 
deagle_damage = 0.40 
  
function DLev1() 
if (getPlayerMoney(client) >= 2250) then 
        takePlayerMoney ( client, 2250 ) 
        setPedStat(client, 71, 200) 
        setElementHealth (client, 121) 
        setElementData( client, "deagle_level", 1 ) 
         
        local damage_poor = getWeaponProperty(24, "poor", "damage") 
        local damage_std = getWeaponProperty(24, "std", "damage") 
        local damage_pro = getWeaponProperty(24, "pro", "damage") 
         
        setWeaponProperty(24, "poor", "damage", damage_poor+deagle_damage) 
        setWeaponProperty(24, "std", "damage", damage_std+deagle_damage) 
        setWeaponProperty(24, "pro", "damage", damage_pro+deagle_damage) 
    end 
end 
addEvent ("DeagleStats1", true) 
addEventHandler ( "DeagleStats1", root, DLev1) 

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