FiveM Scripting 2 - GTA V Natives, Key Press, Giving Weapons.

FiveM Scripting 2 - GTA V Natives, Key Press, Giving Weapons.

Jeva

5 лет назад

213,297 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@leventepeter591
@leventepeter591 - 31.05.2023 23:00

Hi, I keep getting this weird error but I do everything the same as you resources:guns] Error: guns failed to load: Could not parse resource metadata file D:/txData/CFXDefaultFiveM_772D41.base/resources//guns/__resource.lua: guns/__resource.lua:1: syntax error near 'scripts'

Ответить
@hazzy8611
@hazzy8611 - 29.01.2023 00:17

could you make one that gives you max armour and guns when hitting your wanted key?

Ответить
@Xpressd
@Xpressd - 02.10.2022 21:07

⭐⭐⭐⭐⭐

Ответить
@zcsully3184
@zcsully3184 - 18.05.2022 14:41

my fivem couldnt start resource guns, I added the resource manifest and fixed any typos and it still does not work :(

Ответить
@whister3362
@whister3362 - 05.03.2022 21:43

Thanks you acctully helped me and learned me my first coding launge:)

Ответить
@snipethecanadian8589
@snipethecanadian8589 - 06.12.2021 10:54

Your videos are VERY blurry at least on mobile... Also what's your discord for any help. Due to the link for discord you shared doesn't work and takes me to a webpage saying that jeva may be for sale.

Ответить
@lxckysnxps3652
@lxckysnxps3652 - 12.09.2021 05:01

how do u space perfect while ur on the line i always gotta delete then enter but everyone of the thigns u do i copy exactlly and they dont work

Ответить
@juicifer2024
@juicifer2024 - 09.09.2021 18:41

cant find resource guns.....why?

Ответить
@simonfjellhager6926
@simonfjellhager6926 - 15.08.2021 13:03

Fix, Working 15/08/2021:

functions.lua:


function alert(msg)
BeginTextCommandDisplayHelp("STRING")
AddTextComponentSubstringPlayerName(msg)
EndTextCommandDisplayHelp(0, 0, 1, -1)
end

function notify(msg)
SetNotificationTextEntry("STRING")
AddTextComponentString(msg)
DrawNotification(true,false)
end

function giveWeapon(hash)
GiveWeaponToPed(GetPlayerPed(-1), GetHashKey(hash), 999, false, false)

end

RegisterCommand("giveweapon", function(source, args, rawCommand)
local playerPed = GetPlayerPed(-1)
local weaponHash = GetHashKey(args[1])
local ammoCount = 999

TriggerEvent("chat:addMessage", "", {0, 0, 0}, "Giving weapon")
GiveWeaponToPed(playerPed, weaponHash, ammoCount, false)
notify("~r~Giving Weapon.")
end)

client.lua:

RegisterCommand("clear", function()
RemoveAllPedWeapons(GetPlayerPed(-1), true)
notify("~r~Cleared Inventory")
end)

Citizen.CreateThread(function()

local h_key = 168
while true do
Citizen.Wait(1)
if IsControlJustReleased(1, h_key) then
print("The key ".. h_key .. " was pressed")
giveWeapon("weapon_Nightstick")
giveWeapon("weapon_Flashlight")
giveWeapon("weapon_StunGun")
giveWeapon("weapon_MarksmanPistol")
notify("~b~Given Gear")
end
end

end)

Ответить
@fivemudvikling-sh4ps972
@fivemudvikling-sh4ps972 - 10.08.2021 04:26

Mine dosen't work...

Ответить
@fivemudvikling-sh4ps972
@fivemudvikling-sh4ps972 - 10.08.2021 04:23

What if they have an outdated Manifest?

Ответить
@johnordonez4435
@johnordonez4435 - 23.07.2021 10:20

thanks man this was helpful, but i wouldnt mind a longer video for more details on what the code is doing. anyway great work ty

Ответить
@MiyaGaga
@MiyaGaga - 11.07.2021 12:13

Why does it say on my starter "can't start stopped resource"? How to fix?

Ответить
@businessyamen7353
@businessyamen7353 - 09.07.2021 06:05

🇹🇳🇹🇳🇹🇳🇹🇳

Ответить
@BOOMNationX
@BOOMNationX - 26.06.2021 11:52

You are talking to yourself,

Ответить
@marceljanz9905
@marceljanz9905 - 28.05.2021 18:19

Very poor explanation tbh, not helpful if you are a beginner in FiveM modding. What are natives even? You should consider explaining everything a little bit better.

Ответить
@kurtbliss3
@kurtbliss3 - 19.04.2021 15:56

How do you view what you print for the client??

Ответить
@spyke2990
@spyke2990 - 14.04.2021 13:50

it says couldnt find resource guns pls hlep

Ответить
@criss1707
@criss1707 - 29.03.2021 19:50

For me the it said couldnt find rsource guns help pls

Ответить
@pyrotechnick420
@pyrotechnick420 - 10.03.2021 05:06

I'm trying to work on RedM scripting but I'm trying to follow along with your tutorials and it's not working.
I couldn't even spawn a ped in T_T

Ответить
@zateeprod4152
@zateeprod4152 - 03.03.2021 17:49

thx for these tutorials, you helped a lot

Ответить
@10outdatK
@10outdatK - 28.01.2021 01:47

anyhelp do this stil work?? cause i do exactly everything and when i go to load up my server i dont see it

Ответить
@AriS-qy8px
@AriS-qy8px - 27.01.2021 23:02

Русские?)))тут

Ответить
@JaJax2002
@JaJax2002 - 09.01.2021 17:04

can someone help its say resource not found i followed all steps

Ответить
@csongor_gamba
@csongor_gamba - 17.12.2020 13:41

I am having an issue with it. My server cant find my resources even tho they are in the resources folder.

Ответить
@antonl1894
@antonl1894 - 16.12.2020 23:51

Thanks! Learnt a'lot from this!

Ответить
@noriscereal9919
@noriscereal9919 - 10.12.2020 13:46

i do everything you do but for some reason it doesn't work at all

Ответить
@kostasdemiris5282
@kostasdemiris5282 - 10.10.2020 23:25

guys can i upload my server without an pi port forward?

Ответить
@mendama790
@mendama790 - 31.08.2020 23:37

Am i the only that can use those command or everyone that joins can use them?

Ответить
@jacorpze373
@jacorpze373 - 31.08.2020 05:31

I followed ur tutorial abt make localhost server and it work but there nothing inside no house no fancy car or anything, how do i add those? I mean the house i can go in and clothe shop, barber ect. Pls if there is a video for that can u give me link

Ответить
@lukas916
@lukas916 - 25.08.2020 19:13

for wich fivem version is this script

Ответить
@bastian2litty
@bastian2litty - 20.07.2020 19:00

How would I go about a command (ex. /givegun "gun name") giving the players the guns instead of pressing a key?

Ответить
@ovni5936
@ovni5936 - 15.07.2020 21:41

My guy everytime I launch my seerver it says couldnt load resource guns helppppppppppp!

Ответить
@huseyinsefakucuk1032
@huseyinsefakucuk1032 - 29.06.2020 17:13

Everything is fine but when i press "H" I get nil value giveWeapon also /clear works fine

Ответить
@user-yx6zi5zg7k
@user-yx6zi5zg7k - 27.06.2020 14:00

He is saying can't restart stopped resource pls help and the command help is not working as well when I try to right /help on the chat nothing happens

Ответить
@salongajhericostephenn.7010
@salongajhericostephenn.7010 - 27.06.2020 09:52

not working, but the /clear is working

Ответить
@sluggaming4577
@sluggaming4577 - 27.06.2020 07:09

this 13 min video took me a hour and a half this is crazy this was not your best tut but if i was new and seen this i would have left.

Ответить
@JustinTwilley
@JustinTwilley - 12.06.2020 20:28

I could only get it to work by pasting yours, but still cant get an additional weapon to work what am I doing wrong? lol

Ответить
@swajpz
@swajpz - 11.06.2020 19:08

guys dont use __resource.lua but fxmanifest!!

Ответить
@janopule800
@janopule800 - 30.05.2020 23:55

don't even work LMAO

Ответить
@tannyant
@tannyant - 21.05.2020 23:59

i did everything but it still didnt work

Ответить
@Cr0NiiX_
@Cr0NiiX_ - 21.05.2020 12:54

Do you know how to add MK2 weapons to the gun cabinet? Yes we have the mk2 Pistol ingame but we cant place it into the gun cabinet.

Best Regards

Ответить
@parag0n994
@parag0n994 - 19.05.2020 20:15

im getting this please help "Authenticating with Nucleus failed! That’s bad"

Ответить
@jonar2463
@jonar2463 - 11.05.2020 09:53

how to edit gun damage?

Ответить
@hero_nuke3m170
@hero_nuke3m170 - 09.05.2020 01:11

my server didnt have and issue loading after i put in the resource but it does not work in game

Ответить
@mariom.1346
@mariom.1346 - 05.05.2020 16:46

Hi, the link to your discord isn't working so i'll ask here: I have set the giving weapons to a command as opposed to a key but when i put the command in chat it does nothing, do i still need that infinit loop if i am using the command? because as far as i understand that is to check if the key was pressed which i wouldn't need for the command, also it'd probably break things because the game is infinately giving the player guns

Ответить
@hariszockt4600
@hariszockt4600 - 25.04.2020 21:23

maybe there is a mistake in the __resource.lua

Ответить