• DarkRP: Forced Illegal Weapons
    6 replies, posted
I have gun dealer and contrabandist, first give you normal weapons, secondary give illegal weapons. Clarifying the question - want if player buy weapon at gun dealer, for this weapons enabled license, and if player have license then police checker not find illegal (this standart), BUT, if player buy weapon at contrabandist then this weapon forced illegal, if player not have license - checker find this weapon AND if player HAVE license then contrabandist weapon find by police checker. This real with shimplents.lua ? --- Gun Dealer --- DarkRP.createShipment("Tesla Rifle", {                      model = "models/weapons/w_sanctum2_tr.mdl",         entity = "sanctum2_tr",                      price = 65000,                                    amount = 5,                                    separate = false,                               pricesep = nil,                                  noship = false,                                 allowed = {TEAM_GUN},                                 }) --- Contrabandist --- DarkRP.createShipment("Tesla Rifle.", {                      model = "models/weapons/w_sanctum2_tr.mdl",         entity = "sanctum2_tr",                      price = 35000,                                    amount = 5,                                    separate = false,                               pricesep = nil,                                  noship = false,                                 allowed = {TEAM_GUNCR},                                 })
I want to dealers have own, I not use script, I do not know how to write script with license settings, I do not know work it in shimpments or required create weapon copy with scpecial script, which ignore license
have a table of weapons you can white list. If a weapon isn't on the white list, it's illegal.
this? table WhiteList = {  "weapon_gamma",  "tfa_ins2_mateba",  "sanctum2_sr",  "sanctum2_hc",  "sanctum2_tr",  "sanctum2_bc",  "sanctum2_smg",  "sanctum2_ar", "sanctum2_mine",  "weapon_plasmacutter_bread", "weapon_doom3_pistol",  "weapon_doom3_shotgun", "weapon_plasmanade",  "shield_2", "weapon_doom3_grenade",  "weapon_doom3_machinegun", "sanctum2_mine" } table BlackList = {  "nz_wunderwaffe",  "weapon_faton",  "weapon_doom3_bfg",  "weapon_doom3_chaingun",  "weapon_doom3_rocketlauncher"  "defabricator",  "deika_ds2pulserifle",  "weapon_asmd", "weapon_crossfire44",  "tfa_doom_ssg", "tfa_doom_gauss" }
You don't need but unless you want, one or the other. local tableName = { "nz_wunderwaffe", "weapon_faton", "weapon_doom3_bfg", "weapon_doom3_chaingun", "weapon_doom3_rocketlauncher""defabricator", "deika_ds2pulserifle", "weapon_asmd", "weapon_crossfire44", "tfa_doom_ssg", "tfa_doom_gauss" }
I modify script function BlackListed() local BlackList = {  "nz_wunderwaffe",  "weapon_faton",  "weapon_doom3_bfg",  "weapon_doom3_chaingun",  "weapon_doom3_rocketlauncher"  "defabricator",  "deika_ds2pulserifle",  "weapon_asmd", "weapon_crossfire44",  "tfa_doom_ssg", "tfa_doom_gauss"   } local white_classes = {TEAM_POLICE, TEAM_POLICE2, TEAM_POLICE3, TEAM_POLICE4, TEAM_POLICE5, TEAM_POLICEMEDIK, TEAM_POLICEMEDIK2, TEAM_POLICEMEDIK3, TEAM_POLICEMEDIK4, TEAM_POLICEMEDIK5 TEAM_POLICE_HEAVY, TEAM_POLICE_HEAVY2, TEAM_PALATIN, TEAM_OMON, TEAM_OMON2, TEAM_OMOSN, TEAM_OMOSN2, TEAM_CHIEF, TEAM_MAYOR, TEAM_PSYONIC, } local p = Player() local wgo = weapon:GetOwner()       if table.HasValue(white_classes, pl:Team()) then return end         else         if p:Give(BlackList[math.random(1,#BlackList)])                 then         Initiator:setDarkRPVar("HasGunlicense", false)         wgo:PrintMessage(HUD_PRINTNOTIFY, "Non-licensed weapon!" ..weapon:GetClass()"not able have license!")     else return end              end end It is true?
Sorry, you need to Log In to post a reply to this thread.