Add banned IP check on connect

This commit is contained in:
Vortrex
2020-12-23 23:02:33 -06:00
parent 82f4b9403f
commit 8b14ccce57

View File

@@ -20,7 +20,11 @@ function initEventScript() {
// ---------------------------------------------------------------------------
addEventHandler("OnPlayerConnect", function(event, ipAddress, port) {
console.log(`[Asshat.Event] Client connecting (IP: ${ipAddress}, Port: ${port})`);
console.log(`[Asshat.Event] Client connecting (IP: ${ipAddress})`);
if(isIpAddressBanned(ipAddress)) {
messageClientError(client, "You are banned from this server!");
return false;
}
});
// ---------------------------------------------------------------------------
@@ -66,13 +70,25 @@ addEventHandler("onPlayerChat", function(event, client, messageText) {
// ---------------------------------------------------------------------------
addEventHandler("OnPedExitVehicle", function(event, ped, vehicle) {
if(!vehicle || vehicle.owner != -1) {
return false;
}
//if(!vehicle || vehicle.owner != -1) {
// return false;
//}
if(!getVehicleData(vehicle)) {
return false;
}
//if(!getVehicleData(vehicle)) {
// return false;
//}
});
// ---------------------------------------------------------------------------
addEventHandler("OnPedEnterVehicle", function(event, ped, vehicle, seat) {
//if(!vehicle || vehicle.owner != -1) {
// return false;
//}
//if(!getVehicleData(vehicle)) {
// return false;
//}
});
// ---------------------------------------------------------------------------