Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define ROAPVEH_V1_0_
- #if !defined ROAPVEH_V1_0_
- ================================================================================
- RoapVeh v1.0 by Roach
- ================================================================================
- - Credits to Zeex for ZCMD and for VEH:(...) ideea.
- - Credits to stuntman from some ideeas and councils.
- - Credits to Roach for this Include :)).
- ================================================================================
- Log RoapVeh v1.0
- ================================================================================
- - [Added]: Public: Define( aka fc | function ).
- - [Added]: pVeh Variable for All Players.
- - [Added]: Added Personal Vehicle Function.
- - [Added]: VEH: Define. ( Thanks ZeeX )
- - [Update]: The function to the Final.
- ================================================================================
- #endif
- // Some Shorcuts
- #define Public:%0(%1)\
- forward %0(%1);\
- public %0(%1)
- #define VEH:%0(%1)\
- VEH(%0, %1)
- new
- pVeh[ MAX_PLAYERS ]
- ;
- Public:VEH( vehID, playerid )
- {
- // Create Floats
- new
- Float: pvPos[ 4 ]
- ;
- // Checks...
- if( GetPlayerVehicleID( playerid ) == pVeh[ playerid ] ) return SendClientMessage( playerid, -1, "You are already sitting in your Personal Car!" );
- if( IsPlayerInAnyVehicle( playerid ) ) RemovePlayerFromVehicle( playerid );
- // Destroy Old Vehicle
- DestroyVehicle( pVeh[ playerid ] );
- // Get Position
- GetPlayerPos( playerid, pvPos[ 0 ], pvPos[ 1 ], pvPos[ 2 ] );
- GetPlayerFacingAngle( playerid, pvPos[ 3 ] );
- // Create Vehicle
- pVeh[ playerid ] = CreateVehicle( vehID, pvPos[ 0 ], pvPos[ 1 ], pvPos[ 2 ] + 3, pvPos[ 3 ], 75, 3, 5000000 );
- // Set VW and INT and Put Player in Vehicle
- LinkVehicleToInterior( pVeh[ playerid ], GetPlayerInterior( playerid ) );
- SetVehicleVirtualWorld( pVeh[ playerid ], GetPlayerVirtualWorld( playerid ) );
- PutPlayerInVehicle( playerid, pVeh[ playerid ], 0 );
- // Set Params...
- for( new i = 0; i < MAX_PLAYERS; i++ )
- {
- if( IsPlayerConnected( i ) && i != playerid )
- {
- SetVehicleParamsForPlayer( pVeh[ playerid ], i, 0, 1 );
- }
- }
- return ( 1 );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement