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 - :P

#46
error end of statment expected if or ;
#47
thanks kusnangi its great idea
can you give me idea how to create logout cmds and function
#48
if a player failed login and hes kicked but why player stats reseted  kills deaths money bank
function AccInfo( player )
{
      try{
  EchoMessage( ICOL_ORANGE + "** [" + player.ID + "] " + player.Name + " Joined the Server." );
  if ( CheckBan( player ) == 1 ) Kick( player, "Server", "Banned From Server" );
  status[ player.ID ] = PlayerStats();
  local id = player.ID;
  local ip = player.IP;
  if ( GetLevel( player ) > 0 )
  {
      if ( ip != GetIP( player ) )
  {
      ePrivMessage( "Welcome to the Server " + player.Name + "!", player );
  ePrivMessage( "You're not Logged-In. Please login by /login <password>", player );
  status[ player.ID ].IsReg = true;
  status[ player.ID ].IsLogged = false;
  }
  else if ( ip == GetIP( player ) )
  {
       local q = QuerySQL( db, "SELECT * FROM Account WHERE Name='" + player.Name.tolower() + "'" );
   if ( GetSQLColumnData( q, 0 ) != null )
              {
   status[ player.ID ].Kills = GetSQLColumnData( q, 4 );
   status[ player.ID ].Deaths = GetSQLColumnData( q, 5 );
   status[ player.ID ].Cash = GetSQLColumnData( q, 6 );
   status[ player.ID ].Bank = GetSQLColumnData( q, 7 );
   status[ player.ID ].Level = GetSQLColumnData( q, 2 );
   }
   FreeSQLQuery( q );
   ePrivMessage( "Welcome to the Server " + player.Name + "!", player );
   ePrivMessage( "You've auto-logged in onto the server!", player );
   status[ player.ID ].IsReg = true;
   status[ player.ID ].IsLogged = true;
   EchoMessage( ICOL_BROWN + ">> " + player.Name + " Auto-Logged In." );
   
  }
 
  }
  else
  {
      ePrivMessage( "Welcome to the Server " + player.Name + "!", player );
  ePrivMessage( "You're not registered with us. Register by /register <password>", player );   
  }
  WriteIniString( "Files/ServData.ini", "IP", player.Name, player.IP );
  }
  catch(e) print( "AccInfo Error: " + e );
}
OnPlAyerspawn
function onPlayerSpawn( player )
{
    Message( ">> " + player.Name + " has spawned." );
if ( ( status[ player.ID ].IsReg == true ) && ( status[ player.ID ].IsLogged == false ) )
{
    Announce( "/Login", player );
    ePrivMessage("Login First To Access Services",player);
player.Kick();

}
if ( status[ player.ID ].IsReg == false )
    {
    Announce( "/ register", player );
    ePrivMessage("Register First To Access Services",player);
    player.Kick();
}
if ( ( status[ player.ID ].IsReg ) && ( status[ player.ID ].IsLogged ) )
    {
    player.Cash = status[ player.ID ].Cash;
    }  
}
#49
thanks mashreq my all stats works fine and for is reg error i change kick  to player.kick(): and works
#50
Thanks @thijn
#51
zend2.com not works
#52
how to add custom vehicles in my server i do search and i got ne.crystal video but its on youtube and youtube banded in pakistan
#53
when i am not logged in and i spawn getting console error  Isreg does not exists
error line if ( status[ player.ID ].IsReg == false )and classed i added
function onPlayerSpawn( player )
{
    Message( ">> " + player.Name + " has spawned." );
if ( ( status[ player.ID ].IsReg == true ) && ( status[ player.ID ].IsLogged == false ) )
{
    Kick( player, "Server", "Failed To Login!" );
}
if ( status[ player.ID ].IsReg == false )
    {
    Announce( "/c register", player );
    ePrivMessage("Register First To Access Services",player);
    cKick(player);
}
if ( ( status[ player.ID ].IsReg ) && ( status[ player.ID ].IsLogged ) )
    {
    player.Cash = status[ player.ID ].Cash;
    }  
}
#54
server.ini will corrupted if i remove getsqlrow
#55
now stats are saving but money and bank restarts after server money and bank reseted
Accinfo
function AccInfo( player )
{
      try{
  EchoMessage( ICOL_ORANGE + "** [" + player.ID + "] " + player.Name + " Joined the Server." );
  if ( CheckBan( player ) == 1 ) Kick( player, "Server", "Banned From Server" );
  status[ player.ID ] = PlayerStats();
  local id = player.ID;
  local ip = player.IP;
  if ( GetLevel( player ) > 0 )
  {
      if ( ip != GetIP( player ) )
  {
      ePrivMessage( "Welcome to the Server " + player.Name + "!", player );
  ePrivMessage( "You're not Logged-In. Please login by /login <password>", player );
  status[ player.ID ].IsReg = true;
  status[ player.ID ].IsLogged = false;
  }
  else if ( ip == GetIP( player ) )
  {
       local q = QuerySQL( db, "SELECT * FROM Account WHERE Name='" + player.Name.tolower() + "'" );
   if ( GetSQLColumnData( q, 0 ) != null )
              {
   status[ player.ID ].Kills = GetSQLColumnData( q, 4 );
   status[ player.ID ].Deaths = GetSQLColumnData( q, 5 );
   status[ player.ID ].Cash = GetSQLColumnData( q, 6 );
   status[ player.ID ].Bank = GetSQLColumnData( q, 7 );
   status[ player.ID ].Level = GetSQLColumnData( q, 2 );
   }
   GetSQLNextRow( q );
   ePrivMessage( "Welcome to the Server " + player.Name + "!", player );
   ePrivMessage( "You've auto-logged in onto the server!", player );
   status[ player.ID ].IsReg = true;
   status[ player.ID ].IsLogged = true;
   EchoMessage( ICOL_BROWN + ">> " + player.Name + " Auto-Logged In." );
   
  }
 
  }
  else
  {
      ePrivMessage( "Welcome to the Server " + player.Name + "!", player );
  ePrivMessage( "You're not registered with us. Register by /register <password>", player );   
  }
  WriteIniString( "Files/ServData.ini", "IP", player.Name, player.IP );
  }
  catch(e) print( "AccInfo Error: " + e );
}
#56
my stats not saving when i restart server my stats are go back to 0 why and not saving in db i checked db is 0 no fault in cmds i give you all things about stats getstats execstats login register ect.. no console error
function GetStats( p )
{
       try{
   local stats = null;
   if ( status[ p.ID ].IsReg == true )
   {
   local id = p.ID;
   local kills = status[ id ].Kills, deaths = status[ id ].Deaths;
   if ( ( kills > 0 ) && ( deaths > 0 ) )
   {
       local ratio = format( "%.2f", kills.tofloat() / deaths.tofloat() );
   stats = "Kills: " + kills + ", Deaths: " + deaths + ", Ratio: " + ratio + ".";
   }
   else
   {
       stats = "Kills: " + status[id].Kills + ", Deaths: " + status[id].Deaths + ".";
   }
   }
   else
   {
       stats = "This Nick-Name is not registered!";
   }
   return stats;
   }
   catch(e) print( "GetStats Error: " + e );
}


