Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //=========================[ INCLUDE ]==========================//
- #include < a_samp >
- #include < YSI\y_INI >
- #include < YSI\y_commands >
- //==============================================================//
- #if defined FILTERSCRIPT
- //=========================[ DEFINE ]===========================//
- #define KORISNICI "Korisnici/%s.ini"
- enum pInfo { xDutyTime }
- new PlayerInfo[ MAX_PLAYERS ][ pInfo ], admin_duty[ MAX_PLAYERS ];
- stock Korisnici( playerid ) {
- new string[ 128 ], name[ MAX_PLAYER_NAME ]; GetPlayerName( playerid, name, sizeof( name ) );
- format( string, sizeof( string ), KORISNICI, name );
- return string;
- }
- //==============================================================//
- stock save_player(playerid) {
- if(IsPlayerConnected(playerid))
- {
- new INI:File = INI_Open(Korisnici(playerid));
- INI_SetTag(File,"data");
- INI_WriteString( File, "DutyTime", PlayerInfo[ playerid ][ xDutyTime ] );
- INI_Close(File);
- }
- return true;
- }
- //==============================================================//
- public OnGameModeInit( ) {
- SetTimer( "PovecajDutyTime", 60000, true );
- return true;
- }
- public OnPlayerConnect( playerid ) {
- PlayerInfo[ playerid ][ xDutyTime ] = 0;
- return true;
- }
- //==============================================================//
- YCMD:aduty( playerid, params[], help ) {
- if( !IsPlayerAdmin( playerid ) ) return SendClientMessage( playerid, -1, "{FFAF00}[WARNING]: {FFFFFF}Samo Admini." ); {
- new string[ 128 ], name[ MAX_PLAYER_NAME ]; GetPlayerName( playerid, name, sizeof( name ) );
- if( admin_duty[ playerid ] == 0) {
- format( string, sizeof( string ), "{FFAF00}[Admin Duty]: {FFFFFF}Admin %s je na duznosti.", name);
- SendClientMessageToAll( -1, string );
- admin_duty[ playerid ] = 1;
- }
- if( admin_duty[ playerid ] == 1) {
- format( string, sizeof( string ), "{FFAF00}[Admin Duty]: {FFFFFF}Admin %s vise nije na duznosti. #DutyTime: %d", name, PlayerInfo[ playerid ][ xDutyTime ]);
- SendClientMessageToAll( -1, string );
- admin_duty[ playerid ] = 0;
- }
- }
- return true;
- }
- //==============================================================//
- forward PovecajDutyTime(); public PovecajDutyTime() {
- for(new i = 0; i < MAX_PLAYERS; i++) {
- if(IsPlayerAdmin(i)) {
- PlayerInfo[ i ][ xDutyTime ] ++;
- save_player( i );
- }
- }
- return true;
- }
- //==============================================================//
- #endif
- //==============================================================//
- /*
- [ KRAJ FILTERSKRIPTER ]
- [ IZRADIO: XALAZY ]
- [ VREME IZRADE: 10-ak MINUTA ]
- [ CREDITS: ONAJ KO JE NA ZG URADIO OVO, (IDEJA)];
- [ NE BRISI CREDITS ]
- */
- //==============================================================//
Advertisement
Add Comment
Please, Sign In to add comment