Hey everyone! This amazing yet simple little script can be useful for server management and administration. All this does is reset the server using the FiveM base resources that can be found in cfx-server-data.

Version: 1.1

Requirements:: None

Ace Perm: w.reset

Download: Here

Showcase Video:

5 Likes

In theory you can get the last vehicle a ped was using by changing the false in GetVehiclePedIsIn(player, false) to true according to the docs for that native.

1 Like

Just tested this, seems to not work for me. :thinking:

NVM i figured it, i was only checking if a player was in the car or not, removed that little bit of code and it works like a charm!!

Update Version 1.1

  • Now deletes players last veh
  • Chat notification for both no perms and who issued the reset

Next Update: Configuration to turn stuff off(like msgs in chat and del players last cars)

Seems to be a pretty cool thing. Nice video!

1 Like

On my server the AI peds are despawning after a while. If I use that script to reset the server what do you think, will they respawn?

If the script checks if the ped has despawned, and then spawns it back in then no it will not.

i just tried to add the ace perm and it did not work, maybe i did something wrong?

Done /reset twice doesnt help.Hmm any ideas?

what is the ACE perms for this?

I would like to know this also.

To allow people to use the script.

Yes…

Correct, so you already know ACE perms do!

Is the script fixed?

I just tested it and it works. Spawned 30 cargo planes and it deleted them all

So the ace permission would be
add_principal identifier.steam:XXXX w.reset #
?
@TreyWoods

here is what i have for my server. But yes that should work.

add_ace group.admin w.reset allow

Where do you put that command? Like where in the server.lua?

RegisterCommand(‘reset’, function(source)
local _source = source
local playername = GetPlayerName(_source)
if IsPlayerAceAllowed(source, ‘w.reset’) then
TriggerClientEvent(‘chatMessage’, -1, '^1The server is being reset by ^5 ’ … playername … ‘^1!’)
TriggerClientEvent(‘delcar’, -1)
–^^ This is here to remove the player last vehicle and also here because if it was the last thing on the list it the below functions would TP the player to the spawnpoints which then will not delete the ped is in.
StopResource(“fivem”) – These will remove all vehicles but the players last.
StartResource(“fivem”)
else
TriggerClientEvent(‘chatMessage’, -1, “^1 You are not allowed to do this action!”)
end
end, false)