Posts: 344
Threads: 88
Joined: Jun 2014
Reputation:
0
Hello.
I want to introduce custom weapons in my gamemode .
The trouble is that I do not know how.
I had the idea of making an array to store the names of weapons and so on, but how to recover afterwards?
Since it will not be "Desert Eagle" for example, but another ..
++
Posts: 344
Threads: 88
Joined: Jun 2014
Reputation:
0
Exactly I do not see how.
Posts: 686
Threads: 29
Joined: Feb 2011
Reputation:
0
Make arrays of strings, set weapon names in them, use a saving system (whether file or SQL system) to save your variables and load them with the said system.
Posts: 253
Threads: 17
Joined: Jan 2014
Reputation:
0
Check out SIF include by Southclaw, and his S&S open source gamemode.
Posts: 253
Threads: 17
Joined: Jan 2014
Reputation:
0
I said check out his SIF / S&S gamemode, he has a system to make custom weapons, with custom bullets, so you might wanna throw an eye on that and check out how he did it.
Posts: 344
Threads: 88
Joined: Jun 2014
Reputation:
0
Thanks to the custom , I intended to add several weapons : several desert eagle, several AK-47 etc.
What to do? And give a name to each weapon , with your method?
Posts: 344
Threads: 88
Joined: Jun 2014
Reputation:
0
I wondered especially :
When the player switch the weapon, the object is still attached ...
Posts: 253
Threads: 17
Joined: Jan 2014
Reputation:
0
if you follow the code Southclaw wrote you, what it does is, it gives a normal ak ( same id ) , just with a different name, different damage. so you can have multiple AK's, same ids, just different params. what you basically do is just give a normal ak so you won't worry about object attached because you don't even attach it in the first place.
The way Southclaw did it in S&S project, is you can only hold one weapon at a time, you can have more weapons but they are in the inventory and one slot for holstering.
You can know when the player switches the weapon through OnPlayerUpdate and save 2 vars, new weapon, last weapon, if they are different delete last object, attach the new object.
Posts: 344
Threads: 88
Joined: Jun 2014
Reputation:
0
How to detect if a player switch weapon?