Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #if defined ROAVOWN_V1_0_
- ================================================================================
- RoavOwn v1.0 by Roach
- ================================================================================
- - Credits to SA:MP Development Team for their Incredible Mode ( SA:MP ).
- - Credits to Zeex for ZCMD and for vOWN:(...) ideea.
- - Credits to Zh3r0 from some ideeas and councils.
- - Credits to Y_Less for y_hook, y_timers and all the YSI Library.
- - Credits to Slice for the 'global' define Ideea.
- - Credits to Zonoya for the Personal Cars Ideea. ( RoapVeh )
- ================================================================================
- Log RoavOwn v1.0
- ================================================================================
- - [Added]: enum and Variable.
- - [Added]: Y_HOOK and Y_TIMERS ! ! !
- - [Added]: vOWN: Define. ( Thanks ZeeX )
- - [Added]: Hook Function...
- - [Added]: Count Variable.
- - [Added]: Timer Function.
- - [ENDED]: The vOwn Function and Added the FormMSG Define.
- ================================================================================
- #endif
- #include < a_samp > // Credits to SA:MP Development Team
- #include < YSI\y_hooks > // Credits to Y_Less
- #include < YSI\y_timers > // Credits to Y_Less
- // Some Shorcuts and Changes...
- #define Public:%0(%1)\
- forward %0(%1);\
- public %0(%1)
- #define vOWN:%0(%1,%2,%3,%4,%5)\
- vOWN(%0,%1,%2,%3,%4,%5)
- #define FormMSG(%0,%1,%2,%3)\
- do{\
- new _S_T_R_[ 500 ];\
- format(_S_T_R_, sizeof (_S_T_R_), (%2), %3);\
- SendClientMessage((%0),(%1), _S_T_R_);\
- }\
- while (False)
- #define global stock
- // Messages...
- #define ERROR_MSG "This isn't your car, it's {2299AA}%s{FFFFFF}'s car."
- #define ENTER_MSG "Welcome back, {2299AA}%s{FFFFFF} !"
- new
- v_Count = 0
- ;
- stock
- bool:False = false
- ;
- enum vOWN_enum
- {
- Model, Float: sX,
- Float: sY, Float: sZ,
- Float: s_zA, Col_1,
- Col_2, bool:v_Spawned,
- v_Owner[ MAX_PLAYER_NAME ],
- NumID
- };
- new v_DATE[ MAX_VEHICLES ][ vOWN_enum ];
- Public:vOWN( ModelID, uName[ ], Float: pX, Float: pY, Float: pZ, Float: zAng )
- {
- v_Count ++;
- format( v_DATE[ v_Count ][ v_Owner ], MAX_PLAYER_NAME, "%s", uName );
- v_DATE[ v_Count ][ Model ] = ModelID;
- v_DATE[ v_Count ][ sX ] = pX;
- v_DATE[ v_Count ][ sY ] = pY;
- v_DATE[ v_Count ][ sZ ] = pZ;
- v_DATE[ v_Count ][ s_zA ] = zAng;
- v_DATE[ v_Count ][ v_Spawned ] = false;
- return ( 1 );
- }
- timer LoadvOwnVehicles[1000]( )
- {
- if( v_Count > 0 )
- {
- for( new v = 1; v <= v_Count; v ++ )
- {
- if( !v_DATE[ v ][ v_Spawned ] )
- {
- v_DATE[ v ][ NumID ] = CreateVehicle( v_DATE[ v ][ Model ], v_DATE[ v ][ sX ], v_DATE[ v ][ sY ], v_DATE[ v ][ sZ ], v_DATE[ v ][ s_zA ], random( 124 ), random( 124 ), -1 );
- v_DATE[ v ][ v_Spawned ] = true;
- printf( "%s's Vehicle Loaded Succesfully !", v_DATE[ v ][ v_Owner ] );
- }
- }
- }
- return ( 1 );
- }
- Hook:OnPlayerStateChange( playerid, newstate, oldstate )
- {
- new vehicleid = GetPlayerVehicleID( playerid );
- if( newstate == PLAYER_STATE_DRIVER )
- {
- for( new v = 1; v <= v_Count; v ++ )
- {
- if( vehicleid == v_DATE[ v ][ NumID ] )
- {
- if( strcmp( v_DATE[ v ][ v_Owner ], pName( playerid ) ) )
- {
- FormMSG( playerid, 0xFFFFFFFF, ERROR_MSG, v_DATE[ v ][ v_Owner ] );
- RemovePlayerFromVehicle( playerid );
- return ( 0 );
- }
- else FormMSG( playerid, 0xFFFFFFFF, ENTER_MSG, v_DATE[ v ][ v_Owner ] );
- }
- }
- return ( 1 );
- }
- return ( 1 );
- }
- global pName( playerid )
- {
- new NAME[ MAX_PLAYER_NAME ];
- GetPlayerName( playerid, NAME, sizeof NAME );
- return ( NAME );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement