Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Nihongo^

#16
Quote from: habi on Aug 13, 2023, 02:41 PMis the source code of it available?

Thank you for the reply,
afaik it one of my friends who gave me this plugin because the current one is not working/not updated
i think it was @KAKAN

P.S maybe it can help i am not sure he shared this link with me i didn't get what is it
https://github.com/kakan-gamerelated/sleepydiscord-squirrel
#17
Quote from: habi on Jul 20, 2023, 11:39 AMWorking fine for me on WSL Ubuntu
I use httprequests04rel64[dot]so from here (0.2.1)
scripts/httptest.nut
request <- ::SqHTTP.GetRequest();
request.setURL("https://proxycheck.io/v2/79.137.85.208?vpn=1&asn=1")
request.setTag("James_Bond");
function HTTP_OnResponse(tag, url, statusCode, response)
{
   // Check if the request was successful
   if (statusCode == 200)
   {
local findProxy = response.find("proxy\": \"yes");

if (findProxy != null)
{
print("-------PROXY DETECTED-------");
print("Name: "+tag);
print("----------------------------");
//To get the player instance
local player = FindPlayer(tag);
if( player && player.Name == tag )
{
MessagePlayer("You are about to be k**ck*d", player);
}else
{
//player /q before the response arrived!
}
} else
{
print(tag+ " is not using a proxy.");
}

}else {
    // Handle HTTP request error
    print("Proxy check request failed with status code " + statusCode);
   } 

}
request.sendGet();

The screenshot is not of Windows but of Linux(Ubuntu.)
There is a tag function for http request. You simply set it as player's name. Then using the tag, find the player.

I recently discovered that the issue causing a "segmentation fault" is related to the Discord plugins and the httprequest04rel64 plugins. When I remove the Discord plugins from my server, the httprequest works perfectly and displays the desired result. However, if I prioritize loading the Discord plugins first, it leads to a segmentation fault during the server loading process. My suspicion is that OpenSSL operates exclusively for either Discord or httprequest at a given time.
#18
Ah damn, i just figure out the data inside the table in "NULL" didn't check
Problem sovled
#19
My temp ban is working perfectly but whenver this guy name "[THC]^CUTE^295" joins the server  it gives an error here

local banType = GetSQLColumnData(q, 9).tostring();

Here's my full checktempban function

function CheckTempBan(player) {
    local q = QuerySQL(db, "SELECT * FROM TempBans WHERE Name='" + escapeSQLString(player.Name) + "' OR IP='" + escapeSQLString(player.IP) + "' OR UID='" + escapeSQLString(player.UniqueID) + "' OR UID2='" + escapeSQLString(player.UniqueID2) + "'");
    if (q) {
        local banType = GetSQLColumnData(q, 9).tostring(); <--- Line 518
                local currentTime = time();
            local banStartTime = GetSQLColumnData(q, 4).tointeger();
            local banDuration = GetSQLColumnData(q, 5).tointeger();
            if (currentTime - banStartTime >= banDuration) {
                QuerySQL(db, "DELETE FROM TempBans WHERE LOWER(Name)='" + player.Name.tolower() + "'");
            } else {
                local timeLeft = banDuration - (currentTime - banStartTime);
                ServerMessage("[#FF0000][PRIOR BAN]: [#FFFFFF] [ " + player.Name + " ] is banned for Reason: [ " + GetSQLColumnData(q, 8) + " ]");
                ServerMessage("[#FF0000][PRIOR BAN]: [#FFFFFF] TimeLeft: [ " + GetBanRemainingTime(GetSQLColumnData(q, 4).tointeger(), GetSQLColumnData(q, 6).tostring()) + " ], Admin: [ " + GetSQLColumnData(q, 7) + " ]");
                EchoMessage("[PRIOR BAN]: [ " + player.Name + " ] is banned for Reason: [ " + GetSQLColumnData(q, 8) + " ] TimeLeft: [ " + GetBanRemainingTime(GetSQLColumnData(q, 4).tointeger(), GetSQLColumnData(q, 6).tostring()) + " ], Admin: [ " + GetSQLColumnData(q, 7) + " ]");
        player.Kick();         
        }
        }
        }
        }

Kindly explain me about "tostring();" is it really necessary ? and what is it ?
Thank you in advance
#20
Quote from: Nihongo^ on Jul 23, 2023, 03:35 PM
Quote from: habi on Jul 23, 2023, 03:09 PMJust to confirm, are the IP of the players same?
Everest is me
but, before 3 players join the server at the same time, and all these players belonged to other locations and then server crashed

i assume that error so i thought i should check it

i joined the server 3 times and then it crashed
hy @habi i am here with my same problem
I thought this matter is solved but its still there. My server crashed when 3/4 players joining the server



function CheckProxy(ipaddr)
{
 local socket=NewSocket("recv");
 local request=format("GET /v2/%s?vpn=1&asn=1&key=%s  HTTP/1.1\r\nHost: proxycheck.io\r\nAccept: */*\r\n\r\n", ipaddr,"3t32l6-477co2-3d0653-2601s0");
 getroottable().rawset(ipaddr+"connF",function(){
 socket.Send(request);
 });
 getroottable().rawset(socket,null);
 socket.SetNewConnFunc(ipaddr+"connF");
 socket.Connect("proxycheck.io", 80);
 NewTimer("DestroySocket",5000,1,socket, ipaddr+"connF");
}
function DestroySocket(sock, fname){
if(sock)
{
 sock.Delete();
 rawdelete(sock);
}
rawdelete(fname);
};
function DestroySocket(sock, fname){
if(sock)sock.Delete();
rawdelete(fname);
};
#21
Isn't players can use it to prevent evading like before the duel they can type /heal, and after losing some hp, take it.
#22
There's a "comma" in the duration bracket

Nick: Time left  [ , 2 Years, 8 Months, 1 Weeks, 1 Days ]

How do I remove it?

ServerMessage("[#FF0000][PRIOR BAN]:[#FFFFFF] [ " + player.Name + " ] is banned for Reason: [ " + GetSQLColumnData(q, 8) + " ] ]");
         ServerMessage("[#FF0000][PRIOR BAN]:[#FFFFFF] TimeLeft: [ " + GetBanRemainingTime(GetSQLColumnData(q, 4).tointeger(), GetSQLColumnData(q, 6).tostring()) + " ], Admin: [ " + GetSQLColumnData(q, 7) + " ]");
function GetBanRemainingTime( bantime,  banratio )
{
  local ban_current = time()-bantime;
  local total_time = "";
  local sp = split(banratio,":");
  local ban_Days = 0, ban_Hours = 0, ban_Minutes = 0;
  local ban_Day = sp[ 0 ].tointeger();
  local ban_Hour = sp[ 1 ].tointeger();
  local ban_Minute = sp[ 2 ].tointeger();
  ban_Days = ban_current/86400;
  ban_current = ban_current%86400;
  ban_Hours = ban_current/3600;
  ban_current = ban_current%3600;
  ban_Minutes = ban_current/60;
  ban_current = ban_current%60;
  ban_Day -= ban_Days;
  ban_Hour -= ban_Hours;
  ban_Minute -= ban_Minutes;
  local mints_to_hour = ban_Minute / 60;
  ban_Minute = ban_Minute - (mints_to_hour * 60);
  ban_Hour += mints_to_hour;
  local hours_to_days = ban_Hour / 24;
  ban_Hour = ban_Hour - (hours_to_days * 24);
  ban_Day += hours_to_days;
  local months = ban_Day / 31;
  ban_Day = ban_Day - (months * 31);
  local weeks = ban_Day / 7;
  ban_Day = ban_Day - (weeks * 7);
  local years = months / 12;
  months = months - (years * 12);
  if(years > 0) total_time += ", "+years+" Years";
  if(months > 0){if(total_time != ""){total_time += ", "+months+" Months";}else{total_time += months+" Months";}}
  if(weeks > 0){if(total_time != ""){total_time += ", "+weeks+" Weeks";}else{total_time += weeks+" Weeks";}}
  if(ban_Day > 0){if(total_time != ""){total_time += ", "+ban_Day+" Days";}else{total_time += ban_Day+" Days";}}
  if(ban_Hour > 0){if(total_time != ""){total_time += ", "+ban_Hour+" Hours";}else{total_time += ban_Hour+" Hours";}}
  if(ban_Minute > 0){if(total_time != ""){total_time += ", "+ban_Minute+" Minutes";}else{total_time += ban_Minute+" Minutes";}}
  return total_time;
}

P.S Its only showing command in "years" other wise no comma in months weeks or day
#23
Quote from: Xmair on Jul 30, 2023, 04:10 PMYou have a typo in your code. It is supposed to be DisconnectSQL, not DiscconectSQL
Thank you so much, it was a typo error

it reloaded the script, but some function not work like when i type /stats it said Kills doesn't exist any suggest ?
#24
Hy, every time I lose my players, whenever I restart my server from the control panel.

So I found this script in the forum, thinking it would help me to reload the script without losing players

But it gives me an error
case "reload":
if (highestRole.GetLevel() < 2) sendMessage(channels["staffchat"], "You do not have permission to use this command.");
else
  {
::onScriptUnload();
::ReloadScripts()
}
Fu error The index Disconnect SQL: does not exist


#25
No no its not about the bracket

server not load when i put this line
CPlayer.__getTable.IsFallen<-function (){ return ::FallenPlayers[this.ID] }
CPlayer.__getTable.TimeFallen<-function (){ return ::TimeFallen[this.ID] }
CPlayer.__setTable.IsFallen<-function (state){ ::FallenPlayers[this.ID]= state;
if(state)::TimeFallen[this.ID]=::GetTickCount();
}



P.S i even tried with the bracket but still the same problem
#26
Thanks for reply, just one thing server run fine in windows but at Linux server not load its not gives any error
but it stop loading after adding this


CPlayer.__getTable.IsFallen<-function (){ return ::FallenPlayers[this.ID] }
CPlayer.__getTable.TimeFallen<-function (){ return ::TimeFallen[this.ID] }
CPlayer.__setTable.IsFallen<-function (state){ ::FallenPlayers[this.ID]= state;
if(state)::TimeFallen[this.ID]=::GetTickCount();
}
#27
Thanks habi, but i have question

why do we put all this funnctions in onScriptLoad?. When we can simple put the timer when player fall

function onScriptLoad(){
CPlayer.__getTable.IsFallen<-function (){ return ::FallenPlayers[this.ID] }
CPlayer.__getTable.TimeFallen<-function (){ return ::TimeFallen[this.ID] }
CPlayer.__setTable.IsFallen<-function (state){ ::FallenPlayers[this.ID]= state;
if(state)::TimeFallen[this.ID]=::GetTickCount();
}
FallenPlayers<-array(GetMaxPlayers(),  false);
TimeFallen<- array(GetTickCount(), 0 );
}
and isn't we can use

FallenPlayers = false; In Playerclass instead of 
FallenPlayers<-array(GetMaxPlayers(),  false);

and i am confused with this
if(GetTickCount() - player.TimeFallen > 4900000)Why do we need gettick count etc when there's a timer

#28
How do i restrict /skin when player fall down (player on ground after getting hit with weapon ) ?

Most of players in my server do evade with /skin <id>. It immediately change the skin and player get up on exact moment

i made this one but it works only for 1 second and after that player can use skin ( it take around 4/5 seconds for the player to get up properly and run )
if (cmd == "skin") {
        if (player.Action == 42) {
            MessagePlayer("You cannot use /skin while on the ground.", player);
            return;
        }
}
#29
Thanks btw I made this.

Quotelocal nickcheck = ( player.Name.len() < 4 ) || IsNum(player.Name)
    if (nickcheck) {
       
        print("nick not allowed");
    }

how do i include symbols players like such nick (```` ;;;; '''' ) joined every time
#30
How do I kick players containing number nicks?
And nicks with weird symbols ( ,,,' ''''' """" )