It is easy to fix it.Just put this in public OnPlayerExitVehicle and it will spawn car all the time when you use !getcar.
[pawn]public OnPlayerExitVehicle(playerid, vehicleid)
{
RemovePlayerFromVehicle(playerid);
return 1;
}[/pawn]
[/color][/size]
And the getcar cmd of mine.
[pawn]else if ( strcmp( cmd, "!getcar", true ) == 0 )
{
tmp = strtok( cmdtext, idx );
if ( !IsLoggedIn( playerid ) ) SendClientMessage( playerid, COLOR_RED, "Please log-in to your account." );
else if ( !strlen( tmp ) ) SendClientMessage( playerid, COLOR_GREEN, "USAGE: !getcar [VehicleID]" );
else if ( !IsVehicleExist( strval( tmp ) ) ) SendClientMessage( playerid, COLOR_GREEN, "Error: Unknown Vehicle" );
else if ( !IsVehicleOwnedShared( strval( tmp ), gPlayers[ playerid ] ) ) SendClientMessage( playerid, COLOR_GREEN, "You do not have the keys for that vehicle." );
else
{
new Float:Angle;
GetPlayerPos( playerid, x, y, z); GetPlayerFacingAngle( playerid,Angle);
if ( !Angle) SendClientMessage( playerid, COLOR_GREEN, "Error: Invalid vehicle!" );
GetPlayerPos(playerid, x, y, z);
SetVehiclePos( strval( tmp ),x+3, y+3, z,Angle);
SetVehicleToRespawn(strval( tmp ));
PutPlayerInVehicle(playerid, strval( tmp ));
format( szMsg, sizeof( szMsg ), "Spawning vehicle:[ %d ]", strval( tmp ) );
SendClientMessage( playerid, COLOR_GREEN, szMsg );
}
return 1;
}[/pawn]
Use this cmd,the car will be proof.