function ExecStats()
{
        local id, q;
    for(local i = 0; i < GetMaxPlayers(); i++)
    {
        local plr = FindPlayer( i ),q;
    if ( plr )
    {
id = plr.ID
    q = QuerySQL( db, "UPDATE Account SET Kills='" + status[ id ].Kills + "', Deaths='" + status[ id ].Deaths + "', Cash='" + status[ id ].Cash + "', Bank='" + status[ id ].Bank + "' WHERE Name='" + plr.Name.tolower() + "'" );
FreeSQLQuery( q );
    }
}
}

function Login( player, pass )
{
       local q = QuerySQL( db, "SELECT * FROM Account WHERE Name='" + player.Name + "'" );
   if ( GetSQLColumnData( q, 0 ) != null )
              {
   status[ player.ID ].Kills = GetSQLColumnData( q, 4 );
   status[ player.ID ].Deaths = GetSQLColumnData( q, 5 );
   status[ player.ID ].Cash = GetSQLColumnData( q, 6 );
   status[ player.ID ].Bank = GetSQLColumnData( q, 7 );
   }
   GetSQLNextRow( q );
               MessagePlayer( GREEN+">> You've Successfully Logged-In!", player );
       MessagePlayer(YELLOW+">> Name : [ " + player.Name + " ]"+GREEN+"  Level : [ " + GetLevel(player) + " ] State : [ " + GetLevelTag(player) + ""+GREEN+" ]",player);
       status[ player.ID ].IsLogged = true;
   QuerySQL(db, "UPDATE Account SET IP='" + player.IP + "' WHERE Name='" + player.Name + "'");
       Message(GREEN+"--> [ "+ player.Name + " ] Logged-In Successfully." );
       FreeSQLQuery( q );
}

function Register( player, pass )
{
     try{
local password = e(pass);
QuerySQL( db, "REPLACE INTO Account ( Name, IP, Level, Pass, Kills, Deaths, Cash, Bank ) VALUES ( '" + player.Name.tolower() + "', '" + player.IP + "', 1, '" + password + "', 0, 0, 0, 0 )" );
QuerySQL( db, "REPLACE INTO Bstats ( Name, User, Body, Torso, LeftArm, RightArm, LeftLeg, RightLeg, Head ) VALUES ( '" + player.Name.tolower() + "', '" + player.Name + "', 0, 0, 0, 0, 0, 0, 0 )" );
     QuerySQL( db, "REPLACE INTO Wstats ( Name, User, Fist, BrassKnuckle, ScrewDriver, GolfClub, NightStick, Knife, BaseballBat, Hammer, Cleaver, Machete, Katana, Chainsaw, Grenade, RemoteGrenade, TearGas, Molotov, Missile, Colt45, Python, Shotgun, Spaz , Stubby, Tec9, Uzi, Ingrams, MP5, M4, Ruger, SniperRifle, LaserScope, RocketLauncher, FlameThrower, M60 ) VALUES ( '" + player.Name.tolower() + "', '" + player.Name + "', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 )" );
player.Cash = 2000;
status[ player.ID ].IsLogged = true;
status[ player.ID ].IsReg = true;
ePrivMessage( "You've Registered!", player );
ePrivMessage( "Nick:[ " + player.Name + " ] Password:[ " + pass + " ]", player );
EMessage( ">> " + player.Name + " is a Registered Nick-Name Now!" );
}
catch(e) print( "Reg Function Error: " + e );

}
function SaveStats( player )
{
       try{
   local id = player.ID;
   if ( status[ id ].IsReg == true )
   {
       QuerySQL( db, "UPDATE Account SET Kills='" + status[ id ].Kills + "', Deaths='" + status[ player.ID ].Deaths + "', Cash='" + status[ id ].Cash + "', Bank='" + status[ id ].Bank + "' WHERE Name='" + player.Name + "'" );
   print( "Saved Stats of Player " + player.Name + "[" + player.ID + "]" );
   status[ id ] = null;
   }
   }
   catch(e) print( "Save Stats Error: " + e );
}

else if ( cmd == "stats" )
  {
     
try
{
if ( status[ player.ID ].IsReg == false ) ePrivMessage( "[Error] - You're not registered.", player );
else
{
    if ( !text ) EMessage( ">> " + player.Name + "'s Stats: " + GetStats( player ) );
else if ( text )
{
    local plr = GetPlayer( text );
if ( !plr ) ePrivMessage( "Invalid Player Nick/ID!", player );
else PrivMessage( plr.Name + "'s Stats: " + GetStats( plr ), player );
}

}
}
catch(e) print( "Stats Cmd Error: " + e );
  }
#57
Scripting and Server Management / Re: error
Oct 02, 2015, 04:54 PM
[null 0x000000000]
#58
Scripting and Server Management / error
Oct 02, 2015, 04:45 PM
when i open server i  getting error expression expected in line no = 141 column = 38 in thin line
Message( " + GetLevelTag(player) + ": " + player.Name + ": " + WHITE + " " + text + " );
#59
Off-Topic General / FRee host
Sep 28, 2015, 10:36 AM
Any one can host my serveR FREE
#60
Off-Topic General / Re: Eid Mubarak
Sep 25, 2015, 04:46 PM
Same to you @FinchDon