Quit fuction?

Hi so trying a command that allows a user to quit and go back to the server list.

I have tried

DropPlayer(source, “Bye”)

but nothing

Client:

RegisterCommand('help', function()
then
TriggerServerEvent("quitserver")
end)

Server:

RegisterServerEvent("quitserver")
AddEventHandler("quitserver", function()
	DropPlayer(source, "Bye")
end)

It should just work fine, see example:

I think it’s due to the fact that you have a then in the RegisterCommand callback, try this:

RegisterCommand('help', function()
    TriggerServerEvent("quitserver")
end)

I’m getting an error with this

RegisterServerEvent("quitserver")
	AddEventHandler('quitserver', function(playerId)
				DropPlayer(playerId, string.format(strings.kicked, GetPlayerName(source))
		end
	end)

Error parsing script server.lua in resource quitserver: server.lua:9: ‘)’ expected (to close ‘(’ at line 8) near ‘end’
it says

Client:

RegisterCommand('help', function()
    TriggerServerEvent("quitserver")
end)

Server:

RegisterServerEvent("quitserver")
AddEventHandler("quitserver", function()
    DropPlayer(source, "Bye")
end)

Try that.

I got it. I’m releasing it. its simple but you know easier for others