0 im Spiel
Download
Polizeiverfolgung unter der Hochbahn in Mafia II

Wiki

Weapons

Weapons are given by id (or a name from the weapons table). Ammo is added to what the player already has.

IDName in scriptsWeapon
2weapons.revolverModel 12 Revolver
3weapons.mauserMauser C96
4weapons.colt1911Colt M1911A1
5weapons.colt1911specialColt M1911 Special
6weapons.magnumS&W Model 19 Revolver
7weapons.grenadeMK2 Frag Grenade
8weapons.shotgunRemington Model 870
9weapons.greasegunM3 Grease Gun
10weapons.mp40MP40
11weapons.thompsonThompson 1928
12weapons.thompsonm1a1M1A1 Thompson
13weapons.berettaBeretta Model 38A
14weapons.mg42MG42
15weapons.garandM1 Garand
17weapons.kar98kKar98k
21weapons.molotovMolotov Cocktail

Giving weapons and ammo

player:giveWeapon(weapons.thompson, 200)   -- a Thompson with 200 rounds
player:giveAmmo(weapons.thompson, 50)      -- 50 more
player:giveWeapon(4, 21)                   -- by id: Colt M1911A1
player:removeWeapon(weapons.thompson)
player:removeAllWeapons()

A gun shop

local prices = { [weapons.colt1911] = 150, [weapons.thompson] = 900 }
events.onClient("shop:buyWeapon", function(player, weapon)
    local price = prices[weapon]
    if not price or (player:getMoney() or 0) < price then return end
    player:giveMoney(-price)
    player:giveWeapon(weapon, 50)
end)