Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #if defined ROAPVEH_V1_5_
- ================================================================================
- RoapVeh v1.5 by Roach
- ================================================================================
- - Credits to Zeex for ZCMD and for VEH:(...) ideea.
- - Credits to stuntman from some ideeas and councils.
- - Credits to Y_Less for y_hook and all the YSI Library.
- - Credits to Roach for this Include :)).
- ================================================================================
- Log RoapVeh v1.5
- ================================================================================
- - [Removed]: pVeh Variable.
- - [Added]: pVariable.
- - [Added]: Y_HOOK ! ! !
- - [Added]: VEH: Define. ( Thanks ZeeX )
- - [Added]: Hook Function...
- - [ADDED]: Destroy This F**ing Vehicle when Player Disconnect.
- ================================================================================
- #endif
- #include <YSI/y_hooks>
- // Some Shorcuts
- #define Public:%0(%1)\
- forward %0(%1);\
- public %0(%1)
- #define VEH:%0(%1)\
- VEH(%0, %1)
- Public:VEH( vehID, playerid )
- {
- // Create Floats
- new
- Float: pvPos[ 4 ]
- ;
- // Checks...
- if( GetPlayerVehicleID( playerid ) == GetPVarInt( playerid, "pVeh" ) ) return SendClientMessage( playerid, -1, "You are already sitting in your Personal Car!" );
- if( IsPlayerInAnyVehicle( playerid ) ) RemovePlayerFromVehicle( playerid );
- // Destroy Old Vehicle
- DestroyVehicle( GetPVarInt( playerid, "pVeh" ) );
- // Get Position
- GetPlayerPos( playerid, pvPos[ 0 ], pvPos[ 1 ], pvPos[ 2 ] );
- GetPlayerFacingAngle( playerid, pvPos[ 3 ] );
- // Create Vehicle
- SetPVarInt( playerid, "pVeh", CreateVehicle( vehID, pvPos[ 0 ], pvPos[ 1 ], pvPos[ 2 ] + 3, pvPos[ 3 ], 75, 3, 5000000 ) );
- //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( GetPVarInt( playerid, "pVeh" ), GetPlayerInterior( playerid ) );
- SetVehicleVirtualWorld( GetPVarInt( playerid, "pVeh" ), GetPlayerVirtualWorld( playerid ) );
- PutPlayerInVehicle( playerid, GetPVarInt( playerid, "pVeh" ), 0 );
- // Set Params...
- for( new i = 0; i < MAX_PLAYERS; i++ )
- {
- if( IsPlayerConnected( i ) && i != playerid )
- {
- SetVehicleParamsForPlayer( GetPVarInt( playerid, "pVeh" ), i, 0, 1 );
- }
- }
- return ( 1 );
- }
- Hook:pVeh_OnPlayerDisconnect( playerid, reason )
- {
- DestroyVehicle( GetPVarInt( playerid, "pVeh" ) );
- return ( 1 );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement