Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enum _srInfo
- {
- zRekordas
- };
- new srInfo [ _srInfo ] ;
- public OnPlayerConnect ( playerid )
- {
- new
- str [ 80 ]
- ;
- mysql_query ( "SELECT Rekordas FROM serverionust" ) ;
- mysql_store_result ( ) ;
- mysql_retrieve_row ( ) ;
- srInfo [ zRekordas ] = mysql_fetch_int ( ) ;
- if( GetPlayersOnline ( ) > srInfo [ zRekordas ] )
- {
- format ( str , 80 , "Pasiektas naujas rekordas: %i žaidėjai (ų)",srInfo [ zRekordas ] ) ;
- SendClientMessageToAll ( -1,str ) ;
- srInfo [ zRekordas ] = GetPlayersOnline ( ) ;
- UpdateRecord();
- }
- mysql_free_result ( ) ;
- return 1;
- }
- stock UpdateRecord ( )
- {
- new
- Query [ 80 ]
- ;
- format ( Query, sizeof(Query), "UPDATE `serverionust` Rekordas = '%i'",srInfo [ zRekordas ] ) ;
- mysql_query ( Query ) ;
- printf("[ SAVED RECORD ]: %i ",srInfo [ zRekordas ] ) ;
- }
- stock GetOnlinePlayers ( )
- {
- new pOnline;
- for ( new i = 0; i < MAX_PLAYERS; i ++ )
- {
- if(IsPlayerConnected( i ) )
- pOnline++;
- printf("[ PLAYERS ONLINE ]: %i",pOnline ) ;
- }
- return pOnline;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement