Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define MAX_QUEST_POS 3
- #define QUEST_OBJECT ID
- static const Float: quest_pos[ ][ MAX_QUEST_POS ] =
- {
- { /* pozitia 1 */ },
- { /* pozitia 2 */ },
- { /* pozitia 3 */ }
- };
- new obiect_quest[ MAX_QUEST_POS ];
- new obiect_gasit[ MAX_PLAYERS ][ MAX_QUEST_POS ];
- public OnGameModeInit( )
- {
- for( new i = 0; i < MAX_QUEST_POS; ++i )
- {
- obiect_quest[ i ] = CreateDynamicPickup( QUEST_OBJECT, 1, quest_pos[ i ][ 0 ], quest_pos[ i ][ 1 ], quest_pos[ i ][ 2 ], -1, -1, -1, 100.0 );
- }
- return true;
- }
- public OnPlayerPickUpDynamicPickup( playerid, STREAMER_TAG_PICKUP pickupid )
- {
- for( new i = 0; i < MAX_QUEST_POS; ++i )
- {
- if( pickupid == obiect_quest[ i ] )
- {
- if( IsPlayerInRangeOfPoint( playerid, 2.0, quest_pos[ i ][ 0 ], quest_pos[ i ][ 1 ], quest_pos[ i ][ 2 ] ) && !obiect_gasit[ playerid ][ i ] )
- {
- new string[ 64 ];
- format( string, sizeof string, "Ai gasit un obiect. Mai ai de gasit %d obiecte.", total_obiecte_negasite( playerid ) );
- SCM( playerid, -1, string );
- obiect_gasit[ playerid ][ i ] = 1;
- // premiu
- if( !total_obiecte_negasite( playerid ) )
- {
- // marele premiu
- }
- }
- }
- }
- return true;
- }
- stock total_obiecte_negasite( playerid )
- {
- new obiecte = 0;
- for( new i = 0; i < MAX_QUEST_POS; ++i )
- {
- if( !obiect_gasit[ playerid ][ i ] ) obiecte ++;
- }
- return obiecte;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement