Page 1 of 2

droffy....

Posted: September 23rd, 2006, 4:41 pm
by Soviet
what is the scripting command to take away someone's weapons?

Posted: September 23rd, 2006, 5:25 pm
by creator
dont think its possible without a mod

Posted: September 23rd, 2006, 7:11 pm
by Luke
Yeah its listed in the Call of Duty 2\Docs\ScriptFunctions..i didnt know till recently they included a functions list, so that may be useful to know :P

Posted: September 23rd, 2006, 7:36 pm
by Soviet
awesome, thanks ks and luke

Posted: September 23rd, 2006, 7:39 pm
by creator
i think thats for singel player.

Posted: September 24th, 2006, 2:03 pm
by Drofder2004
KillerSam wrote:List of handy commands here:

Code: Select all

remove_weapons()
{
self takeallweapons();
self giveweapon("kar98k_mp");
self setweaponslotammo("primary", 0);
self setweaponslotclipammo("primary", 0);
self switchtoweapon("kar98k_mp");
}
Use as needed.
This is correct.
Just to add input, there are ways of taking specific weapons from people, or taking away the players secondary weapon, but they require a bit more input.

Posted: September 24th, 2006, 7:21 pm
by Soviet
is there a way to make it work for when you spawn it takes away the weapons?

Posted: September 25th, 2006, 12:34 am
by Drofder2004
Soviet wrote:is there a way to make it work for when you spawn it takes away the weapons?
This may work... put this in your main()...

Code: Select all

thread onConnect();
Now, use these two functions...

Code: Select all

OnConnect()
{
   for(;;)
   {
      level waittill("connecting",self);
      self thread onPlayerSpawned();
   }
}

Code: Select all

onPlayerSpawned()
{
   for(;;)
   {
      self waittill("spawned_player");
      self takeAllWeapons();
      self giveWeapon("kar98k_mp");
      self switchToWeapon("kar98k_mp");
   }
}
Check if that works...

Posted: September 25th, 2006, 5:40 pm
by YaNo
for the ones that like thommyjumping (jump gaps with thompsen) then dont take away the tompsen :D
just that we love you ^^

Posted: October 1st, 2006, 9:19 pm
by Soviet
finally got around to doing this, there is syntax error:

Image

Posted: October 1st, 2006, 10:12 pm
by Soviet
first two get no syntax error, but the script doesnt work, you just spawn with the weapon you selected.

Posted: October 1st, 2006, 11:46 pm
by Drofder2004
KillerSam wrote:i think it should be

Code: Select all

"connecting.self"
or

Code: Select all

"connecting, self"
or

Code: Select all

"connecting".self"
Not sure which, but try them (guess work tbh)
lol, nice attempt but they are all wrong, its just a matter of tense.

level waittill("connected", self);
Try^

Posted: October 1st, 2006, 11:58 pm
by Soviet
you lose too, bad syntax on same line :)

Posted: October 2nd, 2006, 2:13 am
by Drofder2004
Soviet wrote:you lose too, bad syntax on same line :)
wheres the bad syntax on that line?

its looks fine but my only guess is either the , is a . or the ; is a :

Posted: October 2nd, 2006, 2:32 am
by Soviet
Image