Page 2 of 2

Posted: Sat Sep 17, 2005 9:55 pm
by GiffE1118
HOLY crap! :shock: :!:

well i wasnt initally going to add it to api was kinda just asking for this

Code: Select all

main: 

   // If custom is not on then exit 
   if(level.run["custom"] != "1")[end} 

   //Mod is on if we got this far. 


   // get the new damamge for the weapon 
   local.settings =  waitthread check_weapon self 

   // the first damage bit is the first setting in the array 
   local.damage =  int local.settings[0] 
   local.firedelay =  int local.settings[1] 

   // if a new damage is set then change it to new setting 
   if(local.damage != 0) 
   { 
      self weaponcommand duel dmbulletdamage  local.damage 
   } 

   // if a new firedelay is set then change it to new setting 
   if(local.firedelay != 0) 
   { 
      self weaponcommand duel dmfiredelay local.firedelay 
   } 
end 
all the other is to add it to ap

i will leave all that to u :D

ill get that all setup with all the guns

just got one question

are all the cmd's like fire delay in the weapons tik

so i add the duel stuff

Code: Select all

		viewkick 	-0.52 	-0.52 	-0.26 	0.26

		movementspeed	0.9

		// AI animation group info
		weapongroup		bar
		airange			short

		// DM Attributes
		dmbulletcount		1
		dmstartammo		125
		dmammorequired		1
		dmfiredelay		0.115 //0.0999999999999
		dmbulletrange		7488
		dmbulletspread		22 22 22 22
		dmfirespreadmult 	0.06 0.32 999 0.25
		dmbulletdamage		67
		dmcrosshair		1
		dmmovementspeed		0.77
u taught me about arrays and .txt before remember. ive been using them alot.

Posted: Sat Sep 17, 2005 10:00 pm
by Elgan
all the weapon cmds are best found in the g_allclasses.html

here is a copy paste bit

Code: Select all

/Class/Listener/SimpleEntity/Entity/Animate/Trigger/Item/Weapon
Availability
  

