Try This >>
function onPlayerCommand( plr, cmd, arguments )
{
if ( cmd == "v" || cmd == "veh" || cmd == "car" )
{
if ( plr.Spawned )
{
if ( arguments )
{
if ( IsNum( arguments ) )
{
local pTemp = split( arguments, " " ), ID = 90;
if ( IsNum( pTemp[ 0 ] ) ) ID = pTemp[ 0 ].tointeger();
if ( ( ID >= 90 ) && ( ID <= 150 ) )
{
local v = plr.Pos;
local pVehicle = CreateVehicle( ID, Vector( v.x, v.y, v.z ), plr.Angle );
pVehicle.OneTime = true;
local vehicle = GetClosestVehicle( plr );
if ( vehicle )
{
plr.Vehicle = vehicle;
}
}
}
else MessagePlayer( "Invalid arguments. Usage: /" + cmd + " < ID >", plr, 250, 0, 0 );
}
else MessagePlayer( "Invalid arguments. Usage: /" + cmd + " < ID >", plr, 250, 0, 0 );
}
else MessagePlayer( "You first need spawn.", plr, 250, 0, 0 );
return true;
}
return 1;
}