[SCRIPT] Kick, Ban

@LoweDennis_LBP lol, nice blocking of ip. anyways you have to put the id not the ip to ban the client.
And no i have not found how to change the Russian text for the msg. when kicked.

okay the group of members on my server have discovered how to kick people but how do you know what number everyone that joins the server are because it only has one number when you type “status”

@LoweDennis_LBP wondering same thing, and still looking into finding the russian text.

The source is the id if your scripting in Lua. That a way if getting player id’s

I’ve made a command in-game to get who’s online. It return the name and id of the player.

This will help you.

--client.lua

--Online Players
    RegisterNetEvent("onlinePlayers")
    AddEventHandler('onlinePlayers', function()
        for i = 0, 31 do
            local nome = GetPlayerName(i)
            local id = GetPlayerServerId(i)
            if (nome == "**Invalid**") then
                CancelEvent()
            else
                ShowNotification('~r~ID: ~g~'.. id .. ' ~w~- ~r~Nome: ~g~' .. nome)
            end
        end
    end)
--server.lua

--Lista Players
        elseif(command[1] == "/players") then
          TriggerClientEvent("onlinePlayers", source)

when i type it in the chat it just puts it as a message to everyone

@cody196 said in [SCRIPT] Kick, Ban...:

when i type it in the chat it just puts it as a message to everyone

Sorry! I forgot something! Put this function on client.lua

function ShowNotification(text)
    SetNotificationTextEntry("STRING")
    AddTextComponentString(text)
    DrawNotification(false, false)
end

@cody196 said in [SCRIPT] Kick, Ban...:

when i type it in the chat it just puts it as a message to everyone

And you need to make the resource “chat” recognize commands with “/”

@PsymoN when i did that in the basic scripting guide, when I press T it does nothing but freeze my player and bugs out.

@cody196 said in [SCRIPT] Kick, Ban...:

@PsymoN when i did that in the basic scripting guide, when I press T it does nothing but freeze my player and bugs out.

It works here. I’ve followed the Basic Scripting Guide too. Just make sure you’ve replaced the correct line.

Should it look like this? cause now the commsand still dont work and chat box is different

alt text

Also getting Error in ScriptEnvironment: Current block is closed before end of file

@cody196 said in [SCRIPT] Kick, Ban...:

Should it look like this? cause now the commsand still dont work and chat box is different

You kinda broke the chat.

@kanersps could you help me out with the whole command thing. or just send me your chat_client.lua.

Links down?

@LapizTJ yea it is

give it another rcon client? I dont want to restart my Server all time -.-

Is there any reason why the downloads don’t work?

@Pascal_Vegas you dont have to except when you make a new command and it really does help to restart the server at least once a day

@Luke192 the server and the client downloads do work