From 075a3a2f3b3488a5acb3ed85f97d4065aaa6e2d5 Mon Sep 17 00:00:00 2001 From: Jakestus Date: Thu, 24 Oct 2019 22:32:40 +0300 Subject: [PATCH] Add files via upload --- car/__resource.lua | 3 +++ car/carspawn.lua | 44 ++++++++++++++++++++++++++++++++++++++++++++ config.cfg | 9 +++++++++ die/__resource.lua | 3 +++ die/die.lua | 11 +++++++++++ gun/__resource.lua | 3 +++ gun/guns4all.lua | 46 ++++++++++++++++++++++++++++++++++++++++++++++ pos/__resource.lua | 3 +++ pos/pos.lua | 11 +++++++++++ 9 files changed, 133 insertions(+) create mode 100644 car/__resource.lua create mode 100644 car/carspawn.lua create mode 100644 config.cfg create mode 100644 die/__resource.lua create mode 100644 die/die.lua create mode 100644 gun/__resource.lua create mode 100644 gun/guns4all.lua create mode 100644 pos/__resource.lua create mode 100644 pos/pos.lua diff --git a/car/__resource.lua b/car/__resource.lua new file mode 100644 index 0000000..b7d3340 --- /dev/null +++ b/car/__resource.lua @@ -0,0 +1,3 @@ +resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' + +client_script 'carspawn.lua' \ No newline at end of file diff --git a/car/carspawn.lua b/car/carspawn.lua new file mode 100644 index 0000000..cf301d7 --- /dev/null +++ b/car/carspawn.lua @@ -0,0 +1,44 @@ +RegisterCommand('car', function(source, args) + + local vehicle = args[1] or "futo" + + if not IsModelInCdimage(vehicle) or not IsModelAVehicle(vehicle) then + TriggerEvent("chat:addMessage", { + color = {255,0,0}, + args = { vehicle .. ' ei ole ajoneuvo tai sitä ei löydy.' } + }) + return + end + + RequestModel(vehicle) + + while not HasModelLoaded(vehicle) do + Wait(500) + end + + local ped = PlayerPedId() + local pos = GetEntityCoords(ped) + local head, vect = GetClosestVehicleNodeWithHeading(pos.x, pos.y, pos.z, 1) + local x,y,z = table.unpack(vect) +-- local veh = CreateVehicle(vehicle, pos.x+5, pos.y+5, pos.z, GetEntityHeading(ped), true, false) + local veh = CreateVehicle(vehicle, x, y, z, GetEntityHeading(ped), true, false) +-- local veh = CreateVehicle(vehicle, x, y, z, head, true, false) + SetVehicleOnGroundProperly(veh) + + + SetVehicleNumberPlateText(veh, GetPlayerName()) + + TriggerEvent('chat:addMessage', { + color = {0,255,0}, + args = { 'Tässä pyytämäsi upouusi ' .. vehicle } + }) + + local blip = AddBlipForEntity(veh) + SetBlipSprite(blip, 225) + SetBlipFlashes(blip, true) + SetBlipFlashTimer(blip, 10000) + + SetModelAsNoLongerNeeded(vehicle) + SetEntityAsNoLongerNeeded(veh) +end, false) + diff --git a/config.cfg b/config.cfg new file mode 100644 index 0000000..dd3e87d --- /dev/null +++ b/config.cfg @@ -0,0 +1,9 @@ +# Include this in yout main config using something like +#exec resources/[buddem]/config.cfg +#your mileage may vary + +# Autostart buddem things +ensure car +ensure pos +ensure die +ensure gun \ No newline at end of file diff --git a/die/__resource.lua b/die/__resource.lua new file mode 100644 index 0000000..a39cfbf --- /dev/null +++ b/die/__resource.lua @@ -0,0 +1,3 @@ +resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' + +client_script 'die.lua' \ No newline at end of file diff --git a/die/die.lua b/die/die.lua new file mode 100644 index 0000000..a2a2b91 --- /dev/null +++ b/die/die.lua @@ -0,0 +1,11 @@ +RegisterCommand('die', function(source, args) + + + SetEntityHealth(PlayerPedId(), 0) + TriggerEvent('chat:addMessage', { + color = {255,0,0}, + args = { 'Sydämesi petti' } + }) + +end, false) + diff --git a/gun/__resource.lua b/gun/__resource.lua new file mode 100644 index 0000000..8a19f66 --- /dev/null +++ b/gun/__resource.lua @@ -0,0 +1,3 @@ +resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' + +client_script 'guns4all.lua' \ No newline at end of file diff --git a/gun/guns4all.lua b/gun/guns4all.lua new file mode 100644 index 0000000..fed371d --- /dev/null +++ b/gun/guns4all.lua @@ -0,0 +1,46 @@ +RegisterCommand('gun', function(source, args) + giveGrantedWpn() + + TriggerEvent('chat:addMessage', { + color = {255,255,0}, + args = { 'Hernepyssynne, olkaa hyvä.' } + }) +end, false)RegisterCommand('wpn', function(source, args) + giveGrantedWpn() + + TriggerEvent('chat:addMessage', { + color = {255,255,0}, + args = { 'Hernepyssynne, olkaa hyvä.' } + }) +end, false) + +AddEventHandler('playerSpawned', function() + giveGrantedWpn() +end, false) + +function giveGrantedWpn() + local ped = PlayerPedId() + local weapons = { + "WEAPON_PISTOL", + "WEAPON_STUNGUN", + "WEAPON_GRENADE", + "WEAPON_STICKYBOMB", + "WEAPON_PROXMINE", + "WEAPON_HOMINGLAUNCHER", + "WEAPON_RPG", + "WEAPON_FIREWORK", + "WEAPON_GRENADELAUNCHER", + "WEAPON_RAILGUN", + "WEAPON_RAYPISTOL", + "WEAPON_RAYMINIGUN", + "WEAPON_RAYCARBINE", + "WEAPON_FIREEXTINGUISHER", + "WEAPON_PETROLCAN" + } + + for i,wpn in ipairs(weapons) do + GiveWeaponToPed(ped, wpn) + SetPedInfiniteAmmo(ped, true, wpn) + end + +end \ No newline at end of file diff --git a/pos/__resource.lua b/pos/__resource.lua new file mode 100644 index 0000000..6aa4adb --- /dev/null +++ b/pos/__resource.lua @@ -0,0 +1,3 @@ +resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937' + +client_script 'pos.lua' \ No newline at end of file diff --git a/pos/pos.lua b/pos/pos.lua new file mode 100644 index 0000000..1779b51 --- /dev/null +++ b/pos/pos.lua @@ -0,0 +1,11 @@ +RegisterCommand('pos', function(source, args) + + + local ped = PlayerPedId() + local pos = GetEntityCoords(ped) + + TriggerEvent('chat:addMessage', { + args = { pos.x .. "\n" .. pos.y.. "\n" .. pos.z } + }) + +end, false) \ No newline at end of file