no steam this line is not in my svr onplayerjoin but when i add this onplayerinfo it bug script so i remove it
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 Menufunction 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 + "', Joins='" + status[id].Joins + "' WHERE Name='" + player.Name.tolower() + "'" );
print( "Saved Stats of Player " + player.Name + "[" + player.ID + "]" );
status[ id ] = null;
}
}
catch(e) print( "Save Stats Error: " + e );
}
function Start()
{
try{
local a = 1;
while( a <= GetVehicleCount() )
{
QuerySQL( sqliteDB, "UPDATE Cars SET Owner='Vice-City' WHERE ID='" + a + "'" );
a ++;
}
}
catch(e) print( "lol: " + e );
}
function Cars()
{
local a = 1, MaxCars = GetVehicleCount();
while ( a <= MaxCars )
{
local veh = FindVehicle( a );
if ( veh )
{
QuerySQL( sqliteDB, "REPLACE INTO Cars ( ID, Cost, Owner, Shared ) VALUES ( '" + veh.ID + "', '100000', 'Vice-City', 'None' )" );
}
a ++;
}
}
function ForsaleCars()
{local a = 1, b = 0;
while ( a <= GetVehicleCount() )
{local q = QuerySQL( sqliteDB, "SELECT * FROM Cars WHERE ID='" + a.tointeger() + "'" );
if ( GetSQLColumnData( q, 2 ) == "Vice-City" )
{b++;
local veh = FindVehicle( a.tointeger() );
local vehicle = GetVehicleType( veh.Model );
if ( vehicle == "Car" ) Car++;
else if ( vehicle == "Plane" ) Plane++;
else if ( vehicle == "Boat" ) Boat++;
else if ( vehicle == "RC" ) RC++;
else if ( vehicle == "Bike" ) Bike++;
else if ( vehicle == "Heli" ) Heli++;
}
a++;
}
return b;
}
function GetVehicleType( model ) {
// Returns: Car / Bike / Heli / Plane / Boat / RC
switch ( model ) {
case 136:
case 160:
case 176:
case 182:
case 183:
case 184:
case 190:
case 202:
case 203:
case 214:
case 223:
return "Boat";
break;
case 155:
case 165:
case 217:
case 218:
case 227:
return "Heli";
break;
case 166:
case 178:
case 191:
case 192:
case 193:
case 198:
return "Bike";
break;
case 171:
case 194:
case 195:
case 231:
return "RC";
break;
case 180:
case 181:
return "Plane";
break;
default:
return "Car";
break;
}
}
function PlayerCars( player )
{
local a = 1, b = 0;
while ( a <= GetVehicleCount() )
{
if ( CarOwner( a ).tolower() == player.Name.tolower() )
{
b ++;
}
a ++;
}
return b;
}
else if ( cmd == "forsale" )
{
Message( "Total Vehicles: " + ForsaleCars() + "." );
Message( "Cars: " + Car + ", Bikes: " + Bike + ", Planes: " + Plane + ", RC: " + RC + ", Boats: " + Boat + ", Helis: " + Heli + "." );
Empty();
}
Car <- 0;
Bike <- 0;
RC <- 0;
Plane <- 0;
Boat <- 0;
Heli <- 0;
else if ( cmd == "sharecar1" )
{
if ( stats[player.ID].Logged == true )
{
if ( stats[player.ID].Logged == true )
{
if ( player.Vehicle )
{
local Cars = QuerySQL( sqliteDB, "SELECT Owner FROM Cars WHERE ID LIKE '" + player.Vehicle.ID + "'" );
if ( GetSQLColumnData( Cars, 0 ) != player.Name ) ClientMessage ( "Error - You don't own this car.", player,255,255,0);
else
{
if ( text )
{
local plr = FindPlayer( text );
if ( plr )
{
if ( stats[ player.ID].Logged == true )
{
QuerySQL( sqliteDB, "UPDATE Vehicles SET Shared = '" + plr.Name + "' WHERE ID = '" + player.Vehicle.ID + "'" );
ClientMessage ( "You are now sharing your " + GetVehicleNameFromModel( player.Vehicle.Model ) + " with " + plr.Name, player,255,255,0);
ClientMessage ( player.Name + " is now sharing his " + GetVehicleNameFromModel( player.Vehicle.Model ) + " (ID: " + player.Vehicle.ID + ") with you.", plr,255,255,0);
}
else ClientMessage ( "Error - " + plr.Name + " is not a registered nickname.", player,255,255,0);
}
else ClientMessage ( "Error - No such player.", player,255,255,0);
}
else ClientMessage ( "Usage: !" + cmd + " <nick/ID>", player,255,255,0);
}
}
else ClientMessage ( "Error - You need to be in the vehicle you want to share.", player,255,255,0);
}
else ClientMessage ( "Error - You are not logged in.", player,255,255,0);
}
else ClientMessage ( "Error - You haven't registered your nickname.", player,255,255,0);
}