ERROR LUA "AMMOS.LUA"

  • Initiateur de la discussion
Lorenzo86

Lorenzo86

Geek suprême
Messages
322
Score réaction
8
Points
115
Sa me met sa et je vois pas ou et le probleme

  • [DarkRP] A runtime error has occurred in "addons/darkrpmodification/lua/darkrp_customthings/ammo.lua" on line 69.
  • The best help I can give you is this:
  • Corrupt entity: 9x18 MM Ammo (60 Rounds)!
  • The max must be an existing number or (for advanced users) the getMax field must be a function.
  • Hints:
  • - No hints, sorry.
  • The responsibility for this error lies with (the authors of) one (or more) of these files:
  • 1. addons/darkrpmodification/lua/darkrp_customthings/ammo.lua on line 69
  • 2. [C] on line -1
  • 3. gamemodes/darkrp/gamemode/libraries/modificationloader.lua on line 131
  • 4. gamemodes/darkrp/gamemode/libraries/modificationloader.lua on line 142
  • 5. gamemodes/darkrp/gamemode/cl_init.lua on line 47
  • ------- End of Simplerr error -------
 
MathiouGaming

MathiouGaming

Geek suprême
Messages
376
Score réaction
99
Points
150
Envois ton fichier ammo.lua ^^
 
  • Initiateur de la discussion
Lorenzo86

Lorenzo86

