Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- getPlayerNearFarmerPlant( playerID ) {
- new Float:objectPos[ 3 ];
- for( new i = 0; i < MAX_FARMS; i++ ) {
- if( plantInfo[ i ][ farmPlantCreated ] && plantInfo[ i ][ farmPlayerID ] == playerID ) {
- if( plantInfo[ i ][ farmObject ] != INVALID_OBJECT_ID && IsValidDynamicObject( plantInfo[ i ][ farmObject ] ) ) {
- GetDynamicObjectPos( plantInfo[ i ][ farmObject ], objectPos[ 0 ], objectPos[ 1 ], objectPos[ 2 ] );
- if( IsPlayerInRangeOfPoint( playerID, 5.0, objectPos[ 0 ], objectPos[ 1 ], objectPos[ 2 ] ) ) return i;
- }
- }
- }
- return -1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement