Jump to content

Photo
- - - - -

Client side ranked ammo-box script


  • Please log in to reply
3 replies to this topic
Thread Starter
TG Marksman X
TG Marksman X

    Corporal

  • Members
  • 98 posts

  • Joined: 29-April 2010

Posted 07 March 2013 - 08:50 #1

Just a quick modification of a script I use in my missions. Originally written by Demonized for Arma 2, modified by me for Arma 3.

Here's how it works:

In certain multi-player missions, there comes a time where you want to either: restrict which slots have access to which weapons, OR, you have so much crap in an ammobox, and so many players on the server - that it takes forever just to get a magazine out.
This script does both.

Weapon restriction is based on what you name the units.
eg: You could name some rifleman1, rifleman2, etc. and then name some others: grenadier1, grenadier2, and so on.
The rifleman would not be able to see what the grenadiers see, and vice versa.

The script creates an ammo box on a marker, in doing so it is ONLY run on the client. In addition, if you have units that are NOT named in the script, they simply won't see the ammo box.

It's not much, but it's a start. (it's just weapons and ammo at this stage, no items or clothing).
Again, I must credit Demonized, as it was his script that formed the base of mine.

Download Link:

http://dl.dropbox.co...4/local_box.sqf

foxhound
foxhound

    Brigadier General

  • Members
  • 12960 posts

  • Joined: 06-June 2005

Posted 08 March 2013 - 22:59 #2

Release frontpaged on the Armaholic homepage.

Posted Image
[ALPHA] Client side ranked ammo-box script


Visit Armaholic.com | Visit Carriercommandaholic.com

Developer/publisher policy of modding:
Stolen some work from others? Ported some content from another game? Feel like uploading something which is not yours or breaches someones IP or copyright? Head over to the Stolen Work Support and knock yourself out.
They happily support your activeties and will even proudly share all this questionable content through their social channels making you a famous boy......

Thread Starter
TG Marksman X
TG Marksman X

    Corporal

  • Members
  • 98 posts

  • Joined: 29-April 2010

Posted 09 March 2013 - 03:26 #3

Thanks Foxhound.
Main: i5 3570K | XSPC RASA | RX240 + RX120 | ASRock z77 Extreme4 | 2x 3gb HIS 67950 | 16gb 1600mhz XMS3 | 1TB WD Green | Sandisk 120gb SSD | 850w Silverstone Strider | Fractal Design Arc Mid.
Server: i5 2500K | ASrock Extreme4 | 650w Silverstone Strider | 8gb 1600mhz XMS3 | 7TB WD green's | 120gb Sandisk SSD OS drive | NZXT Tempest | Zalman bay converters | Win7+pimped MCE.

hellstorm77
hellstorm77

    Staff Sergeant

  • Members
  • 398 posts

  • Joined: 23-November 2012

Posted 11 April 2013 - 22:47 #4

im just wondering if i could change this to would i have to change if (_this != player) to if (_this != MG) and name the unit MG1, MG2 and so on for each unit same for sniper too?

if (_this != player) exitWith {};  // exit all other clients.
_weapons = []; _magazines = [];
 
// load available to standard players only.
if (_this in [MG1,MG2,MG3,MG4]) then {

if (_this != player) exitWith {};  // exit all other clients.
_weapons = []; _magazines = [];
 
// load available to standard players only.
if (_this in [sniper1,sniper2,sniper3,sniper4]) then {

Edited by hellstorm77, 11 April 2013 - 22:50.