Dear forum users! In compliance with the new European GDPR regulations, we'd just like to inform you that if you have an account, your email address is stored in our database. We do not share your information with third parties, and your email address and password are encrypted for security reasons.
New to the forum? Say hello in this topic!
Also make sure to read the rules
A smaller forum with a few tutorials how to get started with the ScriptAPI.
- Lead Programmer
- Posts: 1884
- Joined: Sun Feb 28, 2016 3:22 pm
- Title: Lead programmer
- Started SFD: Made it!
- Location: Sweden
- Age: 31
Scripting 17 - Give/Remove player items
Scripting in SFD assumes you have a fair knowledge of C#.
The following code demonstrates how to give a pistol and remove any katana from a player when the player push a button:
Code: Select all
public void ButtonPressed(TriggerArgs args)
if (args.Sender is IPlayer)
IPlayer plr = (IPlayer)args.Sender;
if (plr.CurrentMeleeWeapon.WeaponItem == WeaponItem.KATANA)