[SCRIPT] Kick, Ban


#1

I just found the rconlog ressource, it’s not enabled my default so i give you this.

add - rconlog to AutoStartResources

rconlog / Rcon Client / Virus Scan 1 / Virus Scan 2
Commands:

status
To get server information (Id of player, IP of player & Ping)

clientkick
Usage: clientkick [playerId] [reason]
Description: to kick a player from your server

tempbanclient
Usage: tempbanclient [playerId] [reason]
Description: to ban a player from your server

Already included:

map
Usage: map [mapname]
Description: to change map of the server

gametypes
Usage: gametypes [resourcename]
Description: to change gametypes of the server

say
Usage: say [your message]
Description: to send a message from outside

tell
Usage: tell [playerId] [your message]
Description: to send a message to a specific player

start
Usage: start [resourcename]
Description: starts the specified resource

restart
Usage: restart [resourcename]
Description: restarts the specified resource

stop
Usage: stop [resourcename]
Description: stops the specified resource

refresh
Usage: refresh
Description: refresh ressources


Kick/Ban?
Kick someone surport
#2

Thank you for the Rcon Client. Been looking for something like that.

There are also commands for resource control:

start
Usage: start [resourcename]
Description: starts the specified resource

restart
Usage: restart [resourcename]
Description: restarts the specified resource

stop
Usage: stop [resourcename]
Description: stops the specified resource


#3

@MrStiletto i already know and i added refresh.


#4

how do you use the kick and temp ban command?? I tried the way you have above but keep getting error…/.


#5

@LoweDennis_LBP First thing, am the realist.
2.open rconapp(provided on this topic, I use my own but is the same.)
3.type "status"
4.it will show " print (in my case) 1id IP:XXX.xx.XXX.xx username Epps IP:XXX.xx.XXX.xx ping 2ms

  1. To ban type: "tempbanclient id reason(messege) "
  2. Hit “ENTER” OR “RETURN”
  3. Upvote if this helped you.
  4. Have a nice day.

#6

@EPPS I do that but when I type status it only has one persons name in the list and I’ve tried it on that person like you have it type but it doesn’t work still.


#7

hello, i tried the redhawk rcon tool and it worked so i think you have not put the rconlog folder in the resource folder and added it in the config.
make sure you have all the correct information about your server.
please tell me more about the problem. Thanks


#8

@LoweDennis_LBP Use the number that’s an ID.


#9

When I type “status” it only give me one players name not everyone thats joins the server. So when I do the following commands “clientkick” or “tempbanclient” it gives me the following error code http://prntscr.com/bwxr7d . Here are the install places on the server… http://prntscr.com/bwxrk6 http://prntscr.com/bwxru7


#10

Anyone know how to find the file to convert that russian text when a player is kicked or banned? Been looking all over for it


#11

@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.


#12

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”


#13

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


#14

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


#15

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)

#16

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


#17

@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

#18

@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 “/”


#19

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


#20

@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.