AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Arrays (https://forums.alliedmods.net/showthread.php?t=121494)

zombieplague 03-16-2010 08:51

Arrays
 
Can someone teach me how do i make arrays ?

How do i make like this? example i've model.ini folder in config, inside it has this:

Code:

HUMAN = arctic , guerilla , leet , terror , gign , gsg9 , sas , urban

TitANious 03-16-2010 09:03

Re: Arrays
 
new HUMAN[32] = blablabla

zombieplague 03-16-2010 09:32

Re: Arrays
 
Quote:

Originally Posted by TitANious (Post 1119085)
new HUMAN[32] = blablabla

Can you show me the full code ?

Ok for an example new round all player models were changed to Human[ 32 ]

Bugsy 03-16-2010 10:00

Re: Arrays
 
are you trying to make an array of strings/text?

zombieplague 03-16-2010 10:16

Re: Arrays
 
Quote:

Originally Posted by Bugsy (Post 1119124)
are you trying to make an array of strings/text?

Nope. I trying to make like zombieplague

Which has a ini file called zombieplague.ini

Inside it has this:

Code:

ENABLE/DISABLE MOD = l
ADMIN MENU = d
START MODE INFECTION = d
START MODE NEMESIS = d
START MODE SURVIVOR = d
START MODE SWARM = d
START MODE MULTI = d
START MODE PLAGUE = d
MAKE ZOMBIE = d
MAKE HUMAN = d
MAKE NEMESIS = d
MAKE SURVIVOR = d
RESPAWN PLAYERS = d
ADMIN MODELS = d
 
[Player Models] (randomly chosen if more than one)
HUMAN = arctic , guerilla , leet , terror , gign , gsg9 , sas , urban
NEMESIS = zombie_source
SURVIVOR = leet , sas
ADMIN ZOMBIE = zombie_source
ADMIN HUMAN = vip
 
; If you don't want people using altered player models, enable the following.
; 1 = Bounds Check (model's geometry must fit in the same bbox)
; 2 = CRC Check (file on client must exactly match server's file)
FORCE CONSISTENCY = 0
; By default, zombie models are class specific. You can edit them separately in your zp_zombieclasses.ini
; If, however, you want all zombies to use the same models regardless of class, you can enable this
 
; setting and add your global zombie models to the "ZOMBIE" line.
SAME MODELS FOR ALL = 0
ZOMBIE = zombie_source
 
[Weapon Models]
V_KNIFE HUMAN = models/v_knife.mdl
V_KNIFE NEMESIS = models/zombie_plague/v_knife_zombie.mdl
V_M249 SURVIVOR = models/v_m249.mdl
GRENADE INFECT = models/zombie_plague/v_grenade_infect.mdl
GRENADE FIRE = models/zombie_plague/v_grenade_fire.mdl
GRENADE FROST = models/zombie_plague/v_grenade_frost.mdl
GRENADE FLARE = models/zombie_plague/v_grenade_flare.mdl
V_KNIFE ADMIN HUMAN = models/v_knife.mdl
V_KNIFE ADMIN ZOMBIE = models/zombie_plague/v_knife_zombie.mdl
 
[Grenade Sprites]
TRAIL = sprites/laserbeam.spr
RING = sprites/shockwave.spr
FIRE = sprites/flame.spr
SMOKE = sprites/black_smoke3.spr
GLASS = models/glassgibs.mdl
[Sounds] (randomly chosen if more than one)
WIN ZOMBIES = ambience/the_horror1.wav , ambience/the_horror3.wav , ambience/the_horror4.wav
WIN HUMANS = zombie_plague/win_humans1.wav , zombie_plague/win_humans2.wav
WIN NO ONE = ambience/3dmstart.wav
ZOMBIE INFECT = zombie_plague/zombie_infec1.wav , zombie_plague/zombie_infec2.wav , zombie_plague/zombie_infec3.wav , scientist/c1a0_sci_catscream.wav , scientist/scream01.wav
ZOMBIE PAIN = zombie_plague/zombie_pain1.wav , zombie_plague/zombie_pain2.wav , zombie_plague/zombie_pain3.wav , zombie_plague/zombie_pain4.wav , zombie_plague/zombie_pain5.wav
NEMESIS PAIN = zombie_plague/nemesis_pain1.wav , zombie_plague/nemesis_pain2.wav , zombie_plague/nemesis_pain3.wav
ZOMBIE DIE = zombie_plague/zombie_die1.wav , zombie_plague/zombie_die2.wav , zombie_plague/zombie_die3.wav , zombie_plague/zombie_die4.wav , zombie_plague/zombie_die5.wav
ZOMBIE FALL = zombie_plague/zombie_fall1.wav
ZOMBIE MISS SLASH = weapons/knife_slash1.wav , weapons/knife_slash2.wav
ZOMBIE MISS WALL = weapons/knife_hitwall1.wav
ZOMBIE HIT NORMAL = weapons/knife_hit1.wav , weapons/knife_hit2.wav , weapons/knife_hit3.wav , weapons/knife_hit4.wav
ZOMBIE HIT STAB = weapons/knife_stab.wav
ZOMBIE IDLE = nihilanth/nil_now_die.wav , nihilanth/nil_slaves.wav , nihilanth/nil_alone.wav , zombie_plague/zombie_brains1.wav , zombie_plague/zombie_brains2.wav
ZOMBIE IDLE LAST = nihilanth/nil_thelast.wav
ZOMBIE MADNESS = zombie_plague/zombie_madness1.wav
ROUND NEMESIS = zombie_plague/nemesis1.wav , zombie_plague/nemesis2.wav
ROUND SURVIVOR = zombie_plague/survivor1.wav , zombie_plague/survivor2.wav
ROUND SWARM = ambience/the_horror2.wav
ROUND MULTI = ambience/the_horror2.wav
ROUND PLAGUE = zombie_plague/nemesis1.wav , zombie_plague/survivor1.wav
GRENADE INFECT EXPLODE = zombie_plague/grenade_infect.wav
GRENADE INFECT PLAYER = scientist/scream20.wav , scientist/scream22.wav , scientist/scream05.wav
GRENADE FIRE EXPLODE = zombie_plague/grenade_explode.wav
GRENADE FIRE PLAYER = zombie_plague/zombie_burn3.wav , zombie_plague/zombie_burn4.wav , zombie_plague/zombie_burn5.wav , zombie_plague/zombie_burn6.wav , zombie_plague/zombie_burn7.wav
GRENADE FROST EXPLODE = warcraft3/frostnova.wav
GRENADE FROST PLAYER = warcraft3/impalehit.wav
GRENADE FROST BREAK = warcraft3/impalelaunch1.wav
GRENADE FLARE = items/nvg_on.wav
ANTIDOTE = items/smallmedkit1.wav
THUNDER = zombie_plague/thunder1.wav , zombie_plague/thunder2.wav
 
[Ambience Sounds] (randomly chosen if more than one) (only .wav and .mp3 formats supported) (duration is in seconds)
INFECTION ENABLE = 0
INFECTION SOUNDS = zombie_plague/ambience.wav
INFECTION DURATIONS = 17
NEMESIS ENABLE = 0
NEMESIS SOUNDS = zombie_plague/ambience.wav
NEMESIS DURATIONS = 17
SURVIVOR ENABLE = 0
SURVIVOR SOUNDS = zombie_plague/ambience.wav
SURVIVOR DURATIONS = 17
SWARM ENABLE = 0
SWARM SOUNDS = zombie_plague/ambience.wav
SWARM DURATIONS = 17
PLAGUE ENABLE = 0
PLAGUE SOUNDS = zombie_plague/ambience.wav
PLAGUE DURATIONS = 17
 
[Buy Menu Weapons]
PRIMARY = weapon_galil , weapon_famas , weapon_m4a1 , weapon_ak47 , weapon_sg552 , weapon_aug , weapon_scout , weapon_m3 , weapon_xm1014 , weapon_tmp , weapon_mac10 , weapon_ump45 , weapon_mp5navy , weapon_p90
SECONDARY = weapon_glock18 , weapon_usp , weapon_p228 , weapon_deagle , weapon_fiveseven , weapon_elite
 
ADDITIONAL ITEMS = weapon_hegrenade , weapon_flashbang , weapon_smokegrenade
 
[Extra Items: Weapons and their costs]
NAMES = Napalm Nade , Frost Nade , Flare , AWP Magnum Sniper , M249 Para Machinegun , SG550 Auto-Sniper , G3SG1 Auto-Sniper
ITEMS = weapon_hegrenade , weapon_flashbang , weapon_smokegrenade , weapon_awp , weapon_m249 , weapon_sg550 , weapon_g3sg1
COSTS = 6 , 6 , 6 , 8 , 10 , 12 , 12
 
[Hard Coded Items Costs]
NIGHT VISION = 15
ANTIDOTE = 15
ZOMBIE MADNESS = 17
INFECTION BOMB = 20
 
[Weather Effects]
RAIN = 0
SNOW = 0
FOG = 0
FOG DENSITY = 0.0018
FOG COLOR = 128 128 128
 
[Custom Skies] (randomly chosen if more than one)
ENABLE = 1
SKY NAMES = space
 
[Lightning Lights Cycle]
LIGHTS = ijklmnonmlkjihgfedcb , klmlkjihgfedcbaabcdedcb , bcdefedcijklmlkjihgfedcb
 
[Zombie Decals] (for bloodstains/footsteps)
DECALS = 99 , 107 , 108 , 184 , 185 , 186 , 187 , 188 , 189
 
[Knockback Power for Weapons] (use -1.0 to disable knockback power for the weapon)
P228 = 2.4
SCOUT = 6.5
XM1014 = 8.0
MAC10 = 2.3
AUG = 5.0
ELITE = 2.4
FIVESEVEN = 2.0
UMP45 = 2.4
SG550 = 5.3
GALIL = 5.5
FAMAS = 5.5
USP = 2.2
GLOCK18 = 2.0
AWP = 10.0
MP5NAVY = 2.5
M249 = 5.2
M3 = 8.0
M4A1 = 5.0
TMP = 2.4
G3SG1 = 6.5
DEAGLE = 5.3
SG552 = 5.0
AK47 = 6.0
P90 = 2.0
 
[Objective Entities] (and anything that would affect gameplay that needs to be removed)
CLASSNAMES = func_bomb_target , info_bomb_target , info_vip_start , func_vip_safetyzone , func_escapezone , hostage_entity , monster_scientist , func_hostage_rescue , info_hostage_rescue , env_fog , env_rain , env_snow , item_longjump , func_vehicle
 
[SVC_BAD Prevention] (if you experience *many* SVC_BAD kicks, try one of the following)
; A. Increase the delay between model changes here (in 0.1 increments until the kicks are gone)
MODELCHANGE DELAY = 0.2
; B. If you still get recurring kicks, try enabling this setting: (experimental!)
HANDLE MODELS ON SEPARATE ENT = 0
; If you want your models to have accurate hitboxes, try enabling this.
; Note: make sure your models don't have messed up hitboxes, otherwise
; this setting might cause your server insane cpu usage and lag!
SET MODELINDEX OFFSET = 0

I want to know how do make the human model arrays

wrecked_ 03-16-2010 16:48

Re: Arrays
 
I don't know exactly what you're trying to do, but:
Code:
// Optional // #define MODEL_NAME_AMOUNT 3 new const MDLNAMES[/*MODEL_NAME_AMOUNT*/][] = {     "guerilla",     "leet",     "arctic" }

You can't make an array in a .ini file. :shock:

You can read from it and put the data into an array, though.

EDIT: Oops, didn't see Bugsy's post. Examples never hurt anyone though, right?

zombieplague 03-17-2010 18:34

Re: Arrays
 
Quote:

Originally Posted by wrecked_ (Post 1119590)
I don't know exactly what you're trying to do, but:

Code:
</p><p>// Optional</p><p>// #define MODEL_NAME_AMOUNT 3</p><p>&nbsp;</p><p>new const MDLNAMES[/*MODEL_NAME_AMOUNT*/][] =</p><p>{</p><p> "guerilla",</p><p> "leet",</p><p> "arctic"</p><p>}



You can't make an array in a .ini file. :shock:

You can read from it and put the data into an array, though.

EDIT: Oops, didn't see Bugsy's post. Examples never hurt anyone though, right?

I don't know what is it called but, this is what i wanted.

I just want to know how to make a own custom .ini file, inside the plugin code which created the ini file.

Bugsy 03-17-2010 19:46

Re: Arrays
 
Quote:

Originally Posted by zombieplague (Post 1120874)
I don't know what is it called but, this is what i wanted.

I just want to know how to make a own custom .ini file, inside the plugin code which created the ini file.

I still don't understand what you're talking about. Is it just me? Why don't you explain what it is you want to do instead of telling us the method you want to use.

Do you want the plugin to create an ini file that the plugin itself reads settings from?

Seta00 03-17-2010 19:49

Re: Arrays
 
He wants to map this:
Code:

HUMAN = arctic , guerilla , leet , terror , gign , gsg9 , sas , urban
from the ini file to this:
Code:

new HUMAN[][30] = {"artic", "guerilla", "leet", ...}
Not so hard to understand... :|

zombieplague 03-17-2010 20:21

Re: Arrays
 
Quote:

Originally Posted by Bugsy (Post 1120924)
I still don't understand what you're talking about. Is it just me? Why don't you explain what it is you want to do instead of telling us the method you want to use.

Do you want the plugin to create an ini file that the plugin itself reads settings from?

Okay i make it simple.

I just want to make my own a .ini file just like zombieplague, okay i renamed it called config.ini

For an example inside the config.ini itself, it has a line like this:

Code:

HUMAN = arctic , guerilla , leet , terror , gign , gsg9 , sas , urban
Change here to change the model of the players

Inside the plugin you cannot change the model only at config.ini


All times are GMT -4. The time now is 08:44.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.