Removing Ammo

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Ramah Palmer
Warrant Officer
Posts: 131
Joined: Sun May 25, 2003 10:13 am
Location: Nottinghamshire: UK

Removing Ammo

Post by Ramah Palmer »

Hi,

through looking in this forum I managed to bolt together a way to get my MP players to drop all their weapons at the start of a specific level of my map and each receieve a silenced pistol. But is there a way to script the removal of all the ammo from those pistols? (I want the level to be a bash only).
I saw one way which seemes to involve editing the TIKI, but on this score I am very unsure of myself. Is their a way to do it through scripting only?

Here is my script so far...


for(local.i=1;local.i <= $player.size ;local.i++)
{
$player[local.i] holster
$player[local.i] takeall
$player[local.i] item weapons/silencedpistol.tik
$player[local.i] useweaponclass pistol
$player[local.i] ammo silencedpistol 0 //this doesn't work
}

Thanks in advance for any help offered. :)
Mapping is just INCREDIBLY time consuming.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Use a negative ammo count :wink:
Image
Ramah Palmer
Warrant Officer
Posts: 131
Joined: Sun May 25, 2003 10:13 am
Location: Nottinghamshire: UK

Post by Ramah Palmer »

Ok, I tried changing the:

$player[local.i] ammo silencedpistol 0

line to read:

$player[local.i] ammo silencedpistol -1

And there was no change. I tried a different minus figure as well but had exactly the same amount of bullets.
Is this what you meant JV?
Mapping is just INCREDIBLY time consuming.
rodney
Second Lieutenant
Posts: 172
Joined: Sat Mar 13, 2004 5:49 pm

Post by rodney »

Ramah Palmer wrote:Ok, I tried changing the:

$player[local.i] ammo silencedpistol 0

line to read:

$player[local.i] ammo silencedpistol -1

And there was no change. I tried a different minus figure as well but had exactly the same amount of bullets.
Is this what you meant JV?
Please... help-me!!!

If...

$player[local.i] ammo silencedpistol +500...

or...

$player[local.i] ammo silencedpistol 500...

The bullets incraze???

Or no???

Thanks!!!

I need much this help!!!

Sorry with my bad english!!!
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

'silencedpistol' should say 'pistol' :wink:
Image
Ramah Palmer
Warrant Officer
Posts: 131
Joined: Sun May 25, 2003 10:13 am
Location: Nottinghamshire: UK

Post by Ramah Palmer »

Ok, so I'm getting closer now, thanks JV. But now what happens is depending on how big a minus figure I put in it takes away from my 'remaining bullets' pile.
Testing it myself I normally receive 8 bullets in the clip and another 8 ready to be loaded. If i put an ammo figure of -10 in then I still have 8 in the clip but -2 in reserve.

Is there a way to remove the ammo that is already loaded? :?

EDIT: Oh, and by the looks of it Rodney, if you put 'ammo pistol 500' and not silencedpistol as I orignally had it, then you will probably get an extra 500 bullets in your backpack, yeah.
Mapping is just INCREDIBLY time consuming.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Ramah Palmer wrote:Is there a way to remove the ammo that is already loaded? :?
Not that I know of :(
Image
Ramah Palmer
Warrant Officer
Posts: 131
Joined: Sun May 25, 2003 10:13 am
Location: Nottinghamshire: UK

Post by Ramah Palmer »

Ah, ok. :(

Well maybe I need to look at this differently then. Now that I have the pistols reduced to one clip, is there any way to make those bullets useless?
I don't want to make players invulnerable as in the question a few posts down, just not damaged by bullets. So that rules out covering the level with a trigger_nodamage.

Ermm... is it possible to bind a weapon clip to a player? Like a mini shield? Or is that just silly?
Or is there a way to turn down the damage done by projectiles in script?

Any better options? :?
Mapping is just INCREDIBLY time consuming.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

maybe

$player[#] immune bullet
Image
Ramah Palmer
Warrant Officer
Posts: 131
Joined: Sun May 25, 2003 10:13 am
Location: Nottinghamshire: UK

Post by Ramah Palmer »

K, I'll try that, thanks.

What is the hash symbol for? Am I supposed to replace that with some other code, or does that mean all parts of the array?
Mapping is just INCREDIBLY time consuming.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Na you should replace it with some value :wink:
Image
blue60007
General
Posts: 1247
Joined: Sun Mar 07, 2004 11:44 pm

Post by blue60007 »

Ramah Palmer wrote:Ah, ok. :(

Well maybe I need to look at this differently then. Now that I have the pistols reduced to one clip, is there any way to make those bullets useless?
I don't want to make players invulnerable as in the question a few posts down, just not damaged by bullets. So that rules out covering the level with a trigger_nodamage.

Ermm... is it possible to bind a weapon clip to a player? Like a mini shield? Or is that just silly?
Or is there a way to turn down the damage done by projectiles in script?

Any better options? :?
try what jv said, but if you put a weapon clip around the player, you'd see the bullets (or not :? ) hitting thin air...
Image
Post Reply