Page 1 of 1

problem with removing items using /remove

Posted: Sat Aug 27, 2016 12:09 pm
by android7
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?

Re: problem with removing items using /remove

Posted: Sat Aug 27, 2016 2:06 pm
by gwendalaze
the only command that can be used in a script are the command that can be used as startup commands in your map

Re: problem with removing items using /remove

Posted: Sat Aug 27, 2016 4:46 pm
by android7
Oh, OK.
Is there some simple way to remove weapons?

Re: problem with removing items using /remove

Posted: Sat Aug 27, 2016 5:47 pm
by gwendalaze
yes

player.RemoveWeaponItemType(WeaponItemType.Rifle);

rifle cand be replaced by Melee, Handgun, Thrown or InstantPickup (though i don't know what the latter do)

Re: problem with removing items using /remove

Posted: Sat Aug 27, 2016 6:33 pm
by Gurt
The "Command /remove 0 1" should probably work as we have the API to remove that stuff anyway. Moving this to the bugs section.

Re: problem with removing items using /remove

Posted: Sun Sep 11, 2016 12:33 pm
by Gurt
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