[Release] Serve/Protect The President

Hey everyone. Today I am releasing this gamemode to you all to enjoy, Some of you may have played it in SAMP under the name Protect the President.

@IceHax and @pongo1231 made a good bit of this code. I was informed of this port by another member of the fivem community and i went ahead and brought it to a (mostly) working state. Within the original licence
that ice and scammer provided with their code (forked on my github)

This release is an alpha release so bear in mind it may have unexpected bugs.

You can feel free to try it out. the code is on my github page:

Ill try to maintain the repo and fix any bugs. please submit those to the issues section of the github repo (keep this post for comments please!)

Keybinds:

F6 : Team Select Menu (not allowed for president and Vice President)

Dependancies:
Requires NativeUI from Frazzle:

TO INSTALL:

Download the gamemode from github,

Drag the folder as well as NativeUI into your servers resources

add the folders to your server.cfg

Start your server.

Additional Credit:

@Vespura for his JoinTrans script Release (i use some modified code from that release in this one to give a better loading asthetic)

SCREENSHOTS:


UPDATE: I’m back around again and should be able to maintain this gamemode keep me posted if you find any issues on the github and ill get to them ASAP!

8 Likes

It looks fun!

How i instal?

I updated the main post with some basic install instructions

I want to see img . :wink: D

This seems really cool! We’ve been looking to do more things with our community (more than just playing cops and robbers) and I think this would be perfect. I’ll test it out and report back with what I find.

Awesome, Glad to see that people are actually interested in this gamemode! haha

1 Like

This is really cool. Gave it a whirl with some friends. Couple issues. When new people join it seems to zoom the arbitrator out and they get stuck in the sky screen. I also got the following error when I died as president and respawned:

Error running system event handling function for resource president: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: @president/server/players.lua:128: attempt to get length of a number value (field 'handle') stack traceback: @president/server/players.lua:128: in upvalue 'handler' citizen:/scripting/lua/scheduler.lua:219: in function <citizen:/scripting/lua/scheduler.lua:218> stack traceback: [C]: in function 'error' citizen:/scripting/lua/scheduler.lua:41: in field 'CreateThreadNow' citizen:/scripting/lua/scheduler.lua:218: in function <citizen:/scripting/lua/scheduler.lua:182> InvokeNative: execution failed: Argument at index 1 was null. Error running system event handling function for resource president: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: Execution of native 000000002f7a49e6 in script host failed. stack traceback: [C]: in upvalue '_in' citizen:/scripting/lua/natives_server.lua:486: in function 'TriggerClientEventInternal' (...tail calls...) @president/server/players.lua:85: in upvalue 'handler' citizen:/scripting/lua/scheduler.lua:219: in function <citizen:/scripting/lua/scheduler.lua:218> stack traceback: [C]: in function 'error' citizen:/scripting/lua/scheduler.lua:41: in field 'CreateThreadNow' citizen:/scripting/lua/scheduler.lua:218: in function <citizen:/scripting/lua/scheduler.lua:182> Error running system event handling function for resource president: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: @president/server/players.lua:128: attempt to get length of a number value (field 'handle') stack traceback: @president/server/players.lua:128: in upvalue 'handler' citizen:/scripting/lua/scheduler.lua:219: in function <citizen:/scripting/lua/scheduler.lua:218> stack traceback: [C]: in function 'error' citizen:/scripting/lua/scheduler.lua:41: in field 'CreateThreadNow' citizen:/scripting/lua/scheduler.lua:218: in function <citizen:/scripting/lua/scheduler.lua:182> InvokeNative: execution failed: Argument at index 1 was null. Error running system event handling function for resource president: citizen:/scripting/lua/scheduler.lua:41: Failed to execute thread: Execution of native 000000002f7a49e6 in script host failed. stack traceback: [C]: in upvalue '_in' citizen:/scripting/lua/natives_server.lua:486: in function 'TriggerClientEventInternal' (...tail calls...) @president/server/players.lua:85: in upvalue 'handler' citizen:/scripting/lua/scheduler.lua:219: in function <citizen:/scripting/lua/scheduler.lua:218> stack traceback: [C]: in function 'error' citizen:/scripting/lua/scheduler.lua:41: in field 'CreateThreadNow' citizen:/scripting/lua/scheduler.lua:218: in function <citizen:/scripting/lua/scheduler.lua:182>

How can i remove the Civilian role?

you would have to remove it from the team files and the dialog

ill have a play with it and see if i can recreate the issue and ill fix it

Thanks, been looking for something like this to host my servers, someone mind sharing steps installing this correctly?

Theres basic instructions in the main post

very cool the gamemode but there are a couple things wrong with it. As soon as i start the server and the first person joins the timer starts, it would be better to have a menu to pause, restart or edit the timer.