Geek suprême
Messages
322
Score réaction
8
Points
115
--[[---------------------------------------------------------------------------
Ammo types
---------------------------------------------------------------------------
Ammo boxes that can be purchased in the F4 menu.

Add your custom ammo types in this file. Here's the syntax:
DarkRP.createAmmoType("ammoType", {
name = "Ammo name",
model = "Model",
price = 1234,
amountGiven = 5678,
customCheck = function(ply) return ply:IsAdmin()
})

ammoType: The name of the ammo that Garry's mod recognizes
If you open your SWEP's shared.lua, you can find the ammo name next to
SWEP.Primary.Ammo = "AMMO NAME HERE"
or
SWEP.Secondary.Ammo = "AMMO NAME HERE"

name: The name you want to give to the ammo. This can be anything.

model: The model you want the ammo to have in the F4 menu

price: the price of your ammo in dollars

amountGiven: How much bullets of this ammo is given every time the player buys it

customCheck: (Optional! Advanced!) a Lua function that describes who can buy the ammo.
Similar to the custom check function for jobs and shipments
Parameters:
ply: the player who is trying to buy the ammo

Examples are below!

Pistol ammo type. Used by p228, desert eagle and all other pistols
Example 1:

DarkRP.createAmmoType("pistol", {
name = "Pistol ammo",
model = "models/Items/BoxSRounds.mdl",
price = 30,
amountGiven = 24
}

Buckshot ammo, used by the shotguns
Example 2:

DarkRP.createAmmoType("buckshot", {
name = "Shotgun ammo",
model = "models/Items/BoxBuckshot.mdl",
price = 50,
amountGiven = 8
})

Rifle ammo, usually used by assault rifles
Example 3:

DarkRP.createAmmoType("smg1", {
name = "Rifle ammo",
model = "models/Items/BoxMRounds.mdl",
price = 80,
amountGiven = 30
})

Add new ammo types under the next line!
---------------------------------------------------------------------------]]

DarkRP.createEntity("9x18 MM Ammo (60 Rounds)", {
ent = "fas2_ammo_9x18",
model = "models/Items/BoxMRounds.mdl",
price = 1000,
cmd = "buy9x18mm",
})


DarkRP.createEntity("9x19 MM Ammo (40 Rounds)", {
ent = "fas2_ammo_9x19",
model = "models/Items/BoxMRounds.mdl",
price = 1000,
cmd = "buy9x19mm",
})


DarkRP.createEntity("10x25 Ammo (60 Rounds)", {
ent = "fas2_ammo_10x25",
model = "models/Items/BoxMRounds.mdl",
price = 1000,
cmd = "buy10x25mm",
})


DarkRP.createEntity("12 Gauge Ammo (16 Rounds)", {
ent = "fas2_ammo_12gauge",
model = "models/Items/BoxMRounds.mdl",
price = 1000,
cmd = "buy12gauge",
})


DarkRP.createEntity("23x75MMR Ammo (20 Rounds)", {
ent = "fas2_ammo_23x75",
model = "models/Items/BoxMRounds.mdl",
price = 1000,
cmd = "buy23x75mmr",
})


DarkRP.createEntity("40MM HE Ammo (10 Rounds)", {
ent = "fas2_ammo_40mm",
model = "models/Items/BoxMRounds.mdl",
price = 1000,
cmd = "buy40mmhe",
})


DarkRP.createEntity(".44 Magnum Ammo (12 Rounds)", {
ent = "fas2_ammo_44mag",
model = "models/Items/BoxMRounds.mdl",
price = 1000,
cmd = "buy44magnumammo",
})


DarkRP.createEntity(".45 ACP Ammo (30 Rounds)", {
ent = "fas2_ammo_45acp",
model = "models/Items/BoxMRounds.mdl",
price = 1000,
cmd = "buy45acpammo",
})


DarkRP.createEntity(".50 AE Ammo (14 Rounds)", {
ent = "fas2_ammo_50ae",
model = "models/Items/BoxMRounds.mdl",
price = 1000,
cmd = "buy50aeammo",
})


DarkRP.createEntity(".50 BMG Ammo (20 Rounds)", {
ent = "fas2_ammo_50bmg",
model = "models/Items/BoxMRounds.mdl",
price = 1000,
max = 2,
cmd = "buy50bmgammo",
})


DarkRP.createEntity(".357 SIG Ammo (30 Rounds)", {
ent = "fas2_ammo_357sig",
model = "models/Items/BoxMRounds.mdl",
price = 1000,
max = 2,
cmd = "buy357sigammo",
})


DarkRP.createEntity(".380 ACP Ammo (60 Rounds)", {
ent = "fas2_ammo_380acp",
model = "models/Items/BoxMRounds.mdl",
price = 1000,
max = 2,
cmd = "buy380acpammo",
})


DarkRP.createEntity(".500 S&W Ammo (10 Rounds)", {
ent = "fas2_ammo_454casull",
model = "models/Items/BoxMRounds.mdl",
price = 1000,
max = 2,
cmd = "buy500swammo",
})

DarkRP.createEntity("5.45x39MM Ammo (60 Rounds)", {
ent = "fas2_ammo_545x39",
model = "models/Items/BoxMRounds.mdl",
price = 1000,
max = 2,
cmd = "buy545x39ammo",
})


DarkRP.createEntity("5.56x45MM Ammo (60 Rounds)", {
ent = "fas2_ammo_556x45",
model = "models/Items/BoxMRounds.mdl",
price = 1000,
max = 2,
cmd = "buy556x45ammo",
})


DarkRP.createEntity("7.62x39MM Ammo (60 Rounds)", {
ent = "fas2_ammo_762x39",
model = "models/Items/BoxMRounds.mdl",
price = 1000,
max = 2,
cmd = "buy762x39ammo",
})


DarkRP.createEntity("7.62x51MM Ammo (40 Rounds)", {
ent = "fas2_ammo_762x51",
model = "models/Items/BoxMRounds.mdl",
price = 1000,
max = 2,
cmd = "buy7651ammo",
})


DarkRP.createEntity("M67 Grenades (12 Grenades)", {
ent = "fas2_ammo_m67",
model = "models/Items/BoxMRounds.mdl",
price = 1000,
max = 2,
cmd = "buym27grenades",
})


DarkRP.createAmmoType("pistol", {
name = "Munition de pistolet (12)",
model = "models/Items/BoxSRounds.mdl",
price = 25,
amountGiven = 12
})

DarkRP.createAmmoType("buckshot", {
name = "Munition fusil à pompe (4)",
model = "models/Items/BoxBuckshot.mdl",
price = 120,
amountGiven = 4
})

DarkRP.createAmmoType("smg1", {
name = "Rifle Ammo (24)",
model = "models/Items/BoxMRounds.mdl",
price = 75,
amountGiven = 24
})

DarkRP.createAmmoType("ar2", {
name = "Pulse Ammo (32)",
model = "models/Items/BoxMRounds.mdl",
price = 175,
amountGiven = 32
})


DarkRP.createAmmoType("AirboatGun", {
name = "Munition de winchester (8)",
model = "models/items/sniper_round_box.mdl",
price = 120,
amountGiven = 8
})

DarkRP.createAmmoType("SniperPenetratedRound", {
name = "Munition de sniper (14)",
model = "models/items/sniper_round_box.mdl",
price = 250,
amountGiven = 14
})

DarkRP.createAmmoType("357", {
name = "Munition de 357 (6)",
model = "models/Items/357ammo.mdl",
price = 150,
amountGiven = 6
})

-- Autres

DarkRP.createAmmoType("Rpg_Round", {
name = "Roquette (1)",
model = "models/Weapons/W_missile_closed.mdl",
price = 850,
amountGiven = 1
})

DarkRP.createAmmoType("Nuclear_Warhead", {
name = "Ogive nucléaire (1)",
model = "models/failure/mk6/mk6.mdl",
price = 100000000,
amountGiven = 10
})

DarkRP.createAmmoType("NerveGas", {
name = "Grenade à gaz (1)",
model = "models/healthvial.mdl",
price = 3500,
amountGiven = 1
})

DarkRP.createAmmoType("Improvised_Explosive", {
name = "IED (1)",
model = "models/weapons/w_camphon2.mdl",
price = 5000,
amountGiven = 1
})

DarkRP.createAmmoType("40mmgrenade", {
name = "40mm Grenade (1)",
model = "models/items/ammocrates/crate40mm.mdl",
price = 2000,
amountGiven = 1
})

DarkRP.createAmmoType("C4Explosive", {
name = "C4 Kit (1)",
model = "models/items/ammocrates/cratec4.mdl",
price = 50000,
amountGiven = 1
})
 
MathiouGaming

MathiouGaming

Geek suprême
Messages
376
Score réaction
99
Points
150
Rooh faut compter les lignes mdr
 
xLomble77

xLomble77

Psychopathe
Messages
2 191
Score réaction
348
Points
290
Tu met tes entités dans tes munitions toi ? Tu fais fort..
 
  • J'aime
Réactions: Warzik et samgaze
Warzik

Warzik

Geek suprême
Messages
797
Score réaction
340
Points
190
C'est vrai que si tu mélange entité et munitions tu risque pas de t'en sortir xD
Ligne 69 tu as

DarkRP.createEntity("9x18 MM Ammo (60 Rounds)", {
ent = "fas2_ammo_9x18",
model = "models/Items/BoxMRounds.mdl",
price = 1000,
cmd = "buy9x18mm",
})

Donc enlève toutes les createEntity que tu mettras dans entities.lua et laisse uniquement les createAmmo
 
Discord d'entraide
Rejoignz-nous sur Discord