Author Topic: Limited ammo  (Read 961 times)

0 Members and 1 Guest are viewing this topic.

Offline Zabijaka

  • Soldier
  • **
  • Posts: 201
  • Soldat Fan, Hitman Fan
Limited ammo
« on: August 19, 2009, 11:10:31 am »
I need idea to create limited ammo script.

Offline jrgp

  • Administrator
  • Flamebow Warrior
  • *****
  • Posts: 5037
Re: Limited ammo
« Reply #1 on: August 19, 2009, 11:40:09 am »
Learning to use this procedure might help: http://enesce.com/help/index.html?Functions/SetWeaponActive.html
There are other worlds than these

Offline iDante

  • Veteran
  • *****
  • Posts: 1967
Re: Limited ammo
« Reply #2 on: August 19, 2009, 12:01:11 pm »
In AppOnIdle loop through everyone and check if their ammo is 0. If it is, they are reloading. This works for every gun except spas.

Offline Zabijaka

  • Soldier
  • **
  • Posts: 201
  • Soldat Fan, Hitman Fan
Re: Limited ammo
« Reply #3 on: August 19, 2009, 12:07:00 pm »
Yeah, but most ppl reload weapon before clip is empty xD
How to know how much bullets player shot?

Offline iDante

  • Veteran
  • *****
  • Posts: 1967
Re: Limited ammo
« Reply #4 on: August 19, 2009, 12:10:44 pm »
Yeah, but most ppl reload weapon before clip is empty xD
How to know how much bullets player shot?
There isn't a reliable way to do this, but why would you? If the point is the be more realistic, then go with what I said before. Limit the number of clips people have, not the number of bullets.

Offline croat1gamer

  • Veteran
  • *****
  • Posts: 1327
  • OMG CHANGING AVATAR!!! ^ω^
Re: Limited ammo
« Reply #5 on: August 19, 2009, 12:20:23 pm »
Actually it is almost reliable unless you reload from 0 to *bullet count*, fire a bullet or two and reload inside a second, but i doubt that it would be tactically useful.
M79 is the only problem in it.

I  just set M79 and Spas to inactive for now.
Need to make just the part when changing weapons, but it should be easy.

Ill upload it in 2 hours when i come home (still a beta, but i might stop being lazy and fix the changing weapons laziness bug).

Its a clip based system, not an bullet based system.

edit: I might have a way to do it even for spas, but i dont know how to do it exactly.
Last year, I dreamt I was pissing at a restroom, but I missed the urinal and my penis exploded.

Offline Zabijaka

  • Soldier
  • **
  • Posts: 201
  • Soldat Fan, Hitman Fan
Re: Limited ammo
« Reply #6 on: August 19, 2009, 12:33:29 pm »
Somebody know script "Accuracy" ?
This script record how much bullets player shot and on map change show info.
So this is possible to make realistic limited ammo script even when somebody reload before clip is empty :)

Code: [Select]
shots[ID] := shots[ID] + current[ID] - GetPlayerStat(ID,'Ammo');
« Last Edit: August 19, 2009, 12:38:19 pm by Zabijaka »

Offline croat1gamer

  • Veteran
  • *****
  • Posts: 1327
  • OMG CHANGING AVATAR!!! ^ω^
Re: Limited ammo
« Reply #7 on: August 19, 2009, 12:51:32 pm »
No, it is impossible afaik, as it would be called each time the player shoots a single bullet, and that multiplied with the number of players would be some excessive server rape, including the ping one.
Last year, I dreamt I was pissing at a restroom, but I missed the urinal and my penis exploded.

Offline pavliko

  • Soldat Beta Team
  • Camper
  • ******
  • Posts: 397
  • >‿‿◕
    • Offical TTW Community
Re: Limited ammo
« Reply #8 on: August 19, 2009, 01:02:14 pm »
There is a lame way that works :D
set weapons ammo to 999 or w/e
and make a script that shows the player how much ammo he has.
But! the script actuly force it to 0 when a speciphic ammout of bullets is fired.


just an idea from my old script.
The safest thing to do is jumping out of a plane!

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: Limited ammo
« Reply #9 on: August 19, 2009, 01:43:23 pm »
I was working on a script that tried to give each instance of a gun its own ammo amount, along with you holding ammo. It was kind of successful, but kind of not. I'm lazy atm to post it, but if u want it, PM me.

Offline croat1gamer

  • Veteran
  • *****
  • Posts: 1327
  • OMG CHANGING AVATAR!!! ^ω^
Re: Limited ammo
« Reply #10 on: August 19, 2009, 02:01:34 pm »
What is the problem with array of array of integer
Mine is based that way.

Including some boolean variables which prevent from decreasing the clips each second, but tbh, i dont know how they do it, but they do the job. Q_Q

http://forums.soldat.pl/index.php?topic=35827
« Last Edit: August 19, 2009, 02:50:28 pm by croat1gamer »
Last year, I dreamt I was pissing at a restroom, but I missed the urinal and my penis exploded.