Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Snippet Showroom => Topic started by: VC[88]PD on March 01, 2013, 08:38:01 am

Title: I fixed !getcar bug.Here is it.
Post by: VC[88]PD 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.
 :) :) :) :) :) :) :) :)
Title: Re: I fixed !getcar bug.Here is it.
Post by: [VN]truon_chan1 on March 14, 2013, 01:54:12 pm
now is not any bug