Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Need to add lr players participation
- // Need to add glow to winner based on purpose
- new const szPrefix[ ] = "AMXX";
- enum _: GAMES_DATA
- {
- GAME_FIRSTWRITES = 1,
- GAME_TRANSLATE,
- GAME_MISSING_LETTER,
- GAME_CLOSEST_NUMBER,
- GAME_TYPE_RACE,
- GAME_CONFUSED_WORDS,
- GAME_MATH
- };
- enum _: GAMES_PURPOSE
- {
- GAME_LR, // On last request
- GAME_CT, // Initiated by CTs
- GAME_PLAYERS, // To become a guard
- GAME_EVENT // Events by owners (add cash bonus)
- };
- enum _: GAME_END
- {
- END_DEFAULT, // Ended because no one answered
- END_STOP, // Stopped
- END_WIN // Someone won the contest
- };
- new szEvents[ GAMES_DATA ][ 32 ] =
- {
- "N/A",
- "Firstwrites",
- "Translate",
- "Missing letter",
- "Closest number",
- "Type race",
- "Confused words",
- "Mathematics"
- };
- native start_game( Game = GAME_FIRSTWRITES, WinType = GAME_CT );
- native end_game( Reason = END_DEFAULT );
- native get_game_type();
- native get_game_purpose();
- native get_end_reason();
- native bool: is_game_active();
- native bool: is_game_allowed();
- stock ColorPrint( const index, const string[], any:... )
- {
- new szMsg[ 512 ], Players[ 32 ], PNum = 1;
- static iLen; iLen = formatex( szMsg, charsmax( szMsg ), "^4[%s]^1 ", szPrefix );
- vformat( szMsg[ iLen ], charsmax( szMsg ) - iLen, string, 3 );
- if ( index )
- Players[ 0 ] = index;
- else
- get_players( Players, PNum, "ch" );
- for ( new i; i < PNum; i++ )
- {
- if( is_user_connected( Players[ i ] ) )
- {
- message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "SayText" ), _, Players[ i ] );
- write_byte( Players[ i ] );
- write_string( szMsg );
- message_end( );
- }
- }
- return 1;
- }
- stock szName( const index )
- {
- static g_szName[ 32 ];
- get_user_name( index, g_szName, charsmax( g_szName ) );
- return g_szName;
- }
Advertisement
Add Comment
Please, Sign In to add comment