droffy....

Have questions about CoD/UO mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

User avatar
Soviet
Core Staff
Core Staff
Posts: 7762
Joined: April 23rd, 2005, 9:12 pm

droffy....

Post by Soviet » September 23rd, 2006, 4:41 pm

what is the scripting command to take away someone's weapons?

creator
CJ Worshipper
CJ Worshipper
Posts: 492
Joined: July 6th, 2006, 11:37 pm
Location: The Netherlands
Contact:

Post by creator » September 23rd, 2006, 5:25 pm

dont think its possible without a mod
Cod 1 Mapper&Modder&Moddeler

Luke
Past/Inactive Team Member
Past/Inactive Team Member
Posts: 1774
Joined: May 31st, 2005, 12:42 am
Location: Cornwall, UK

Post by Luke » September 23rd, 2006, 7:11 pm

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
Watch this before posting a question: http://www.albinoblacksheep.com/flash/posting.php

User avatar
Soviet
Core Staff
Core Staff
Posts: 7762
Joined: April 23rd, 2005, 9:12 pm

Post by Soviet » September 23rd, 2006, 7:36 pm

awesome, thanks ks and luke

creator
CJ Worshipper
CJ Worshipper
Posts: 492
Joined: July 6th, 2006, 11:37 pm
Location: The Netherlands
Contact:

Post by creator » September 23rd, 2006, 7:39 pm

i think thats for singel player.
Cod 1 Mapper&Modder&Moddeler

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » September 24th, 2006, 2:03 pm

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.
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
Soviet
Core Staff
Core Staff
Posts: 7762
Joined: April 23rd, 2005, 9:12 pm

Post by Soviet » September 24th, 2006, 7:21 pm

is there a way to make it work for when you spawn it takes away the weapons?

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » September 25th, 2006, 12:34 am

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...
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
YaNo
CJ Worshipper
CJ Worshipper
Posts: 460
Joined: May 5th, 2005, 9:34 pm
Location: Azeroth
Contact:

Post by YaNo » September 25th, 2006, 5:40 pm

for the ones that like thommyjumping (jump gaps with thompsen) then dont take away the tompsen :D
just that we love you ^^

User avatar
Soviet
Core Staff
Core Staff
Posts: 7762
Joined: April 23rd, 2005, 9:12 pm

Post by Soviet » October 1st, 2006, 9:19 pm

finally got around to doing this, there is syntax error:

Image

User avatar
Soviet
Core Staff
Core Staff
Posts: 7762
Joined: April 23rd, 2005, 9:12 pm

Post by Soviet » October 1st, 2006, 10:12 pm

first two get no syntax error, but the script doesnt work, you just spawn with the weapon you selected.

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » October 1st, 2006, 11:46 pm

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^
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
Soviet
Core Staff
Core Staff
Posts: 7762
Joined: April 23rd, 2005, 9:12 pm

Post by Soviet » October 1st, 2006, 11:58 pm

you lose too, bad syntax on same line :)

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13315
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Post by Drofder2004 » October 2nd, 2006, 2:13 am

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 :
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

User avatar
Soviet
Core Staff
Core Staff
Posts: 7762
Joined: April 23rd, 2005, 9:12 pm

Post by Soviet » October 2nd, 2006, 2:32 am

Image

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest