time

Started by Cool, Feb 12, 2016, 12:01 PM

Previous topic - Next topic

KAKAN

Quote from: Hercules on Feb 12, 2016, 06:17 PMbro same result :D
What's the result? And tell me what parameter you pass in TimeRem
Like: TimeRem( 0, "1:2:3" );
oh no

FarisDon

Quote from: KAKAN on Feb 12, 2016, 05:06 PMShow me the TimeRem functions.
Anyways, give this a try:-
( time() - bantime )You know what to replace :)
Kakan, either you Subtract Time from Bantime, or Bantime, from time results will be the same, just the signs will be different....
and, as, for you, Hercules, why don't you just show us the function :| by Function I mean the Command, by which you ban the player, Temp Ban or whatever it is called.
I'm really confused that what parameters or things you are really sending, Tell me few things.
1.What is the format of your cmd(Plus show the Cmd)
Eg : - /ban Anybody(Player) Bla(Reason).
2. Show the picture of your Ban list in the Database, plus the command, for God sake.

Cool

like this your ban will be expire in 00days 00hours 00mints 23secs
and i in banned for 10mint and thats 23 secs shows how much time spend on his ban

KAKAN

Quote from: Hercules on Feb 12, 2016, 06:25 PMlike this your ban will be expire in 00days 00hours 00mints 23secs
and i in banned for 10mint and thats 23 secs shows how much time spend on his ban

Quote from: KAKAN on Feb 12, 2016, 06:19 PMWhat's the result? And tell me what parameter you pass in TimeRem
Like: TimeRem( 0, "1:2:3" );
Did you read my reply? Tell me the answer.
oh no

Cool

if ( cmd == "tempban" )
     {
      local txt_Split;
           if( !text ) MessagePlayer("[RBAN] /tempban <player> <day:hour:min> <reason>", player);
          else
          {
                if( NumTok( text, " " ) == 2 )
{
     txt_Split = split( text, " " );
local plr = FindPlayer( txt_Split[ 0 ] ), expire = txt_Split[ 1 ];
if( plr ) AddBan( player, plr, expire );
else MessagePlayer("[RBAN] No such player.", player );
}
else if( NumTok( text, " " ) >= 3 )
         {
                                           txt_Split = split( text, " " );
                                           local plr = FindPlayer( txt_Split[ 0 ] ), expire = txt_Split[ 1 ], reason = GetTok( text, " ", 3, NumTok( text, " " ) );
if( plr ) AddBan( player, plr, expire, reason );
else MessagePlayer("[RBAN] No such player.", player );
}
else MessagePlayer("[RBAN] /c tempban <player> <day:hour:min> <reason>", player);
  }
     }
else if( cmd == "untempban" )
{
if( !text ) MessagePlayer("[RBAN] /c untempban <Fullname>", player);
else if( !IsBanned( text ) ) MessagePlayer("[RBAN]Player is not banned.", player);
else
{
        QuerySQL( sqliteDB, "DELETE TABLE FROM Banned WHERE ban_nick='" + text + "' COLLATE NOCASE" );
Message("Unbanned: [ " + text + " ] by Admin: [ " + player.Name + " ]" );
}
}

KAKAN

There's no TimeRem function used here lol.
SHOW ME TIMEREM's FUNCTION PARAMETER!
oh no

Cool

CoMMands are posted already and this is full system i didnt use anything else without this and i use only a timer nothing else what you want to check you can check
function Banned( p )
{
local player = FindPlayer(p);
if(player)
{
local query = QuerySQL( sqliteDB, "SELECT * FROM Banned WHERE ban_nick='" + player + "' COLLATE NOCASE" ), IP = player.IP.tostring();
   if( GetSQLColumnData( query, 0 )  )
   {
         if( ( time() - GetSQLColumnData( query, 2 ).tointeger() ) >= GetSQLColumnData( query, 3 ).tointeger() )
   {
       local query2 = QuerySQL( sqliteDB, "DELETE FROM Banned WHERE ban_nick='" + player.Name.tostring() + "'" );
    FreeSQLQuery( query2 );
       MessagePlayer("[RBAN] Your ban has been expired.", player );
    MessagePlayer("[RBAN] Stick to the rules or you will get permanently banned.", player );
   }
   else
   {
        local Time_Left = TimeRem( GetSQLColumnData( query, 2 ).tointeger(), GetSQLColumnData( query, 4 ) );
        //local splitban = split(  GetSQLColumnData( query, 4 ), ":"  ), Calc = splitban[ 0 ] + " Day(s), " + splitban[ 1 ] + " Hour(s), " + splitban[ 2 ] + " Minute(s).";
        MessagePlayer("[RBAN] Your ban has not expired.", player );
     MessagePlayer("[RBAN] Your ban is set to expire in. " + Time_Left, player );
     KickPlayer( player );
   }
}
}
}
//Check is player is banned.
function IsBanned( fullname )
{
      local query = QuerySQL( sqliteDB, "SELECT ban_ip FROM Banned WHERE ban_nick='" + fullname + "' COLLATE NOCASE" );
   if( GetSQLColumnData( query, 2 )  ) return true;
   return false;
   KickPlayer( player );
}


function Banned( p )
{
local player = FindPlayer(p);
if(player)
{
local query = QuerySQL( sqliteDB, "SELECT * FROM Banned WHERE ban_nick='" + player + "' COLLATE NOCASE" ), IP = player.IP.tostring();
   if( GetSQLColumnData( query, 0 )  )
   {
         if( ( time() - GetSQLColumnData( query, 2 ).tointeger() ) >= GetSQLColumnData( query, 3 ).tointeger() )
   {
       local query2 = QuerySQL( sqliteDB, "DELETE FROM Banned WHERE ban_nick='" + player.Name.tostring() + "'" );
    FreeSQLQuery( query2 );
       MessagePlayer("[RBAN] Your ban has been expired.", player );
    MessagePlayer("[RBAN] Stick to the rules or you will get permanently banned.", player );
   }
   else
   {
        local Time_Left = TimeRem( GetSQLColumnData( query, 2 ).tointeger(), GetSQLColumnData( query, 4 ) );
        //local splitban = split(  GetSQLColumnData( query, 4 ), ":"  ), Calc = splitban[ 0 ] + " Day(s), " + splitban[ 1 ] + " Hour(s), " + splitban[ 2 ] + " Minute(s).";
        MessagePlayer("[RBAN] Your ban has not expired.", player );
     MessagePlayer("[RBAN] Your ban is set to expire in. " + Time_Left, player );
     KickPlayer( player );
   }
}
}
}
//Check is player is banned.
function IsBanned( fullname )
{
      local query = QuerySQL( sqliteDB, "SELECT ban_ip FROM Banned WHERE ban_nick='" + fullname + "' COLLATE NOCASE" );
  if( GetSQLColumnData( query, 2 )  ) return true;
  return false;
  KickPlayer( player );
}

FarisDon

Quote from: KAKAN on Feb 12, 2016, 06:28 PMThere's no TimeRem function used here lol.
SHOW ME TIMEREM's FUNCTION PARAMETER!
Dude, Hercules -.- i'll simply say one thing.
In which, Command are you using TIMEREM'S function :'(
Show us that dude.
else if ( cmd =="usingleakedtempban")
{
local noob = FindPlayer(player)
{
if ( noob )
{
(bla )
{
Temprem(bla,bla)//the BlA BLA is called parameters! -,- i can't explain you really like, but you can say that.
}
else ClientMessage(" ALREADY SAID MAKE YOUR OWN SCRIPT FROM SCRATCH! don't just copy like noobs, and then me :O at the times like this.",noob,255,255,0);
}
else ClientMessage(":( Sorry he isn't here; copying other snippets",noob,255,255,0);
}

Cool

llol its not a leaked tempban its a released

KAKAN

Just saw that you are using this script.
How do you expect it to work without the necessary editing?
You need to do some editing.
local Time_Left = TimeRem( GetSQLColumnData( query, 3 ).tointeger(), GetSQLColumnData( query, 4 ) );Use this, don't ask me where and use the TimeRem function I gave above
oh no

FarisDon

Quote from: Hercules on Feb 12, 2016, 06:34 PMCoMMands are posted already and this is full system i didnt use anything else without this and i use only a timer nothing else what you want to check you can check
function Banned( p )
{
local player = FindPlayer(p);
if(player)
{
local query = QuerySQL( sqliteDB, "SELECT * FROM Banned WHERE ban_nick='" + player + "' COLLATE NOCASE" ), IP = player.IP.tostring();
   if( GetSQLColumnData( query, 0 )  )
   {
         if( ( time() - GetSQLColumnData( query, 2 ).tointeger() ) >= GetSQLColumnData( query, 3 ).tointeger() )
   {
       local query2 = QuerySQL( sqliteDB, "DELETE FROM Banned WHERE ban_nick='" + player.Name.tostring() + "'" );
    FreeSQLQuery( query2 );
       MessagePlayer("[RBAN] Your ban has been expired.", player );
    MessagePlayer("[RBAN] Stick to the rules or you will get permanently banned.", player );
   }
   else
   {
        local Time_Left = TimeRem( GetSQLColumnData( query, 2 ).tointeger(), GetSQLColumnData( query, 4 ) );
        //local splitban = split(  GetSQLColumnData( query, 4 ), ":"  ), Calc = splitban[ 0 ] + " Day(s), " + splitban[ 1 ] + " Hour(s), " + splitban[ 2 ] + " Minute(s).";
        MessagePlayer("[RBAN] Your ban has not expired.", player );
     MessagePlayer("[RBAN] Your ban is set to expire in. " + Time_Left, player );
     KickPlayer( player );
   }
}
}
}
//Check is player is banned.
function IsBanned( fullname )
{
      local query = QuerySQL( sqliteDB, "SELECT ban_ip FROM Banned WHERE ban_nick='" + fullname + "' COLLATE NOCASE" );
   if( GetSQLColumnData( query, 2 )  ) return true;
   return false;
   KickPlayer( player );
}


function Banned( p )
{
local player = FindPlayer(p);
if(player)
{
local query = QuerySQL( sqliteDB, "SELECT * FROM Banned WHERE ban_nick='" + player + "' COLLATE NOCASE" ), IP = player.IP.tostring();
   if( GetSQLColumnData( query, 0 )  )
   {
         if( ( time() - GetSQLColumnData( query, 2 ).tointeger() ) >= GetSQLColumnData( query, 3 ).tointeger() )
   {
       local query2 = QuerySQL( sqliteDB, "DELETE FROM Banned WHERE ban_nick='" + player.Name.tostring() + "'" );
    FreeSQLQuery( query2 );
       MessagePlayer("[RBAN] Your ban has been expired.", player );
    MessagePlayer("[RBAN] Stick to the rules or you will get permanently banned.", player );
   }
   else
   {
        local Time_Left = TimeRem( GetSQLColumnData( query, 2 ).tointeger(), GetSQLColumnData( query, 4 ) );
        //local splitban = split(  GetSQLColumnData( query, 4 ), ":"  ), Calc = splitban[ 0 ] + " Day(s), " + splitban[ 1 ] + " Hour(s), " + splitban[ 2 ] + " Minute(s).";
        MessagePlayer("[RBAN] Your ban has not expired.", player );
     MessagePlayer("[RBAN] Your ban is set to expire in. " + Time_Left, player );
     KickPlayer( player );
   }
}
}
}
//Check is player is banned.
function IsBanned( fullname )
{
      local query = QuerySQL( sqliteDB, "SELECT ban_ip FROM Banned WHERE ban_nick='" + fullname + "' COLLATE NOCASE" );
  if( GetSQLColumnData( query, 2 )  ) return true;
  return false;
  KickPlayer( player );
}
Yr Hercules agar Urdu/Hindi Samjh mai ati hai to mera bhai, jo Command use kar reha hoo, mean ke jis Command sai tumha pata chal reha hai ki kitna days hain wo post karo, Or database ke ban list ko photo bhi do.(Dude, Hercules if you can understand Urdu/Hindi, so I basically mean the Command from which you are getting/knowing that how many days are left, please kindly post that, and kindly give Database Banlist photo as well.)

Cool

i am not to much noob KAKAN DUDE dont be angry

Cool

bhai destroyer ye jab banned player join karta hai na us ko message jata hai k itne din reh gaye unban k liye

FarisDon

#28
Quote from: Hercules on Feb 12, 2016, 06:41 PMbhai destroyer ye jab banned player join karta hai na us ko message jata hai k itne din reh gaye unban k liye
So, I actually mean that show the join function where it is actually being used, and that's it.( To mai yahi keha reha hoo ki join function mai agar use hota hai to ye dehkao, bas)
P.S : - anyway guess when you will go through with Kakan's function it is surely gonna work. .-. if he is really, so damn confident in it.( wese I guess uski koi zarorat nhi hai cause Kakan ka function zaror work karega, or wese bhi wo bohat confident hai)

Cool

that is used in functions of banned (p) i already posted bhai aur is function ko call timer karti hai  ab samjy timer on player join me hai