This forum is locked and will eventually go offline. If you have feedback to share you can find us in our Discord channel "MythoLogic Interactive" https://discord.gg/nECKnbT7gk

Forum rules

problem with removing items using /remove

Here you can find all solved gameplay problems and bugs (beginning from Pre-Alpha 1.8.8).
Forum rules
By using the forum you agree to the following rules. For this forum you also need to follow these additional rules.
Locked
android7
Fighter
Fighter
Posts: 21
Joined: Sat Aug 27, 2016 11:54 am

problem with removing items using /remove

Post by android7 » Sat Aug 27, 2016 12:09 pm

I used
public void Hit(TriggerArgs args){
Game.RunCommand("/remove 0 1 ");
}
in my map, but after Hit takes place it says that "Command /remove 0 1´ is not valid game map command"
But when I type it in chat, it works flawlessly.
Any help?
0 x

User avatar
gwendalaze
Superfighter
Superfighter
Posts: 84
Joined: Sat Mar 19, 2016 12:55 pm
Title: Jarate Yellow Belt
Started SFD: PreAlpha 1.1.4
Location: France

Post by gwendalaze » Sat Aug 27, 2016 2:06 pm

the only command that can be used in a script are the command that can be used as startup commands in your map
0 x
- Gwendalaze, failing at being fun, just like this signature

android7
Fighter
Fighter
Posts: 21
Joined: Sat Aug 27, 2016 11:54 am

Post by android7 » Sat Aug 27, 2016 4:46 pm

Oh, OK.
Is there some simple way to remove weapons?
0 x

User avatar
gwendalaze
Superfighter
Superfighter
Posts: 84
Joined: Sat Mar 19, 2016 12:55 pm
Title: Jarate Yellow Belt
Started SFD: PreAlpha 1.1.4
Location: France

Post by gwendalaze » Sat Aug 27, 2016 5:47 pm

yes

player.RemoveWeaponItemType(WeaponItemType.Rifle);

rifle cand be replaced by Melee, Handgun, Thrown or InstantPickup (though i don't know what the latter do)
0 x
- Gwendalaze, failing at being fun, just like this signature

User avatar
Gurt
Lead Programmer
Lead Programmer
Posts: 1887
Joined: Sun Feb 28, 2016 3:22 pm
Title: Lead programmer
Started SFD: Made it!
Location: Sweden
Gender:
Age: 36

Post by Gurt » Sat Aug 27, 2016 6:33 pm

The "Command /remove 0 1" should probably work as we have the API to remove that stuff anyway. Moving this to the bugs section.
1 x
Gurt

User avatar
Gurt
Lead Programmer
Lead Programmer
Posts: 1887
Joined: Sun Feb 28, 2016 3:22 pm
Title: Lead programmer
Started SFD: Made it!
Location: Sweden
Gender:
Age: 36

Post by Gurt » Sun Sep 11, 2016 12:33 pm

Added "/REMOVE" and "/GIVE" commands to Game.RunCommand(); and world startup commands after Pre-Alpha 1.10.2b.
 ! Message from: KliPeH
This user has been issued a warning for breaking the following forum rule:
Rule #13 - Do not double post.
<3
1 x
Gurt

Locked