Is it possible to have a script change the game type of a server. I noticed that in the fivem resource it has resource_type 'gametype' { name = 'Freeroam' } in it but i’m looking to change that in a script after / as an event is ran. I know some servers do it but I’m unsure how.
Looked trough map manager and found this, but that was about it.
function changeGameType(gameType)
if currentMap and not doesMapSupportGameType(gameType, currentMap) then
StopResource(currentMap)
end
if currentGameType then
StopResource(currentGameType)
end
StartResource(gameType)
end
I’m a little slow so If I use the below it would work?
ddEventHandler('chatMessage', function(player, playerName, message)
if message:sub(1) == '/testcmd' then
if IsPlayerAceAllowed(player, "fax.cmds") then
TriggerClientEvent("chatMessage", -1, "Another Msg to server", {239, 0, 0})
CancelEvent()
SetGameType(TestGametypeForList)
else
TriggerClientEvent("chatMessage", player, "^1Insignificant Permissions to run command.")
end
end
end)
So TestGametypeForList would be displayed on the list
Changing the gametype will restart that resource, meaning it’ll also restart a random compatible map.
You can try using tags instead to display additional information in that screenshot you sent.
Server.cfg:
# a comma-separated list of tags for your server
# for example: sets tags "drifting, cars, racing" or sets tags "roleplay, military, tanks"
sets tags "default"
Tags? never knew they existed. So basically the whole gametype thing is not really possible unless it restarts the map or I do a bunch of re writing / editing.