Jump to content

Client custom weapon


DRW

Recommended Posts

Posted

Hello, I have a problem. I'm using custom weapons with createWeapon, I'm going to explain the problem:

First of all, I create a weapon and set an ElementData to this weapon, something like this:

weapon1 = createWeapon ("minigun",x,y,z) 
setElementData(weapon1,"owner",getPlayerName(localPlayer)) 

then when a weapon kills the ped use this onClientPedWasted:

local pyer = getPlayerFromName(getElementData(weapon1,"owner")) 
  
setElementData(pyer,"kills",getElementData(pyer,"kills")+1) 

As you see, the script is ok, but onClientPedWasted only supports player and vehicle elements, what can I do?

I've tried using onClientWeaponFire to check if a ped is dead and then setting the "kills" elementData but somehow it adds more kills than 1.

tJ5zeFm.gif

Proud owner and developer of ZNEXT: Aftermath.

Enter a post-apocalyptic San Andreas and fight over 30 types of enemies and bosses with varying difficulties and skills, improve and customize your character by leveling up, completing challenges and a solid lootbox system with no Pay-to-Win mechanics that will break your experience.

Meet new characters, creatures and weapon metas, experience an innovative combo-based melee system, or join our solid PvP modes to show other survivors who’s boss. 

Español, Pусский, Türk, عربى, Polski, Português

IP: mtasa://104.36.110.227:22003 - Discord: https://discord.gg/CxMxjvC5pB

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