getcar crashes

Started by kokia, Jul 07, 2015, 05:55 AM

Previous topic - Next topic

kokia

hello all having a nice day?
but i have a problem whenever i type /getcar my server crashes.
code is else if ( cmd == "getcar" )
{
    local q = QuerySQL( db, "SELECT * FROM Cars WHERE rowid LIKE '" + text + "'" );
local id = player.ID
if ( !player.IsSpawned ) ePrivMessage( "[Error] - You haven't spawned yet..", player );
else if ( !text ) ePrivMessage( "[Syntax] - /" + cmd + " <ID>", player );
else if ( !IsNum( text ) ) ePrivMessage( "[Error] - ID Must be Numbers..", player );
else
{
    local veh = FindVehicle( text.tointeger() );
if ( veh.ID > GetVehicleCount() ) ePrivMessage( "[Error] - Invalid Vehicle ID.", player );
else if ( !IsOwnerOrSharer( veh, player ) ) ePrivMessage( "[Error] - You do not own this Vehicle.", player );
else
{
    rMessage( "Taking Vehicle:[ " + GetVehicleNameFromModel( veh.Model ) + " ] to:[ " + player.Name + " ]" );
veh.Pos = Vector( player.Pos.x + 6, player.Pos.y, player.Pos.z - 1 );
                    veh.Angle = player.Angle;
}
}
}
yes i am using warchiefs 0.4

Mashreq

Try removing the following one from your getcar command
veh.Angle = player.Angle;

EK.IceFlake

Quote from: Mashreq on Jul 07, 2015, 06:51 AMTry removing the following one from your getcar command
veh.Angle = player.Angle;
No, change it to
veh.EulerAngle = Vector(0, 0, player.Angle);

kokia

you are the best
Quote from: Mashreq on Jul 07, 2015, 06:51 AMTry removing the following one from your getcar command
veh.Angle = player.Angle;
It worked!