Update of My Version, I just removed the civ stuff and changed the weapons up, can someone see if all of this works????
local myPed = PlayerPedId()
local localPed = PlayerId()
function notify(string)
SetNotificationTextEntry("STRING")
AddTextComponentString(string)
DrawNotification(true, false)
end
function loadModel(modelHash)
local model = GetHashKey(modelHash)
RequestModel(model)
while not HasModelLoaded(model) do
RequestModel(model)
Citizen.Wait(0)
end
SetPlayerModel(localPed, model)
SetModelAsNoLongerNeeded(model)
end
function giveWeapon(weaponHash)
GiveWeaponToPed(GetPlayerPed(-1), GetHashKey(weaponHash), 999, false)
end
function weaponComponent(weaponHash, component)
if HasPedGotWeapon(PlayerPedId(), GetHashKey(weaponHash), false) then
GiveWeaponComponentToPed(PlayerPedId(), GetHashKey(weaponHash), GetHashKey(component))
end
end
RegisterCommand('bcso', function()
--Loads Player model
loadModel("s_m_y_sheriff_01")
--Gives the player weapons
giveWeapon("WEAPON_COMBATPISTOL")
weaponComponent("", "", )
giveWeapon("WEAPON_NIGHTSTICK")
giveWeapon("WEAPON_FIREEXTINGUISHER")
giveWeapon("WEAPON_CARBINERIFLE")
weaponComponent("", "", )
giveWeapon("WEAPON_FLARE")
giveWeapon("WEAPON_PUMPSHOTGUN")
weaponComponent("", "", )
giveWeapon("WEAPON_STUNGUN")
--Native Notification function usage
notify("~b~~h~Sheriff~h~~w~ Loadout Loaded.")
end, false)
TriggerEvent('chat:addSuggestion', '/bcso', 'Loads the Sheriffs loadout')
RegisterCommand('swat', function()
--Loads Player model
loadModel("s_m_y_sheriff_01")
--Gives the player weapons
giveWeapon("WEAPON_COMBATPISTOL")
weaponComponent("COMPONENT_AT_PI_FLSH")
giveWeapon("WEAPON_NIGHTSTICK")
giveWeapon("WEAPON_WEAPON_SPECIALCARBINE")
weaponComponent("COMPONENT_SPECIALCARBINE_CLIP_03", "COMPONENT_AT_AR_FLSH", "OMPONENT_AT_SCOPE_MEDIUM", "COMPONENT_AT_AR_AFGRIP")
giveWeapon("WEAPON_FLARE")
giveWeapon ("WEAPON_ASSAULTSHOTGUN")
weaponComponent ("COMPONENT_AT_AR_FLSH", "COMPONENT_AT_AR_AFGRIP", "COMPONENT_ASSAULTSHOTGUN_CLIP_02")
giveWeapon ("WEAPON_HEAVYSNIPER")
weaponComponent ("COMPONENT_AT_SCOPE_MAX")
giveWeapon("WEAPON_STUNGUN")
--Native Notification function usage
notify("~b~~h~SRU Team~h~~w~ Loadout Loaded.")
end, false)
TriggerEvent('chat:addSuggestion', '/swat', 'Loads the Swat loadout')
RegisterCommand('lspd', function()
--Loads Player model
loadModel("s_m_y_cop_01")
--Gives the player weapons
giveWeapon("WEAPON_COMBATPISTOL")
weaponComponent("COMPONENT_AT_PI_FLSH")
giveWeapon("WEAPON_NIGHTSTICK")
giveWeapon("WEAPON_FIREEXTINGUISHER")
giveWeapon("WEAPON_CARBINERIFLE")
weaponComponent("COMPONENT_CARBINERIFLE_CLIP_03", "COMPONENT_AT_AR_FLSH", "COMPONENT_AT_SCOPE_MEDIUM", "COMPONENT_AT_AR_AFGRIP")
giveWeapon("WEAPON_FLARE")
giveWeapon("WEAPON_PUMPSHOTGUN")
weaponComponent("COMPONENT_AT_AR_FLSH")
giveWeapon("WEAPON_STUNGUN")
--Native Notification
notify("~b~~h~Police~h~~w~ Loadout Loaded.")
end, false)
TriggerEvent('chat:addSuggestion', '/lspd', 'Loads the City Police loadout')
RegisterCommand('sahp', function()
--Loads Player model
loadModel("s_m_y_hwaycop_01")
--Gives the player weapons
giveWeapon("WEAPON_COMBATPISTOL")
weaponComponent("COMPONENT_AT_PI_FLSH")
giveWeapon("WEAPON_NIGHTSTICK")
giveWeapon("WEAPON_FIREEXTINGUISHER")
giveWeapon("WEAPON_CARBINERIFLE")
weaponComponent("COMPONENT_CARBINERIFLE_CLIP_03", "COMPONENT_AT_AR_FLSH", "COMPONENT_AT_SCOPE_MEDIUM", "COMPONENT_AT_AR_AFGRIP")
giveWeapon("WEAPON_FLARE")
giveWeapon("WEAPON_PUMPSHOTGUN")
weaponComponent("COMPONENT_AT_AR_FLSH")
giveWeapon("WEAPON_STUNGUN")
--Native Notification function usage
notify("~b~~h~Trooper~h~~w~ Loadout Loaded.")
end, false)
TriggerEvent('chat:addSuggestion', '/sahp', 'Loads the Highway Patrol loadout')
RegisterCommand('agent', function()
loadModel('S_M_M_HighSec_02')
giveWeapon("WEAPON_COMBATPISTOL")
weaponComponent("COMPONENT_AT_PI_FLSH")
giveWeapon("WEAPON_NIGHTSTICK")
giveWeapon("WEAPON_FIREEXTINGUISHER")
giveWeapon("WEAPON_CARBINERIFLE")
weaponComponent("COMPONENT_CARBINERIFLE_CLIP_03", "COMPONENT_AT_AR_FLSH", "COMPONENT_AT_SCOPE_MEDIUM", "COMPONENT_AT_AR_AFGRIP")
giveWeapon("WEAPON_FLARE")
giveWeapon("WEAPON_PUMPSHOTGUN")
weaponComponent("COMPONENT_AT_AR_FLSH")
giveWeapon("WEAPON_STUNGUN")
notify("~p~~h~Agent~h~~w~ Loadout Loaded.")
end, false)
TriggerEvent('chat:addSuggestion', '/agent', 'Loads the Secret Agent loadout')
RegisterCommand('safd', function()
--Loads Player model
loadModel("s_m_y_fireman_01")
--Gives the player weapons
giveWeapon("WEAPON_CROWBAR")
giveWeapon("WEAPON_FIREEXTINGUISHER")
giveWeapon("WEAPON_FLARE")
giveWeapon("WEAPON_STUNGUN")
giveWeapon("WEAPON_HATCHET")
--Native Notification function usage
notify("~b~~h~Firefighter~h~~w~ Loadout Loaded.")
end, false)
TriggerEvent('chat:addSuggestion', '/safd', 'Loads the Firefighter loadout')
RegisterCommand('removeall', function() -- Terbium's Idea
RemoveAllPedWeapons(myPed, true)
notify("~g~All Guns Removed")
end, false)
TriggerEvent('chat:addSuggestion', '/removeall', 'Removes all weapons')
-- Clears the model and weapons here
RegisterCommand('clear', function()
loadModel("A_M_M_BevHills_02")
RemoveAllPedWeapons(myPed, true)
notify("~g~Cleared.")
end, false)
TriggerEvent('chat:addSuggestion', '/clear', 'Cleares Player Model and Weapons')