Author Topic: I fixed !getcar bug.Here is it.  (Read 2488 times)

0 Members and 1 Guest are viewing this topic.

Offline VC[88]PD

  • Wiseguy
  • **
  • Posts: 52
    • View Profile
I fixed !getcar bug.Here is it.
« on: March 01, 2013, 08:38:01 am »
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]

Thanks!!!![/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.
 :) :) :) :) :) :) :) :)

Offline [VN]truon_chan1

  • Street Thug
  • *
  • Posts: 13
  • [VC]88[PD], best friend FOREVER.
    • View Profile
Re: I fixed !getcar bug.Here is it.
« Reply #1 on: March 14, 2013, 01:54:12 pm »
now is not any bug