[C#] RELEASE - Los Santos zombie apocalypse

Hello,
this was an attmpt to recreate one of my most favorite servers of all times on SA:MP - Los Santos zombie apocalypse (https://www.youtube.com/watch?v=1IabjSsNEBU)

Since I have no time and I’m not sure, if it is even possible to make it as I wanted it to be, I release the source code, because I think, that there are many interesting principles and solutions that might help someone else.

Features:

  • Written in C#
  • Includes both server and client scripts
  • Uses mysql database
  • Uses NativeUI for inventory
  • Uses lot of custom UI elements (HTML, CSS, JS/Jquery)

Problems that I’ve encountered

  • I don’t have time
  • Desynchronization of NPC’s (if I’m alone on server, everything is fine, when friend joins, it breaks down)
  • Only one NPC can attack me at the time, which is not wanted in zombie gamemode

Included systems:

  • Time system
  • Weather system (server synchronised)
  • Disabled all population
  • Skin picker system
  • Inventory system (press N)
  • Customised spawn manager
  • Stats system
  • Random vehicle spawning system
  • XP / rank system
  • Flashlight system (shows zombies on minimap)
  • Zombie spawning and behaviour system
  • Vehicle, engine start, fuel and oil system
  • checkpoint (complete 8 checkpoints to finish rounds) system

Hope this will help someone. Repo: https://gitlab.com/Tolgi/lszap

[Edit] It looks like, that this gamemode could actually spin off, so the repo is no longer public. But if you’re interested in anything regarding this post, just shoot me an email tolgicraft@gmail.com

5 Likes

Pretty cool release

Awesome man very very cool

Man I miss SA:MP days :frowning:

Just a heads up from a zombie server owner, careful with how many zombies you spawn as FiveM has a maximum of entities, going over 20 per player if you’ve got around 50 players at a time will result in crashes from their client.

This release looks incredible, from what I read it looks like a very promising start for someone looking to open a zombie server, hope someone takes on this and gets something nice done, I would definitely do if I didn’t have my own already hahah!

As the original creator to that very SA:MP gamemode to see that people still think about it and to pay homage with their own hard work many a years later is pretty darn cool. Thanks bro. What was your in game name?

[Edit] Just watched the video damn bro you have the best quality video I have seen of the last best polished version I had out completely forgot about the reworked car ui stuff I had done. For the hell of it I might as well take a look at what you got done.

Did you ever tackle any of the custom zombie attacks?

Good to see you again Wanted_Tolgi :wink:

Well, I never thought this would happen, greetings my godfather :grinning:

May I just ask real quick, what happened to good old LSZAP?

Yeah in-game nick was _Wanted_Tolgi, I doubt you remember me, I was just a kiddo back then :stuck_out_tongue: but I have some incredible memories from back in the day, for me it was
absolute masterpiece, really. So strong, that I still dream of recreating LSZAP one day. Unfortunatelly FiveM is not suitable IMO, well maybe I was not persistent enough.

Here is video of main problem: https://www.youtube.com/watch?v=tYOOv-tL_Fk

But I’m not giving up yet, I’m just waiting for better platform and I think one is actually coming. s&box

What do you think about it?

Well after just spending 30 or so minutes in the code. Personally I think the issue is stemming from using the client to spawn and handle zombie movements. That works fine for one client but the server should be the master authority of things like that in order to sync amongst many.

[Edit] One other thing I have to criticize…“Zombies are too stupid to use Weapons!” Lol

I can help you run it locally, maybe you could put it to work.
There are few things, that need to be cracked. If theese few things aren’t working, it doesn’t make sense for me to waste time on further development. Theese are:

  • synchronisation - can be seen on video
  • AI programmability - so we can handle all sorts of situations, such as when player is on highground, or BiTE instead of melee attack, or perks such screamer etc.

But I’m affraid that this AI part of FiveM is very limited. But maybe I’m wrong, I’d be more than happy if you proven me wrong!

So let me know, if you’d be interested in trying to achieve theese two things I listed. If we could fix it, I would definitely want to continue development and put time and effort into it :slight_smile:

TBH Been kinda looking a project to get into. Messing around in Unity and Unreal engine is fun but I am no skilled 3d artist. Just in the last few months have I gotten myself in blender and meh. Funny thing is I found this just looking around for a basic boilerplate c# project just to peep the api.

Admittedly I know squat all about FiveM (last played a few years ago when overall sync was still rough) I will have to check on the ped stuff to even see if what I am thinking is going to fix the desync problem.

[Edit] According to this thread I think my solution might be right. Anyone know how to create/manage peds on the server-side?

Looking at the script again I would seriously just try and make zombiemanager just a single server module. Just by a quick guess prob just have to change how you get the nearby player id to the distance checks to the zombie.

[Edit 2] Also if this uses OneSync you might be able to have a StreamIn and StreamOut method/Event which can really reduce overhead again this is just a rough guess documentation is really lacking on the api.

I’m mainly PHP programmer, I have decent knowledge of JS and jQuery, gotten into C# when attempting to recreate LSZAP.

Unfortunatelly, I do not fully understand server/client concept in FiveM, but I guess I understand, what you’re trying to say.

I am quite busy ATM (work and studying at university), but in month or so semester ends, but I’ll try to implement it in a meantime.

Maybe if you’d be interested in this project, I could give it one more try. But I think I’ll need your help, as far as I know, documentation is also quite limited and lot of stuff I was dealing with I could’nt find even on forums. When I created a thread, I got no respose, because the problems I was facing were very very specific and I’m not sure, if anybody encountered them before.

On the other hand, this could be something quite unique. Do you know any servers or gamemodes with heavily customized NPCs?

Cant really say I have but I only tried 2 zombie servers. One which is has been down for some hours now. (still they have a decent base zombie chase script that is syncd so I know it is possible). The other was just a slideshow when I tried to log on and I have a fairly decent pc.

Just read through all the natives. Not sure why we only have a GetActivePlayers and not one for GetStreamedInEntities/GetStreamedInClients that would help to even further reduce the size of the ForEach loops. I only bring this up from the experience of having profiled (albeit a single threaded server) running custom attacks the amount of foreach calls with say 50 players connected can run into the 10,000 to 100,000 a second. This is course is also taking into consideration everywhere in the script ForEach loops are used. It really helps to reduce those down to picoseconds. Prime Example of this is (30 or so) zombies spamming RMB to attack (even with keypress cooldowns), vomited objects littered about (constantly running checks) anti cheats, admin commands etc…

Seriously however I do know This Ain’t SA:MP. So I could just be overthinking a non issue. Tech came a long way in the last 6 years.

Of course I did run the server well before samp got area streaming and it ran fine just ran whole lot better after.

Sorry if this rambled on a bit.

I Guess the way my gears are turning right now I will probably go and take a shot on fixing the sync issues and maybe see if I can override Ped States to add new behaviors.

1 Like

keep me updated sir

For sure, peeked about the FiveM server/client source code and geez I rambled about a whole bunch of nothin but memories.

Will get the server setup tonight and try and break/fix.

OK, so I managed to run it locally again (I totally forgot how it was done lol) and I added some useful info regarding the setup to readme. Let me know if you managed to run that shiet

[Edit] Also added updated CitizenFX.Core.dll files as a reference in Visual studio, so new RPC natives should be available.

Ah should have checked the thread. In other news I been fighting since my last post to sort it all out. Seeing as I have 0 FiveM experience took a while to get going had to start from a fresh template and move things over got stuck on that last hang up of the script.js for the menus (post call referencing project name). All in all I feel a bit better about understanding FiveM’s whole setup. (Also took out the default spawnmanager from the server that was a many hours lost haha)

I also have it updated to the latest artifacts and MySQL Connector/NativeUI.

I have to admit I was smiling wide as sh*t when it was finally working. Really nice job capturing the essence of LSA. (have to admit everyone added the “zombie” to the name) [to me the project was always just Los Santos Apocalypse]

So now I guess we can get to testing I will message my discord.

hey would like to give a hand to revive LSA
please contact me
timurgarbunov@gmail.com

Heyy, check out my post: Los Santos Zombie Apocalypse