Jump to content

Custom weapon for players.


Matey

Recommended Posts

Basically, I've seen in so many servers that you're able to make several weapons based on the same model (eg: AK47, AKS, AK74, etc).

createWeapon 

didn't work, since it's for peds only.

Now I've tried to make an unique Deagle, called Glock and when it spawns it has extended clip of 30 bullets.

function Glock () 
    local status = giveWeapon ( thePlayer, 24, 100 ) 
setWeaponProperty(24, "pro", "maximum_clip_ammo", 30) 
end 
addCommandHandler ( "give", Glock ) 

And yet I had no luck. Any ideas?

Link to comment
Did you make that in the client side?

giveWeapon is Server-only function.

Yeah and

createWeapon 

is a client-only function. So he's going to need an event to do al this.

createWeapon is for peds only, not players, already tried bruh.

Link to comment

i have done something similar but i don't suggest it because you have to giveWeapon every time player changes slot, also it's not very reliable. it causes lag and if the server is lagging player will get the weapon in delay so yeah this could cause some problem. nevertheless, if you still want to do it you'll use these;

[url=https://wiki.multitheftauto.com/wiki/OnPlayerWeaponSwitch]https://wiki.multitheftauto.com/wiki/On ... aponSwitch[/url], [url=https://wiki.multitheftauto.com/wiki/GiveWeapon]https://wiki.multitheftauto.com/wiki/GiveWeapon[/url]  

and of course you must be familiar with lua tables to make it work correctly, good luck

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