ShareCar

Started by Finch, Apr 17, 2015, 10:31 AM

Previous topic - Next topic

Finch

My sharecar is not working when i do /sharecar Finch its say u are sharing car with Finch but when i do /car 0 its say shared none

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);
}
Beztone is a scripter but he is too stupid

Honey

Are you sure the the Var. sqliteDB exists? As far as I can see, It's a database problem

Finch

yeah it is sqliteDB
Beztone is a scripter but he is too stupid

DizzasTeR

You are taking vehicle owner from Cars table, but setting the shared car in Vehicles table? Genius.

Finch

Beztone is a scripter but he is too stupid