[RELEASE] kickForRestart

that’s weid to hear, and it should kick all people, so if it does not work, please report it, and I’ll take a look into it.

by the way, thanks to all 86 servers using kickrestart

For some reason he is not kicking everyone.

From 35 ppl only 10 was kicked and two days ago from 80 ppls was like 30ppls kicked seems like kick 10% or 20% of totalplayer online…

alright, thanks for reporting, I will fix this as soon as possible.

After the second restart, i cannot log in.

When i am login, the server is kicking me always, it’s been more than ten minutes and server is still kicking me.

oh my, ok I’ll check again
@ItsTaras thank you again! it is finally fixed, I hope I do not mess up something again :sweat_smile:
I shouldn’t rush so much with releasing updates :sweat_smile:

have a nice day :smile:

hi man, i’m new in this world and i need your script but i really can set myself the permission to exec that command. i must be doing something wrong… i want the group superadmin to be able to exec the command. i even have to ask you how to kick everyone from console, because i need it more actually. thanks!

so, to setup the permissions to use the restart command, do the following:

paste this into your server.cfg to the very top:
add_ace group.restart restart.cmds allow ##this group is able to use the /beginrestart command.

and under it you will need this:
add_principal identifier.steam:HEXID group.restart ##this will give a specified person permissions to the restart group.

if you do not know how to find out your steam id, I’ll help you out:

go to your steam profile and copy the url of it.
you should have something like this:
https://steamcommunity.com/profiles/12345678901234/
or something like this:
https://steamcommunity.com/id/nameofprofile/

so if you got the second one head to:
https://steamid.io/
and paste the link into input and press on lookup.
you will see a steamID64, copy it and head to the next step.

if you have a /profiles/number link or you have done the last step with steamid.io then do the following:

head to https://www.binaryhexconverter.com/decimal-to-hex-converter and paste the number of the url next to profiles/number or paste the number you got from steamid.io into it.
Press on convert and you should have on the right side a hex id, this can be used now like this:

add_principal identifier.steam:110000000abc group.restart

to the kick from console part, my resource does not allow to kick from console already, and as I think you’ll probably use the old resource? Then you will need to setup it with es_admin or somethink like this to get the perms to start the resource ingame. Anyway, it is a think for me to code a resource to allow banning and kicking from the console and much more, I haven’t released it, but maybe I release it soon.

have a nice day.

Oh my god man! I’m in love with your script and i really needed it!! Thank you for the quick answer and the good explanation. Now it works!! I hope to see some other scripts from you! tschüs!!

if you want to add the locale in italian, i send it below.

–Locales: Italiano
if lang == ‘it’ then
kick_message = “Tutte le azioni RP sono state interrotte. I tuoi progressi sono stati salvati. Motivo: Riavvio server.”
kick_message_before_join = “Il server si sta riavviando! Riprova più tardi.”
permissions = “^3SYSTEM: ^1Non hai i permessi!”
have_permissions = “^3SYSTEM: ^2Hai i permessi!”
norestart_planned = “Non ci sono riavvii pianificati!”
stopped_restart = “Hai annullato il riavvio.”
planned_at = "Hai pianificato un riavvio alle "
curr_time = " l’ora attuale è: "
planned_at_2 = "Riavvio pianificato alle "
stopp_rp = “finite tutte le azioni RP in tempo!”
no_past_restart = “^1Non puoi fare un riavvio nel passato!”
end

Make a PR to the repository on GitHub.

Done, thank you! (20 chars)

@Real-hamburger, you have got the wrong repo link in the topic seemingly. You might wanna fix that.

Update

added Italiano locales, thanks to @Vismaa

new repo link: https://github.com/Real-RP/kick_restart

1 Like

I have tried it again, with 70 ppl, droped only 50.

and u have to fix lane 72 u have an misstake

Change the Line to this: --Language: Italiano
IT will fix that problem :slight_smile:

2 suggestions:

  1. 15, 10, 5, 1 mins before planned restart giving those alerts: in 15|10|5|1 minutes the server would be restart…
  2. When everybody is kicked restart the FiveM server after it. (I saw something like os.excecute(“restart.bat”) so I hope it will work soon)

Can’t wait!

Why do I get a timer in the terminal when I add the resource?

You would have needed to set debug.time bool to false in server.lua.

I’ve setted this boolean to false as a standard now.

Im kind of stupid, is there a command I can add to the “command” area in zap hosting’s auto restart? I tried putting: “kickall”, “/kickall”, “-kickall”, “_kickall”. So far, nothing works, it just says “No such command”

EDIT: now when I use the command, I get this error:

e[6Ge[Je[0;1;35mde[0;1;30morestarte[7Ge[6Ge[Je[0;1;35mdoe[0;1;30mrestarte[8Ge[6Ge[Je[0;1;35mdore[0;1;30mestarte[9Ge[6Ge[Je[0;1;35mdoree[0;1;30mstarte[10Ge[6Ge[Je[0;1;35mdorese[0;1;30mtarte[11Ge[6Ge[Je[0;1;35mdoreste[0;1;30marte[12Ge[6Ge[Je[0;1;35mdorestae[0;1;30mrte[13Ge[6Ge[Je[0;1;35mdorestare[0;1;30mte[14Ge[6Ge[Je[0;1;35mdorestarte[15Ge[6Ge[Je[0;1;35mdorestarte[15G
InvokeNative: execution failed: Argument at index 0 was null.
SCRIPT ERROR: Execution of native 00000000dedae23d in script host failed.

ref (@kick_restart/server.lua:119)

image

I hate it when scripts start with this notice.
It just discourages people from attempting to learn to code.