How do i give all my players the Silenced pistol

Post your scripting questions / solutions here

Moderator: Moderators

rmatheson
Private
Posts: 5
Joined: Fri Feb 06, 2004 6:00 am

How do i give all my players the Silenced pistol

Post by rmatheson »

:? How do i give all my players the Silenced pistol.
This is for mohaa allied assault.

Ive tryed everything can not figure this out. I just want the server to have it not the client do i need to do a map fix for this. I just need the code and were to put it. Just want to add the silenced pistal to the weapons that way they have all pistols. Please help

Randy&Sons
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Code: Select all

for(local.i = 1; local.i <= $player.size; local.i++)
  $player[local.i] item weapons/silencedpistol.tik // <-- mite be a different file
Image
rmatheson
Private
Posts: 5
Joined: Fri Feb 06, 2004 6:00 am

Post by rmatheson »

were do i put it . The code
rmatheson
Private
Posts: 5
Joined: Fri Feb 06, 2004 6:00 am

Post by rmatheson »

Please help


Please tell me is that all the code i will have to put in i think i know were it going but not sure plese tell me were to put it and if thats all the code i will have to use. Thanks
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Put it directly after

Code: Select all

waittill roundstart
in main.
Admin .MAP Forums
Image
Head above heels.
rmatheson
Private
Posts: 5
Joined: Fri Feb 06, 2004 6:00 am

Post by rmatheson »

I tryed it and it dos not work for me can you walk me threw it thanks
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

pistol

Post by tltrude »

You'll have to get rid of their normal pistols first, I think. Why not just spawn a bunch of pistols thay can pick up?

models/weapons/silencedpistol.tik
Tom Trude,

Image
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

an easier solution, but they'd still have to throw down the pistols they're carrying,

you could however create a trigger round the afore mentioned pistol, remove the pistol, get the ammo count and then replace it with silenced pistols,
hope this helps, prob not cos it's all foreign 2 me :-/
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

How would you get the ammo count? :?
Image
nuggets
General
Posts: 1006
Joined: Fri Feb 28, 2003 2:57 am
Location: U-england-K (england in the UK) :P
Contact:

Post by nuggets »

lol, didn't mean that, but i guess that's what i typed, just meant that it'd keep the same ammo count,

$player take weapons/colt45.tik
$player item weapons/silencedpistol.tik
hope this helps, prob not cos it's all foreign 2 me :-/
User avatar
Gold
First Lieutenant
Posts: 176
Joined: Sun Sep 28, 2003 8:10 pm

Post by Gold »

hmmmmm,,i used this command in mohha
$player take weapons/colt45.tik
$player item weapons/silencedpistol.tik


now when i 1st went into the game i said this no work,,,then typed restart in the console and wow had a silent pistol plus the walter and seemed to be sharing the ammo,,,but when i switched teams silenced went bye bye once more,,,untill i typed restart once more,,,tested this in moh1 dm,,,also tryed moving the comand to numerous places but still had same result,,,seems the only way it works with that code only is to type restart

Gold<<mohha freak
User avatar
Gold
First Lieutenant
Posts: 176
Joined: Sun Sep 28, 2003 8:10 pm

Post by Gold »

hmmm,,,did some more testing why not try this for the silenced pistol,,,seems simple enuff
level.script = maps/dm/mohdm1.scr

thread weapons
thread allweapons

exec global/ambient.scr mohdm1
level waittill spawn
weapons:
level.all_weapons = int(getcvar(all_weapons))
if(level.all_weapons == 1)
{
$player item models/weapons/silencedpistol.tik
}
wait 0.1
goto weapons
end

allweapons:
wait 15
$player stufftext "all_weapons 1"

end

seemed to work fine for me anyways,,,and its serverside also ,,so any client joining gets a fully loaded silencer,,ya may wanna change wait time to 10 thou,,guess its according how fast ya want the pistol after ya spawn lol

Gold<<mohha freak
User avatar
Gold
First Lieutenant
Posts: 176
Joined: Sun Sep 28, 2003 8:10 pm

Post by Gold »

Also to add to this,,,i like giving credit were credit is due,,,the above script was posted on tmt by Deadeye arrow,,,all i did i modify it for the silencer only and added a stufftext command so ya wouldnt have to type the command to get the pistol everytime ya wanted to use it:)) I read alot lol
Gold<<mohha freak
User avatar
Gold
First Lieutenant
Posts: 176
Joined: Sun Sep 28, 2003 8:10 pm

Post by Gold »

there was a problem that a later noticed the silenced pistol was getting unlimited ammo ,,also i shortened the time so when ya 1st spawn ya get the silencer,,,so i fixed both problems,,,now the silenced shares ammo with the standard pistol,,heres update:)

level.script = maps/dm/mohdm1.scr

thread weapons
thread allweapons

level waittill spawn

weapons:
level.all_weapons = int(getcvar(all_weapons))
if(level.all_weapons == 1)
{
$player item models/weapons/silencedpistol.tik
local.ammo_pistol = 185
}
wait 0.1
goto weapons
end

allweapons:
wait 4
$player stufftext "all_weapons 1"

end

Gold<<mohha freak
User avatar
Gold
First Lieutenant
Posts: 176
Joined: Sun Sep 28, 2003 8:10 pm

Post by Gold »

last note on this one lol,,,if ya wanna get the ammo count down on all the pistols now just open the silencer tiki and change the dm ammo count to 10,,that will put all the pistols to 94 ammo count and one i think to 93 starting ammo,,,apparently the script commands was adding the ammo count together making each pistol have 184 to start off with,,also prob want make any difference but just to be sure change the script to this

level.script = maps/dm/mohdm1.scr

thread allweapons
thread weapons

exec global/ambient.scr mohdm1

weapons:
level.all_weapons = int(getcvar(all_weapons))
if(level.all_weapons == 1)
{
$player item models/weapons/silencedpistol.tik
local.ammo_pistol = 94
}
wait 0.2
goto weapons
end

allweapons:
wait 2
$player stufftext "all_weapons 1"

im done seeya:)

Gold<<mohha freak
Post Reply