Class spec
  additionalstartammo  Gives some additional start ammo of the specified type 
   ai_event  Let the AI know that this entity made a sound,  
   airange  Set the range of this gun for the ai: short, medium, long, sniper 
   ammo_in_clip  Set the amount of ammo in the clip 
   ammopickupsound  sets the weapon's ammo pickup sound alias 
   ammorequired  Set the amount of ammo this weapon requires to fire 
   ammotype  Set the type of ammo this weapon uses 
   anim  Exec anim commands on server or client. 
   attachtohand  Attaches an active weapon to the specified hand 
   autoaim  Turn on auto aiming for the weapon 
   autoputaway  Set the weapon to be automatically put away when out of ammo 
   bulletcount  Set the number of bullets this weapon shoots when fired 
   bulletdamage  Set the damage that the bullet causes 
   bulletknockback  Set the knockback that the bullet causes 
  bulletlarge  Set if the bullets fired are rifle bullets(1), artillery(2) or larger  
   bulletrange  Set the range of the bullets 
  bulletspread  Set the min & optional max spread of the bullet in the x and y  
  bulletspread  Set the min & optional max spread of the bullet in the x and y axis 
   cantpartialreload  Prevents the weapon from being reloaded part way through a clip 
   clip_add  Add to the weapons ammo clip with ammo from its owner 
   clip_empty  Empties the weapon's clip of ammo, returning it to the owner 
   clip_fill  Fills the weapons ammo clip with ammo from its owner 
   clipsize  Set the amount of rounds a clip of the weapon holds 
  cooktime  sets weapons cook time. 
   crosshair  Turn on/off the crosshair for this weapon 
  dmammorequired  Set the amount of ammo this weapon requires to fire for DM 
  dmbulletcount  Set the number of bullets this weapon shoots when fired for DM 
  dmbulletdamage  Set the damage that the bullet causes for DM 
  dmbulletrange  Set the range of the bullets 
  dmbulletspread  Set the min & optional max spread of the bullet in the x and y axis 
  dmcantpartialreload  Prevents the weapon from being reloaded part way through a clip for DM 
  dmcrosshair  Turn on/off the crosshair for this weapon 
  dmfiredelay  Set the minimum time between shots from the weapon for DM 
  dmfirespreadmult  Sets a time decayed multiplyer to spread when the weapon is fired 
  dmmovementspeed  Alters the movement speed of the player when he has the weapon out 
  dmprojectile  Set the model of the projectile that this weapon fires in DM 
  dmstartammo  Set the starting ammo of this weapon 
  dmzoomspreadmult  Sets the spread multiplyer for when using the zoom on a zooming weapon 
   donefiring  Signals the end of the fire animation 
   donereloading  Signals the end of the reload animation 
   fallingangleadjust  Adjusts the weapons angles as it falls to the ground 
   firedelay  Set the minimum time between shots from the weapon 
  firespreadmult  Sets a time decayed multiplyer to spread when the weapon is fired 
  firespreadmult  Sets a time decayed multiplyer to spread when the weapon is fired 
   firetype  Set the firing type of the weapon (projectile or bullet) 
   holsterangles  Set the angles of this weapon when it is holstered 
   holsteroffset  Set the positional offset when it is holstered 
   holsterscale  Set the scale of the weapon when it's attached to the holster 
   holstertag  Set the name of the tag to attach this to when the weapon is holstered. 
   idle  Puts the weapon into an idle state 
   idleinit  Puts the weapon into an idle state and clears all the anim slots 
   item_pickup  Pickup the specified item. 
   loopfire  Makes the weapon fire by looping the fire animation. 
   mainattachtotag  Set the name of the tag to attach this to it's owner when being used. 
  makenoise  Makes the weapon make noise that actors can hear. 
  makenoise  Makes the weapon make noise that actors can hear. 
   maxchargetime  Set the maximum time the weapon may be charged up 
  maxfiremovement  Sets the max speed the player can be moving to fire the weapon (fraction  
  maxmovementsound  sets the weapon's movement fire prevention sound alias 
   maxrange  Set the maximum range of a weapon so the AI knows how to use it 
   meansofdeath  Set the meansOfDeath of the weapon. 
   minchargetime  Set the minimum time the weapon must be charged up 
   minrange  Set the minimum range of a weapon so the AI knows how to use it 
   movementspeed  Alters the movement speed of the player when he has the weapon out 
   noammosound  sets the weapon's dry fire sound alias 
   notdroppable  Makes a weapon not droppable 
  numfireanims  Sets the number of fire animations this weapon uses. 
   offhandattachtotag  Set the name of the tag to attach this to it's owner's off hand. 
  overcooked  used when the cookable weapon has been over cooked. 
  overcooked_warning  causes a warning sound to play that the grenade is about to be  
   projectile  Set the model of the projectile that this weapon fires 
   quiet  Makes the weapon make no noise. 
   range  Set the range of the weapon 
   rank  Set the order value and power ranking for the weapon 
   ready  Signals the end of the ready animation so the weapon can be used 
  secondary  Set the secondary mode of the weapon, by passing commands through 
  secondary  Set the secondary mode of the weapon, by passing commands through 
  secondaryammoinhud  Makes the weapon show its secondary ammo to the hud. 
   semiauto  Sets the weapon to fire semi-auto 
  setaimanim  Set the aim animation and frame for when a weapon fires 
  setaimanim  Set the aim animation and frame for when a weapon fires 
  setcurrentfireanim  Sets the current firing animation. 
   shareclip  Sets the weapon to share the same clip between all fire modes 
   shoot  Shoot the weapon 
   startammo  Set the starting ammo of this weapon 
   startingammotoowner  Internal event used to give ammo to the owner of the weapon 
  startitem  Adds an item to the starting loadout of the weapon 
  throughmetal  Sets how far the bullets can go through metal 
  throughwood  Sets how far the bullets can go through wood 
   tracerfrequency  Set the frequency of making tracers 
  tracerspeed  Scale factor of how fast a tracer should travel (valid ranges 0-2) 
   usenoammo  Set the weapon to be able to be used when it's out of ammo 
  viewkick  Adds kick to the view of the owner when fired. 
  viewkick  Adds kick to the view of the owner when fired. 
   weapongroup  Sets the weapon group, a set of animations for actor animations scripts to use 
  weaponsubtype  sets the weapon's sub-type. Used by smoke grenades. 
   weapontype  Sets the weapon type 
   worldhitspawn  Set a model to be spawned when the weapon strikes the world. 
   zoom  Sets fov to zoom to on a secondary fire 
  zoommovement  Sets the max speed the player can move while zoomed (fraction of  
   zoomspreadmult  Sets the spread multiplyer for when using the zoom on a zooming weapon 

Function spec
additionalstartammo     

Gives some additional start ammo of the specified type


ai_event ( [String type], [Float radius] )     

Let the AI know that this entity made a sound,
type is a string specifying what type of sound it is.
radius determines how far the sound reaches.


airange ( String airange )     

Set the range of this gun for the ai: short, medium, long, sniper


ammo_in_clip ( Integer ammoInClip )     

Set the amount of ammo in the clip


ammopickupsound ( String name )     

sets the weapon's ammo pickup sound alias


ammorequired ( Integer amount )     

Set the amount of ammo this weapon requires to fire


ammotype ( String name )     

Set the type of ammo this weapon uses


anim ( String animName )     

Exec anim commands on server or client.


attachtohand ( String hand )     

Attaches an active weapon to the specified hand


autoaim      

Turn on auto aiming for the weapon


autoputaway ( Boolean bool )     

Set the weapon to be automatically put away when out of ammo


bulletcount ( Float bulletCount )     

Set the number of bullets this weapon shoots when fired


bulletdamage ( Float bulletDamage )     

Set the damage that the bullet causes


bulletknockback ( Float bulletKnockback )     

Set the knockback that the bullet causes


bulletlarge ( Integer bulletType )    

Set if the bullets fired are rifle bullets(1), artillery(2) or larger 
tracers(3)


bulletrange ( Float bulletRange )     

Set the range of the bullets


bulletspread     

Set the min & optional max spread of the bullet in the x and y 
axis


bulletspread ( Float bulletSpreadX, Float bulletSpreadY, [Float bulletSpreadXmax], [Float bulletSpreadYmax] )    

Set the min & optional max spread of the bullet in the x and y axis


cantpartialreload      

Prevents the weapon from being reloaded part way through a clip


clip_add ( Integer ammoAmount )     

Add to the weapons ammo clip with ammo from its owner


clip_empty      

Empties the weapon's clip of ammo, returning it to the owner


clip_fill      

Fills the weapons ammo clip with ammo from its owner


clipsize ( Integer ammoClipSize )     

Set the amount of rounds a clip of the weapon holds


cooktime ( Float cooktime )    

sets weapons cook time.


crosshair ( Boolean bool )     

Turn on/off the crosshair for this weapon


dmammorequired ( Integer amount )    

Set the amount of ammo this weapon requires to fire for DM


dmbulletcount ( Float bulletCount )    

Set the number of bullets this weapon shoots when fired for DM


dmbulletdamage ( Float bulletDamage )    

Set the damage that the bullet causes for DM


dmbulletrange ( Float bulletRange )    

Set the range of the bullets


dmbulletspread ( Float bulletSpreadX, Float bulletSpreadY, [Float bulletSpreadXmax], [Float bulletSpreadYmax] )    

Set the min & optional max spread of the bullet in the x and y axis


dmcantpartialreload     

Prevents the weapon from being reloaded part way through a clip for DM


dmcrosshair ( Boolean bool )    

Turn on/off the crosshair for this weapon


dmfiredelay ( Float fFireDelay )    

Set the minimum time between shots from the weapon for DM


dmfirespreadmult ( Float scaleadd, Float falloff, Float cap )    

Sets a time decayed multiplyer to spread when the weapon is fired


dmmovementspeed ( Float speedmult )    

Alters the movement speed of the player when he has the weapon out


dmprojectile ( String projectileModel )    

Set the model of the projectile that this weapon fires in DM


dmstartammo ( Integer amount )    

Set the starting ammo of this weapon


dmzoomspreadmult ( Float scale )    

Sets the spread multiplyer for when using the zoom on a zooming weapon


donefiring      

Signals the end of the fire animation


donereloading      

Signals the end of the reload animation


fallingangleadjust      

Adjusts the weapons angles as it falls to the ground


firedelay ( Float fFireDelay )     

Set the minimum time between shots from the weapon


firespreadmult     

Sets a time decayed multiplyer to spread when the weapon is fired


firespreadmult ( Float scaleadd, Float falloff, Float cap, Float maxtime )    

Sets a time decayed multiplyer to spread when the weapon is fired


firetype ( String firingType )     

Set the firing type of the weapon (projectile or bullet)


holsterangles ( Vector angles )     

Set the angles of this weapon when it is holstered


holsteroffset ( Vector offset )     

Set the positional offset when it is holstered


holsterscale ( Float scale )     

Set the scale of the weapon when it's attached to the holster


holstertag ( String tagname )     

Set the name of the tag to attach this to when the weapon is holstered.


idle      

Puts the weapon into an idle state


idleinit      

Puts the weapon into an idle state and clears all the anim slots


item_pickup ( Entity item )     

Pickup the specified item.


loopfire      

Makes the weapon fire by looping the fire animation.


mainattachtotag ( String tagname )     

Set the name of the tag to attach this to it's owner when being used.


makenoise     

Makes the weapon make noise that actors can hear.


makenoise ( [Float noise_radius], [Boolean force] )    

Makes the weapon make noise that actors can hear.


maxchargetime ( Integer time )     

Set the maximum time the weapon may be charged up


maxfiremovement ( Float speedmult )    

Sets the max speed the player can be moving to fire the weapon (fraction 
of weapon's running speed)


maxmovementsound ( String name )    

sets the weapon's movement fire prevention sound alias


maxrange ( Float maxRange )     

Set the maximum range of a weapon so the AI knows how to use it


meansofdeath ( String meansOfDeath )     

Set the meansOfDeath of the weapon.


minchargetime ( Integer time )     

Set the minimum time the weapon must be charged up


minrange ( Float minRange )     

Set the minimum range of a weapon so the AI knows how to use it


movementspeed ( Float speedmult )     

Alters the movement speed of the player when he has the weapon out


noammosound ( String name )     

sets the weapon's dry fire sound alias


notdroppable      

Makes a weapon not droppable


numfireanims ( Integer value )    

Sets the number of fire animations this weapon uses.


offhandattachtotag ( String tagname )     

Set the name of the tag to attach this to it's owner's off hand.


overcooked     

used when the cookable weapon has been over cooked.


overcooked_warning     

causes a warning sound to play that the grenade is about to be 
overcooked.


projectile ( String projectileModel )     

Set the model of the projectile that this weapon fires


quiet      

Makes the weapon make no noise.


range ( Float range )     

Set the range of the weapon


rank ( Integer iOrder, Integer iRank )     

Set the order value and power ranking for the weapon


ready      

Signals the end of the ready animation so the weapon can be used


secondary     

Set the secondary mode of the weapon, by passing commands through


secondary ( [String arg1], [String arg2], [String arg3], [String arg4], [String arg5], [String arg6], [String arg7], [String arg8] )    

Set the secondary mode of the weapon, by passing commands through


secondaryammoinhud     

Makes the weapon show its secondary ammo to the hud.


semiauto      

Sets the weapon to fire semi-auto


setaimanim     

Set the aim animation and frame for when a weapon fires


setaimanim ( String aimAnimation, Integer aimFrame )    

Set the aim animation and frame for when a weapon fires


setcurrentfireanim ( Integer value )    

Sets the current firing animation.


shareclip ( Integer shareClip )     

Sets the weapon to share the same clip between all fire modes


shoot ( [String mode] )     

Shoot the weapon


startammo ( Integer amount )     

Set the starting ammo of this weapon


startingammotoowner      

Internal event used to give ammo to the owner of the weapon


startitem ( String itemname )    

Adds an item to the starting loadout of the weapon


throughmetal ( Float dist )    

Sets how far the bullets can go through metal


throughwood ( Float dist )    

Sets how far the bullets can go through wood


tracerfrequency ( Integer frequenct )     

Set the frequency of making tracers


tracerspeed ( Float speed )    

Scale factor of how fast a tracer should travel (valid ranges 0-2)


usenoammo ( Boolean bool )     

Set the weapon to be able to be used when it's out of ammo


viewkick     

Adds kick to the view of the owner when fired.


viewkick ( Float pitchmin, Float pitchmax, [Float yawmin], [Float yawmax] )    

Adds kick to the view of the owner when fired.


weapongroup ( String weapon_group )     

Sets the weapon group, a set of animations for actor animations scripts to use


weaponsubtype ( Integer subtype )    

sets the weapon's sub-type. Used by smoke grenades.


weapontype ( String weapon_type )     

Sets the weapon type


worldhitspawn ( String modelname )     

Set a model to be spawned when the weapon strikes the world.


zoom ( Integer zoomfov, [Integer autozoom] )     

Sets fov to zoom to on a secondary fire


zoommovement ( Float speedmult )    

Sets the max speed the player can move while zoomed (fraction of 
weapon's running speed)


zoomspreadmult ( Float scale )     

Sets the spread multiplyer for when using the zoom on a zooming weapon


Posted: Mon Sep 19, 2005 2:50 am
by Kiko
:P you had all that time to script taht... in that time you could have helped me out by making teh mod ;)

Posted: Mon Sep 19, 2005 1:18 pm
by Rookie One.pl
He just copy/pasted it from the docs.

Wish all the people would use the documentation like Elgan does.

Posted: Mon Sep 19, 2005 5:32 pm
by Kiko
but I dont understand any of it :(