Advertisement
StefkeZ

Untitled

Aug 6th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. getPlayerNearFarmerPlant( playerID ) {
  2.  
  3. new Float:objectPos[ 3 ];
  4.  
  5. for( new i = 0; i < MAX_FARMS; i++ ) {
  6.  
  7. if( plantInfo[ i ][ farmPlantCreated ] && plantInfo[ i ][ farmPlayerID ] == playerID ) {
  8.  
  9. if( plantInfo[ i ][ farmObject ] != INVALID_OBJECT_ID && IsValidDynamicObject( plantInfo[ i ][ farmObject ] ) ) {
  10.  
  11. GetDynamicObjectPos( plantInfo[ i ][ farmObject ], objectPos[ 0 ], objectPos[ 1 ], objectPos[ 2 ] );
  12. if( IsPlayerInRangeOfPoint( playerID, 5.0, objectPos[ 0 ], objectPos[ 1 ], objectPos[ 2 ] ) ) return i;
  13. }
  14. }
  15. }
  16. return -1;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement