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^

#76
Hi, I made some modifications to inserting alias in the database.

I want a new entry whenever the player's IP or UID changes, but I know when the script reads the first entry ( where IP is changed), it kept entering the new try whenever the player joined.

Quotefunction AddAlias(player) {
    local q = QuerySQL(db, "SELECT * FROM Alias WHERE Name='" + player.Name + "'");
    if (!GetSQLColumnData(q, 0)) {
        QuerySQL(db, "INSERT INTO Alias (Name, IP, UID) VALUES ('" + player.Name + "', '" + player.IP + "', '" + player.UniqueID + "')");
    } else {
        local currentIP = GetSQLColumnData(q, 1);
        local currentUID = GetSQLColumnData(q, 2);
       
        if (currentUID != player.UniqueID) {
            QuerySQL(db, "INSERT INTO Alias (Name, IP, UID) VALUES ('" + player.Name + "', '" + player.IP + "', '" + player.UniqueID + "')");
        } else if (currentIP != player.IP) {
            QuerySQL(db, "INSERT INTO Alias (Name, IP, UID) VALUES ('" + player.Name + "', '" + player.IP + "', '" + currentUID + "')");
        }
    }
}


#77
Link not working
#78
Thank you so much xmair for giving me such an amazing idea

just one more thing, how do now i select different columns in a different table of the same person?

Like picking IP from Accounts and picking UID from Alias table

Thank you
#79
Hi, I am trying to make an offline temp ban with some of my stupid ideas in this method, I want IP and UID from the accounts or Aliases copied and pasted into the temp ban colume. Can anybody please help me with the offline ban system for discord ?

else if(cmd == "tempban")
{
if ( GetLevel( player ) < 3 )
{
ErrorMessage("[Server] - [#FFFFFF]You don't have access to use this Command.", player );
return;
}
if(text)
{
local plr = (GetTok(text, " ", 1)), expire = GetTok(text, " ", 2), reason = GetTok( text, " ", 3, NumTok( text, " " ) );
local q = QuerySQL(db, "SELECT * FROM TempBans WHERE Name='"+plr+"'");
if(!q)
{
if(plr)
{
if(expire)
{
if(reason)
{
local ban_expire = split(expire, ":");
if(NumTok(expire, ":") == 3)
{
if(IsNum(ban_expire[0]) && IsNum(ban_expire[1]) && IsNum(ban_expire[2]))
{
local calc = ((ban_expire[ 0 ].tointeger()*24*60*60) + (ban_expire[ 1 ].tointeger()*60*60) + (ban_expire[ 2 ].tointeger()*60));
local ip = QuerySQL(db, "SELECT IP FROM Accounts WHERE Name='" + plr + "'" );
local uid = QuerySQL(db, "SELECT UID FROM Accounts WHERE Name='" + plr + "'" );
local uid2 = QuerySQL(db, "SELECT UID2 FROM Accounts WHERE Name='" + plr + "'" );

QuerySQL( db, "INSERT INTO TempBans( Name, UID, UID2, IP, Time, ExpireTime, TimeExpireRatio, Admin, Reason ) VALUES ('"+plr+"', '"+uid +"', '"+uid+"', '"+ip+"', '"+time()+"', '"+calc+"', '"+expire+"', '"+player.Name+"', '"+reason+"')");

ServerMessage("[#FF0000][PRIOR BAN]: [#FFFFFF]"+plr+" is banned for Reason: "+reason+", TimeLeft: " + GetBanRemainingTime(time().tointeger(), expire.tostring())+", Admin: "+player.Name+"");
}
else ErrorMessage("[#FF0000][ERROR]: You've entered wrong values in the time, make sure you have entered numbers only!",player);
}
else ErrorMessage("[#FF0000][ERROR]: Time Format must be DAYS:HOURS:MINUTES!",player);
}
else ErrorMessage("[#FF0000][ERROR]: You must specify a reason to ban requested player!",player);
}
else ErrorMessage("[#FF0000][ERROR]: Please type the duration of the ban for the requested player!",player);
}
else ErrorMessage("[#FF0000][ERROR]: Unknown player!",player);
}
else ErrorMessage("[#FFFF00]Syntax; /tempban <player/ID> <Days:Hours:Minutes> <Reason>",player);
}
else ErrorMessage("[#FFFF00]Syntax; /tempban <player/ID> <Days:Hours:Minutes> <Reason>",player);
}


#80
Sorry for the late reply; I was on vacation.

Sorry Gito, it's not work

@Peppo
I used Race system. It has, I think, 12/13 pickups do you think I should remove it?
#82
Hi i am using this bank gate system with pickup

https://forum.vc-mp.org/index.php?topic=4261.msg31519#msg31519

The problem is pickup inside disappear it self and there's no way to go outside. How do i fix it ? it was working before but after few moment it disappear

#83
Tutorials / Re: Server.cfg Reader c++
Apr 19, 2023, 05:12 PM
hi habi, may i know what kind of file is it ? and the benefits ?
#84
Quote from: habi on Apr 17, 2023, 02:47 PMThe server does not know anything.  All it knows is some strings coming to it.  When it comes,  that is parsed and sent to all connected clients.
If you want to know if player is speed hacking, use function onPlayerMove and compare distance,  check if player is spawned or server has recently set its position.

Thanks, but can you give some examples who does on playermove measure the player speed ? or hp hacks ?
#86
How do we prevent hackers?

Most people come with HP and Speed hacks, and the servers cannot detect them. So how do we solve this problem? Why did the server does not detect them?
#87
Quote from: Diego^ on Apr 13, 2023, 08:17 PMI advise you to add in onScriptLoad(): RPickup <- null;

And replace: RPickup.Remove();
Per: if ( RPickup ) RPickup.Remove();


Thank you so much its works you solved my problem

#89
Quote from: Diego^ on Apr 12, 2023, 10:06 PMCould you show the function that creates the race?

function startrace()
{
    racestart = true;
    CreateMarker(0, Vector( 10.1409, 963.899, 10.9402 ), 5, RGB(128,0,128), 0 );
    RPickup<-CreatePickup( 382, 0, 1, Vector( -1435.9, -790.299, 14.6437 ), 255, false );
local plr;
      for( local i=0; i <= GetMaxPlayers(); i++ )
  {
  {
      plr = FindPlayer( i );
      if ( ( plr ) && ( status[ plr.ID ].raceplayer ) )
                {
                    plr.IsFrozen = false;
                }
        }
}
}

#90
Quote from: habi on Apr 12, 2023, 03:37 PMThere is some problem in the racing module you are using. I think it is: once a race is cancelled or something, another player cannot start it or so. not remember exactly what it was.
@Sebastian

I just copy racing system from this forum not sure about any module,  RPickup.Remove(); should remove the pickups after racing get cancelled but its gives error