Advertisement
Guest User

asd

a guest
Oct 5th, 2018
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. #define MAX_QUEST_POS 3
  2. #define QUEST_OBJECT ID
  3.  
  4. static const Float: quest_pos[ ][ MAX_QUEST_POS ] =
  5. {
  6. { /* pozitia 1 */ },
  7. { /* pozitia 2 */ },
  8. { /* pozitia 3 */ }
  9. };
  10.  
  11. new obiect_quest[ MAX_QUEST_POS ];
  12. new obiect_gasit[ MAX_PLAYERS ][ MAX_QUEST_POS ];
  13.  
  14. public OnGameModeInit( )
  15. {
  16. for( new i = 0; i < MAX_QUEST_POS; ++i )
  17. {
  18. obiect_quest[ i ] = CreateDynamicPickup( QUEST_OBJECT, 1, quest_pos[ i ][ 0 ], quest_pos[ i ][ 1 ], quest_pos[ i ][ 2 ], -1, -1, -1, 100.0 );
  19. }
  20.  
  21. return true;
  22. }
  23.  
  24. public OnPlayerPickUpDynamicPickup( playerid, STREAMER_TAG_PICKUP pickupid )
  25. {
  26. for( new i = 0; i < MAX_QUEST_POS; ++i )
  27. {
  28. if( pickupid == obiect_quest[ i ] )
  29. {
  30. if( IsPlayerInRangeOfPoint( playerid, 2.0, quest_pos[ i ][ 0 ], quest_pos[ i ][ 1 ], quest_pos[ i ][ 2 ] ) && !obiect_gasit[ playerid ][ i ] )
  31. {
  32. new string[ 64 ];
  33. format( string, sizeof string, "Ai gasit un obiect. Mai ai de gasit %d obiecte.", total_obiecte_negasite( playerid ) );
  34. SCM( playerid, -1, string );
  35.  
  36. obiect_gasit[ playerid ][ i ] = 1;
  37.  
  38. // premiu
  39.  
  40. if( !total_obiecte_negasite( playerid ) )
  41. {
  42. // marele premiu
  43. }
  44. }
  45. }
  46. }
  47.  
  48. return true;
  49. }
  50.  
  51. stock total_obiecte_negasite( playerid )
  52. {
  53. new obiecte = 0;
  54.  
  55. for( new i = 0; i < MAX_QUEST_POS; ++i )
  56. {
  57. if( !obiect_gasit[ playerid ][ i ] ) obiecte ++;
  58. }
  59.  
  60. return obiecte;
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement