Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <dini>
- #define FILTERSCRIPT
- #define Failas "Rekordas.ini"
- new
- pRekordas
- ;
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- if(!fexist(Failas))
- {
- dini_Create(Failas);
- pRekordas = 0;
- }
- else
- {
- pRekordas = dini_Int(Failas, "Rekord");
- }
- return true;
- }
- #endif
- public OnPlayerConnect(playerid)
- {
- if(GetOnlinePlayers() > pRekordas)
- {
- new
- msg[128]
- ;
- format(msg, sizeof(msg), "Pasiektas naujas žaidėjų rekordas: {FF0000}%i {00FF00}Senas rekordas: {FF0000}%i", GetOnlinePlayers(), pRekordas);
- SendClientMessageToAll(0x00FF00FF, msg);
- pRekordas = GetOnlinePlayers();
- dini_IntSet(Failas, "Rekord", pRekordas);
- }
- return true;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- return true;
- }
- stock GetOnlinePlayers()
- {
- new
- Online
- ;
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- Online ++;
- }
- }
- return Online;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement