[Release] 'Crackdown' Missions System v3 & GitHub for your own missions (OUT OF DATE but still somewhat playable)

https://steamuserimages-a.akamaihd.net/ugc/776245734736295039/88CC072D11BB62F346210EB7B7F0C724844D68AC/

Error attempting to concatenate a nil value
Getting this error out of no where. Could it do with one-sync?

I have not touched any of the code from this section:

			if string.len(MISSIONSHOWTEXT) > 0 and MISSIONSHOWTEXT ~="WASTED" then
			-- print("hey")
				local starttime= GetGameTimer()
				while not MISSIONSHAREMONEYAMOUNT do
					Wait(1)
					
					if GetGameTimer() - starttime >= 1000 then
						--print("break")
						break
					end
					
				end
				MISSIONSHOWMESSAGE = MISSIONSHOWMESSAGE .. MISSIONSHAREMONEYAMOUNT	
				MISSIONSHAREMONEYAMOUNT=nil
			end

Not sure if it is due to One Sync or not, since I have never used it.

above line 19110, add this to see if it fixes it:

if  not MISSIONSHAREMONEYAMOUNT then 
 MISSIONSHAREMONEYAMOUNT = ''
end

It removed the error after applying that code you posted. However, the payout still did not credit my esx bank account. I ran the new code with and without Onesync. Disabling Onesync indeed fixes the issue, I will have to look into it more. Seems like it is something to do with communicating with the database.

1 Like

@ddraigcymraeg
First of all thank you for phenomenal share, this resources can bring so much life and action to the gameplay.

On the second note i would like to share my appreciation to your contribution and willing to support your userbase by replying to each and every issue, it’s everybody’s personal choice but i really wish there were much more people with your attitude in this community.

On the third note, I didn’t have a chance to try your resource myself but it is next in my to do list once i finish pending tasks and will defiantly share my experience and feedback.

HI ddraigcymraeg you are good,

I see the mod improved,I have a little problem,

change parameter in:
–START HOSTILE AMBIENT PEDS

–VALUES: 0: no hostiles, 1: hostiles have less infighting (most dangerous)
–2: a little more infighthing between hostiles.
–3: riot mode, virtually all peds hate each other as well.
Config.HostileAmbientPeds = 1

1-2-3 they don’t make any changes

thanks and a hug

Thanks man, glad you are enjoying.
I take it that when you set Config.HostileAmbientPeds = 1, ambient peds do become hostile? That should work.
I can double check this if not.
Also make sure no other custom resources are affecting the peds… so I would test with just this resource at first.

1 Like

Very odd, that code has not changed in client.lua, is self contained, and it is getting called when > 0 and its pretty standard, but I dont see any hostile peds either anymore. It’s essentially the same code from a fivem member that posted it on the forums.
Weird, not sure what is going on. I dont have any other mods that change relationships, and afaik, did not add any relationship code that would affect this. the code below gets called every 50 milliseconds as well, so should override other code.

local relationshipTypes = {
"PLAYER",
"CIVMALE",
"CIVFEMALE",
"COP",
"SECURITY_GUARD",
"PRIVATE_SECURITY",
"FIREMAN",
"GANG_1",
"GANG_2",
"GANG_9",
"GANG_10",
"AMBIENT_GANG_LOST",
"AMBIENT_GANG_MEXICAN",
"AMBIENT_GANG_FAMILY",
"AMBIENT_GANG_BALLAS",
"AMBIENT_GANG_MARABUNTE",
"AMBIENT_GANG_CULT",
"AMBIENT_GANG_SALVA",
"AMBIENT_GANG_WEICHENG",
"AMBIENT_GANG_HILLBILLY",
"DEALER",
"HATES_PLAYER",
--"HEN",
--"WILD_ANIMAL",
--"SHARK",
--"COUGAR",
"NO_RELATIONSHIP",
"SPECIAL",
"MISSION2",
"MISSION3",
"MISSION4",
"MISSION5",
"MISSION6",
"MISSION7",
"MISSION8",
"ARMY",
--"GUARD_DOG",
"AGGRESSIVE_INVESTIGATE",
"MEDIC",
--"CAT",
}

local RELATIONSHIP_HATE = 5
local RELATIONSHIP_COMPANION = 0

Citizen.CreateThread(function()
    while true do
        Wait(50)
		
		if Config.HostileAmbientPeds and Config.HostileAmbientPeds > 0 then 
		   for _, group in ipairs(relationshipTypes) do
				-- not sure about argument order, players don't have AI so only one of these should be needed
				--SetRelationshipBetweenGroups(RELATIONSHIP_HATE, GetHashKey('PLAYER'), GetHashKey(group))
				SetRelationshipBetweenGroups(RELATIONSHIP_HATE, GetHashKey(group), GetHashKey('PLAYER'))
				SetRelationshipBetweenGroups(RELATIONSHIP_COMPANION,  GetHashKey(group), GetHashKey(group))
				
				--try to minimize infighting on the whole: 
				if Config.HostileAmbientPeds == 1 then
					
					SetRelationshipBetweenGroups(RELATIONSHIP_COMPANION,  GetHashKey('CIVMALE'), GetHashKey('CIVFEMALE'))
					SetRelationshipBetweenGroups(RELATIONSHIP_COMPANION,  GetHashKey('CIVFEMALE'), GetHashKey('CIVMALE'))
					SetRelationshipBetweenGroups(RELATIONSHIP_COMPANION,  GetHashKey('CIVMALE'), GetHashKey("HATES_PLAYER"))
					SetRelationshipBetweenGroups(RELATIONSHIP_COMPANION,  GetHashKey('CIVFEMALE'), GetHashKey("HATES_PLAYER"))
					SetRelationshipBetweenGroups(RELATIONSHIP_COMPANION,  GetHashKey('CIVMALE'), GetHashKey('TRUENEUTRAL'))
					SetRelationshipBetweenGroups(RELATIONSHIP_COMPANION,  GetHashKey('CIVFEMALE'), GetHashKey('TRUENEUTRAL'))
				elseif  Config.HostileAmbientPeds == 3 then --riot mode, virtually all ambient peds hate each other.
					SetRelationshipBetweenGroups(RELATIONSHIP_HATE,  GetHashKey('CIVMALE'), GetHashKey('CIVFEMALE'))
					SetRelationshipBetweenGroups(RELATIONSHIP_HATE,  GetHashKey('CIVFEMALE'), GetHashKey('CIVMALE'))
					SetRelationshipBetweenGroups(RELATIONSHIP_HATE,  GetHashKey('CIVMALE'), GetHashKey('CIVMALE'))
					SetRelationshipBetweenGroups(RELATIONSHIP_HATE,  GetHashKey('CIVFEMALE'), GetHashKey('CIVFEMALE'))
					
				end
			end
		end	
	
		
    end
end)
1 Like

This older confg made it work,
I don’t know why, but it works
missions.lua (75.5 KB)

Thanks man, I will check it out

odd, replaced my current one with the one you posted did not work. Doing a difference on the files, I can see why, there is no real difference, besides more missions in my current missions.lua.

Could you also send me the client.lua and server.lua you are using as well please?

Is it possible to remove the money and safehouses and just have the missions? I want to just spawn weapons and vehicles with my friends and go fight npcs and just wanted to know if I can. Also how do I stop it from immedietly starting a mission on spawn and starting missions after one is failed or completed?

Also how do you change the settings to not get instantly one shot by everything

Yes you can spawn weapons and pickups, and turn off safehouses. You can change accuracy of npcs as well. via missions.lua

Here is a guide, there are a lot of settings:

Thanks, is it possible to turn their damage down?

hmmn, not sure. might want to ask on the forums

I have just two more questions, is there an option to keep the money amount on screen at all times that I missed in the config and how do I stop the overlap from the playerlist?

not sure what you mean by overlap in the playerlist?
the money amount show on the screen at all time would require extra code, I believe. It uses gta native money by default, not sure if there is a setting for that in the native functions to show always
Hitting the mobile phone button (up on the d-pad by default) will show player list and total amounts and amounts per mission.

Yeah when I hit up arrow the vanilla fivem one shows up above the crackdown one

Nvm that issue fixed itself somehow!

1 Like

How start for Esx Server?