Custom Weapon System
#1

How would I be able to make a custom weapon system?

Weapons use existing models but have different damages based on the type of gun that they are.

How can I create a system like that? I want to do it myself but if someone could show me a small example, that'd be great.

[Edit]

Heres a video if you don't understand:
https://www.youtube.com/watch?v=K8iMnHZs8aw
Reply
#2

There is a bunch of things you need to do it right there really is no small example because it requires a complete re-work of the way in which damage is issued.

To sum it up quickly.

- You need to set all players to the same team (Hooking SetPlayerTeam() GetPlayerTeam())
- You need to use OnPlayerGiveDamage() to process damage amounts
- You need to use OnPlayerTakeDamage() to process other damage (Car ramming, heliblading, fall damage)
- OnPlayerTakeDamage() is passed directly to OnPlayerGiveDamage()
- Server sided health/armor variables are also required
Reply
#3

Thanks mate.
Reply
#4

Quote:
Originally Posted by Pottus
View Post
There is a bunch of things you need to do it right there really is no small example because it requires a complete re-work of the way in which damage is issued.

To sum it up quickly.

- You need to set all players to the same team (Hooking SetPlayerTeam() GetPlayerTeam())
- You need to use OnPlayerGiveDamage() to process damage amounts
- You need to use OnPlayerTakeDamage() to process other damage (Car ramming, heliblading, fall damage)
- OnPlayerTakeDamage() is passed directly to OnPlayerGiveDamage()
- Server sided health/armor variables are also required
Hmm... Yea, I feel like I just asked the same stuff, and it turns out, Pottus was the one to run me through it.

Click me to see additional info on my old situation!
Reply
#5

OnPlayerTakeDamage, you can change the amount of damage the weapon does.
Reply
#6

@TakeiT - There is a lot of things you need to consider OPTG is only part of this didn't you read my post ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)