Scripting/Server/Functions/CreateWeaponPickup

(0.5-rc1) A pickup of a custom weapon (a <weapon> tag with a model, see 1.5). It shows the weapon's model, spins and glows in the weapon's pickupcolor, and the player who walks into it is given the weapon with ammo rounds (default 100); onPickupPickedUp fires afterwards as for any pickup. Returns null for a weapon without a custom model (use CreatePickup with the stock weapon's model for the stock ones).

Syntax

CreateWeaponPickup(weapon, pos [, ammo])

Arguments

Returns

Pickup or null.

Example

function onPlayerCommand( player, cmd, params )
{
	if ( cmd == "createweaponpickup" )
	{
		local result = CreateWeaponPickup( WEP_AK47, player.Pos );
		MessagePlayer( "CreateWeaponPickup returned: " + result, player );
	}
}

This sample was generated from the signature – adapt the values to your gamemode.

Section: Creating world entities

Categories: Server functions | Creating world entities