Jump to content

don t work!!


Scripting

Recommended Posts

is this work??!

client-side:

addEventHandler ( "onClientPlayerWeaponFire",localPlayer,  
function (weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement) 
if ( weapon == 26) then 
triggerServerEvent("setit",getLocalPlayer()) 
end 
end 
) 

server-side:

addEvent("setit",true)  
  addEventHandler("setit",root,  
   function() 
setWeaponProperty ( "sawnoff_shotgun", "pro", "maximum_clip_ammo", 1000 ) 
end 
) 

Link to comment

https://wiki.multitheftauto.com/wiki/SetWeaponProperty

You need learn all. See function requirements.

Anyway I tabulated and organized your code.

Client-side:

addEventHandler ( 'onClientPlayerWeaponFire', localPlayer, 
    function ( w, a, aIC, x, y, z, elem ) 
        if ( w == 26 ) then 
            triggerServerEvent ( 'setIt', localPlayer ) 
        end 
    end 
) 

Server-side:

addEvent ( 'setIt', true ) 
  
addEventHandler ( 'setIt', root, 
    function ( ) 
        setWeaponProperty ( 'sawnoff_shotgun', 'pro', 'maximum_clip_ammo', 1000 ) 
    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...