===== Weapon commands =====
These commands are most commonly used from script to add weapons or particles to your world.
Reference documentation for setting up weapon behaviours is [[World Setup:Weapons Reference|here]].
==== *weaponfire ====
^ Format | *weaponfire [weapon_num],[from_playerid],[world_X],[world_Y],[world_z],[dir_x],[dir_y],[dir_z],[param] |
^ Description | Adds a weapon to the world |
//Example//:
Event( "Custom", "DemoWeapon" )
{
$angle = 0
while ( $angle < 360 )
{
$angleX = sysSin( $angle, 100 )
$angleY = sysCos( $angle, 100 )
$posX = $gPlayerWorldX + $angleX
$posY = $gPlayerWorldY + $angleX
$posZ = $gPlayerWorldZ + 300
*weaponfire 1,$gPlayerID,$posX,$posY,$posZ,$angleX,$angleY,0,0
$angle += 36
}
}
==== *weaponfirespread ====
^ Format | *weaponfirespread [spread_type],[spread_range],[num_weaps],[weapon_num],[from_player],[world_X],[world_Y],[world_z],[vel_x],[vel_y],[vel_z],[param] |
^ Description | Adds a batch of weapons to the world |
//Example//:
Event( "Custom", "Testweap" )
{
$posX = $gPlayerWorldX
$posY = $gPlayerWorldY
$posZ = $gPlayerWorldZ + 2000
*weaponfirespread 0,2000,100,3,$gPlayerID,$posX,$posY,$posZ,0,0,0,0
}
If you're using the old-school method of modifying your server's Data\Weapons.txt to set up weapons, dont forget to use ''*refreshweap'' to reload the file