Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- task OtherTimer[1000]() {
- new attackers, defenders, count = 0, warid, atscore, defscore, winner, id, id2, string[256];
- // Paintball arena
- if( painttime > 0 ) painttime --;
- for( new i = 0; i < 3; i++ ) {
- if( PaintText[ i ] != 0 ) {
- PaintText[ i ] --;
- if(PaintText[i] == 0) format(string, sizeof(string), "~w~Runda a inceput~n~Succes tuturor!");
- else format(string, sizeof(string), "~w~Runda incepe in ~n~~b~%d secunde", PaintText[i]);
- GameTextForPaint(string, i);
- }
- if( PlayersOnPaint( i ) >= 2 && PaintTime[ i ] > 0 ) {
- PaintTime[ i ] --;
- if( PaintTime[ i ] == 0 ) {
- SendPaintMessage( i + 1, COLOR_YELLOW, "Runda va incepe peste un minut. Pentru a vota o mapa, foolsiti comanda [/votemap]." );
- PaintVote[ i ] = 1;
- if( PaintTimer[ i ] != 0 ) KillTimer( PaintTimer[ i ] ), PaintTimer[ i ] = 0;
- PaintTimer[ i ] = SetTimerEx( "CalculateVote", 60000, false, "d", i );
- }
- }
- }
- for( new i = 1; i < sizeof Turfs; i++ ) {
- attackers = WarInfo[ i ][ wAttacker ]; defenders = WarInfo[ i ][ wFaction ];
- if( WarInfo[ i ][ wTime ] > 0 ) {
- WarInfo[ i ][ wTime ] --;
- foreach(new x : Player) { if( playerVariables[ x ][ pMember ] == attackers || playerVariables[ x ][ pMember ] == defenders ) format(string,sizeof(string),"~w~TURF TIMER: ~h~~y~%s",CalculeazaTimp2(WarInfo[i][wTime])); PlayerTextDrawSetString(x, TimeLeftWar1[x], string); PlayerTextDrawShow( x, TimeLeftWar1[ x ] ); }
- if( WarInfo[ i ][ wTime ] == 1 ) {
- atscore = WarScoreF[ attackers ][ i ]; defscore = WarScoreF[ defenders ][ i ];
- foreach(new x : Player) { if( playerVariables[ x ][ pMember ] == attackers || playerVariables[ x ][ pMember ] == defenders ) GangZoneStopFlashForPlayer( x, Turfs[ i ] ); }
- if( atscore > defscore ) winner = 1;
- else winner = 2;
- if( atscore == defscore || atscore < defscore) winner = 2;
- switch(winner) {
- case 1: TurfInfo[ i ][ zOwned ] = WarInfo[ i ][ wAttacker ];
- case 2: TurfInfo[ i ][ zOwned ] = WarInfo[ i ][ wFaction ];
- }
- foreach(new x : Player) {
- if(TurfsDisp[x] == 1) {
- if(TurfInfo[i][zOwned] == 4) GangZoneShowForPlayerEx(x, Turfs[i], 0x18EBD6C8); //Los Aztecas
- if(TurfInfo[i][zOwned] == 5) GangZoneShowForPlayerEx(x, Turfs[i], 0x40863CAA); //Grove Street
- if(TurfInfo[i][zOwned] == 6) GangZoneShowForPlayerEx(x, Turfs[i], 0xFFAE00C8); //Los Vagos
- if(TurfInfo[i][zOwned] == 10) GangZoneShowForPlayerEx(x, Turfs[i], 0xBD1CDEC8); //Ballas
- if(TurfInfo[i][zOwned] == 19) GangZoneShowForPlayerEx(x, Turfs[i], 0x6A4444FF); //Rifa
- if(TurfInfo[i][zOwned] == 20) GangZoneShowForPlayerEx(x, Turfs[i], 0x2F2F2FFF); //Russian
- if(TurfInfo[i][zOwned] == 21) GangZoneShowForPlayerEx(x, Turfs[i], 0x660000AA); //Red
- if(TurfInfo[i][zOwned] == 22) GangZoneShowForPlayerEx(x, Turfs[i], 0x24FF0AB9); //italian
- if(TurfInfo[i][zOwned] == 23) GangZoneShowForPlayerEx(x, Turfs[i], 0x993300AA); //Biker
- }
- }
- format( gString, sizeof gString, "INSERT INTO `wars` (`Attacker`, `Defender`, `Atscore`, `Defscore`, `Result`) VALUES ('%d', '%d', '%d', '%d', '%d')", attackers, defenders, atscore, defscore, winner );
- new Cache: warcache = mysql_query( SQL, gString );
- warid = cache_insert_id( ); cache_delete( warcache );
- if( winner == 1 ) {
- mysql_format( SQL, gString, sizeof gString, "UPDATE `turfs` SET `Owned` = '%d' WHERE `ID` = '%d'", TurfInfo[ i ][ zOwned ], i );
- mysql_tquery( SQL, gString, "", "" );
- }
- id = CalculateBestScore( i ); id2 = CalculateWorstScore( i );
- format(string, sizeof string, "NR AdmBot: Gruparea mafiota %s a %s teritoriul #%d %s de mafia %s.", ( winner == 1 ) ? ( NumeFactiune( WarInfo[ i ][ wAttacker ] ) ) : ( NumeFactiune( WarInfo[ i ][ wFaction ] ) ), ( winner == 1 ) ? ( "cucerit" ) : ( "aparat" ), i, ( winner == 1 ) ? ( "detinut" ) : ( "atacat" ), ( winner == 1 ) ? ( NumeFactiune( WarInfo[ i ][ wFaction ] ) ) : ( NumeFactiune( WarInfo[ i ][ wAttacker ] ) ) );
- SendClientMessageToAll( COLOR_ORANGE, string);
- format(string, sizeof string, "------------ [ war overview #%d ] ------------", warid );
- SCM(attackers, COLOR_GREEN, string);
- format(string, sizeof string, "------------ [ war overview #%d ] ------------", warid );
- SCM(defenders, COLOR_GREEN, string);
- format(string, sizeof string, "Score: %s %d - %d %s.", ( winner == 1 ) ? ( NumeFactiune( WarInfo[ i ][ wAttacker ] ) ) : ( NumeFactiune( WarInfo[ i ][ wFaction ] ) ), ( winner == 1 ) ? ( atscore ) : ( defscore ), ( winner == 1 ) ? ( defscore ) : ( atscore ), ( winner == 1 ) ? ( NumeFactiune( WarInfo[ i ][ wFaction ] ) ) : ( NumeFactiune( WarInfo[ i ][ wAttacker ] ) ) );
- SCM(attackers, COLOR_GREEN, string);
- format(string, sizeof string, "Score: %s %d - %d %s.", ( winner == 1 ) ? ( NumeFactiune( WarInfo[ i ][ wAttacker ] ) ) : ( NumeFactiune( WarInfo[ i ][ wFaction ] ) ), ( winner == 1 ) ? ( atscore ) : ( defscore ), ( winner == 1 ) ? ( defscore ) : ( atscore ), ( winner == 1 ) ? ( NumeFactiune( WarInfo[ i ][ wFaction ] ) ) : ( NumeFactiune( WarInfo[ i ][ wAttacker ] ) ) );
- SCM(defenders, COLOR_GREEN, string);
- format(string, sizeof string, "Best score: %s with a score of %d (%d kills, %d deaths). Worst score: %s with a score of %d (%d kills, %d deaths).", GetName( id ), ucideri[ id ][ i ] - decese[ id ][ i ], ucideri[ id ][ i ], decese[ id ][ i ], GetName( id2 ), ucideri[ id2 ][ i ] - decese[ id2 ][ i ], ucideri[ id2 ][ i ], decese[ id2 ][ i ] );
- SCM(attackers, COLOR_GREEN, string);
- format(string, sizeof string, "Best score: %s with a score of %d (%d kills, %d deaths). Worst score: %s with a score of %d (%d kills, %d deaths).", GetName( id ), ucideri[ id ][ i ] - decese[ id ][ i ], ucideri[ id ][ i ], decese[ id ][ i ], GetName( id2 ), ucideri[ id2 ][ i ] - decese[ id2 ][ i ], ucideri[ id2 ][ i ], decese[ id2 ][ i ] );
- SCM(defenders, COLOR_GREEN, string);
- foreach(new x : Player) {
- if( playerVariables[ x ][ pMember ] == attackers || playerVariables[ x ][ pMember ] == defenders ) {
- for( new j = 0; j != 5; j++ ) SendDeathMessageToPlayer( x, 1001, 1001, 1001 );
- format(string, sizeof string, "Your personal score: %d (%d kills, %d deaths).", ucideri[ x ][ i ] - decese[ x ][ i ], ucideri[ x ][ i ], decese[ x ][ i ] );
- SCM( x, COLOR_GREEN, string );
- PlayerTextDrawHide( x, TimeLeftWar1[ x ] ); }
- }
- SendFactionMessage( attackers, COLOR_GREEN, "------------------------------------" );
- SendFactionMessage( defenders, COLOR_GREEN, "------------------------------------" );
- WarScoreF[ attackers ][ i ] = 0; WarScoreF[ defenders ][ i ] = 0; InWar[ attackers ] = 0; InWar[ defenders ] = 0; waitwar[ attackers ] = 60; waitwar[ defenders ] = 60;
- foreach(new x : Player) {
- if( playerVariables[ x ][ pMember ] == attackers || playerVariables[ x ][ pMember ] == defenders ) {
- SCM( x, COLOR_YELLOW, "Ai fost transferat in VW-ul 0." );
- if( GetPlayerInterior( x ) < 1 ) SetPlayerVirtualWorld( x, 0 );
- if( attackers == 4 || defenders == 4 || attackers == 5 || defenders == 5 || attackers == 6 || defenders == 6 || attackers == 10 || defenders == 10)
- if( attackers == 19 || defenders == 19 || attackers == 20 || defenders == 20 || attackers == 21 || defenders == 21 || attackers == 22 || defenders == 22 || attackers == 23 || defenders == 23) { for( new j = 0; j < sizeof VehicleInfo; j++ ) { if( VehicleInfo[ j ][ vehGroup ] == attackers || VehicleInfo[ j ][ vehGroup ] == defenders ) SetVehicleVirtualWorld( VehicleInfo[ j ][ vehCarID ], 0 ); } }
- mysql_format( SQL, gString, sizeof gString, "INSERT INTO `warlogs` (`PlayerID`,`WarID`,`Kills`,`Deaths`,`Faction`) VALUES ('%d','%d','%d','%d','%d')", playerVariables[ x ][ pSQLID ], warid, ucideri[ x ][ i ], decese[ x ][ i ], playerVariables[ x ][ pMember ] );
- mysql_tquery( SQL, gString, "", "" );
- ucideri[ x ][ i ] = 0; decese[ x ][ i ] = 0;
- }
- }
- if( winner == 1 ) {
- foreach(new x : Player) {
- if( TurfsDisp[ x ] == 1 ) {
- GangZoneHideForPlayerEx( x, Turfs[ i ] );
- if( attackers == 4 ) GangZoneShowForPlayerEx( x, Turfs[ i ], 0xCC000099 );
- if( attackers == 5 ) GangZoneShowForPlayerEx( x, Turfs[ i ], 0x40863CAA );
- if( attackers == 6 ) GangZoneShowForPlayerEx( x, Turfs[ i ], 0x2F2F2F99 );
- if( attackers == 10 ) GangZoneShowForPlayerEx( x, Turfs[ i ], 0x88572499 );
- if( attackers == 19 ) GangZoneShowForPlayerEx( x, Turfs[ i ], 0x6A4444FF ); //Rifa
- if( attackers == 20 ) GangZoneShowForPlayerEx( x, Turfs[ i ], 0x2F2F2FFF ); //Russian
- if( attackers == 21 ) GangZoneShowForPlayerEx( x, Turfs[ i ], 0x660000AA ); //Red
- if( attackers == 22 ) GangZoneShowForPlayerEx( x, Turfs[ i ], 0x24FF0AB9 ); //italian
- if( attackers == 23 ) GangZoneShowForPlayerEx( x, Turfs[ i ], 0x993300AA ); //Bikers
- }
- } DeelayWar[ WarInfo[ i ][ wFaction ] ] = 300; DeelayWar[ WarInfo[ i ][ wAttacker ] ] = 600;
- }
- if( winner == 2 ) DeelayWar[ WarInfo[ i ][ wFaction ] ] = 300, DeelayWar[ WarInfo[ i ][ wAttacker ] ] = 600;
- WarInfo[ i ][ wTime ] = 0; WarInfo[ i ][ wFaction ] = 0; WarInfo[ i ][ wAttacker ] = 0; worstscoreat[ i ] = 0; worstmemberat[ i ] = 999;
- bestscoreat[ i ] = 0; bestmemberat[ i ] = 999; worstscoredf[ i ] = 0; worstmemberdf[ i ] = 999; bestscoredf[ i ] = 0; bestmemberdf[ i ] = 999;
- }
- if( WarInfo[ i ][ wTime ] > 2 ) {
- foreach(new x : Player) {
- if( IsPlayerInTurf( x, i ) && IsPlayerInAnyVehicle( x ) ) {
- if( playerVariables[ x ][ pMember ] == attackers || playerVariables[ x ][ pMember ] == defenders ) {
- SCM( x, COLOR_WHITE, "Nu ai voie sa folosesti masini in war area." );
- SetVehicleToRespawnEx( GetPlayerVehicleID( x ) ); SetPlayerVirtualWorld( GetPlayerVehicleID( x ), 1024 );
- }
- }
- if( playerVariables[ x ][ pMember ] == attackers || playerVariables[ x ][ pMember ] == defenders ) {
- if( WarInfo[ i ][ wAttacker ] == 4 ) GangZoneFlashForPlayer( x, Turfs[ i ], 0xCC000099 );
- else if( WarInfo[ i ][ wAttacker ] == 5 ) GangZoneFlashForPlayer( x, Turfs[ i ], 0x66857399 );
- else if( WarInfo[ i ][ wAttacker ] == 6 ) GangZoneFlashForPlayer( x, Turfs[ i ], 0x2F2F2F99 );
- else if( WarInfo[ i ][ wAttacker ] == 10 ) GangZoneFlashForPlayer( x, Turfs[ i ], 0x88572499 );
- else if( WarInfo[ i ][ wAttacker ] == 19 ) GangZoneFlashForPlayer( x, Turfs[ i ], 0x6A4444FF );
- else if( WarInfo[ i ][ wAttacker ] == 20 ) GangZoneFlashForPlayer( x, Turfs[ i ], 0x2F2F2FFF );
- else if( WarInfo[ i ][ wAttacker ] == 21 ) GangZoneFlashForPlayer( x, Turfs[ i ], 0x660000AA );
- else if( WarInfo[ i ][ wAttacker ] == 22 ) GangZoneFlashForPlayer( x, Turfs[ i ], 0x24FF0AB9 );
- else if( WarInfo[ i ][ wAttacker ] == 23 ) GangZoneFlashForPlayer( x, Turfs[ i ], 0x993300AA ); }
- if( IsPlayerInTurf( x, i ) && playerVariables[ x ][ pMember ] == attackers ) count ++;
- }
- if( count < 1 ) {
- if( waitwar[ attackers ] > 0 ) waitwar[ attackers ] --;
- if( !waitwar[ attackers ] ) {
- waitwar[ attackers ] = 0; atscore = WarScoreF[ attackers ][ i ]; defscore = WarScoreF[ defenders ][ i ];
- foreach(new x : Player) { if( playerVariables[ x ][ pMember ] == attackers || playerVariables[ x ][ pMember ] == defenders ) GangZoneStopFlashForPlayer( x, Turfs[ i ] ); }
- if( atscore > defscore ) winner = 1;
- else winner = 2;
- if( atscore == defscore ) winner = 2;
- format( gString, sizeof gString, "INSERT INTO `wars` (`Attacker`,`Defender`,`Atscore`,`Defscore`,`Result`) VALUES ('%d','%d','%d','%d','3')", attackers, defenders, atscore, defscore );
- new Cache: warcache = mysql_query( SQL, gString );
- warid = cache_insert_id( ); cache_delete( warcache ); id = CalculateBestScore( i ); id2 = CalculateWorstScore( i );
- format(string, sizeof string, "{008080}(War): {ffffff}%s failed to win turf %d owned by %s because they left the turf.", NumeFactiune( WarInfo[ i ][ wAttacker ] ), i, NumeFactiune( WarInfo[ i ][ wFaction ] ) );
- SendFactionMessage( attackers, -1, string);
- format(string, sizeof string, "{008080}(War): {ffffff}%s failed to win turf %d owned by %s because they left the turf.", NumeFactiune( WarInfo[ i ][ wAttacker ] ), i, NumeFactiune( WarInfo[ i ][ wFaction ] ) );
- SendFactionMessage( defenders, -1, string);
- format(string, sizeof string, "------------ [ war overview #%d ] ------------", warid );
- SendFactionMessage( attackers, COLOR_GREEN, string);
- format(string, sizeof string, "------------ [ war overview #%d ] ------------", warid );
- SendFactionMessage( defenders, COLOR_GREEN, string);
- format(string, sizeof string, "Score: %s %d - %d %s.", ( winner == 1 ) ? ( NumeFactiune( WarInfo[ i ][ wAttacker ] ) ) : ( NumeFactiune( WarInfo[ i ][ wFaction ] ) ), ( winner == 1 ) ? ( atscore ) : ( defscore ), ( winner == 1 ) ? ( defscore ) : ( atscore ), ( winner == 1 ) ? ( NumeFactiune( WarInfo[ i ][ wFaction ] ) ) : ( NumeFactiune( WarInfo[ i ][ wAttacker ] ) ) );
- SendFactionMessage( attackers, COLOR_GREEN, string);
- format(string, sizeof string, "Score: %s %d - %d %s.", ( winner == 1 ) ? ( NumeFactiune( WarInfo[ i ][ wAttacker ] ) ) : ( NumeFactiune( WarInfo[ i ][ wFaction ] ) ), ( winner == 1 ) ? ( atscore ) : ( defscore ), ( winner == 1 ) ? ( defscore ) : ( atscore ), ( winner == 1 ) ? ( NumeFactiune( WarInfo[ i ][ wFaction ] ) ) : ( NumeFactiune( WarInfo[ i ][ wAttacker ] ) ) );
- SendFactionMessage( defenders, COLOR_GREEN, string);
- format(string, sizeof string, "Best Score: %s with a score of %d (%d kills, %d deaths). Worst Score: %s with a score of %d (%d kills, %d deaths).", GetName( id ), ucideri[ id ][ i ] - decese[ id ][ i ], ucideri[ id ][ i ], decese[ id ][ i ], GetName( id2 ), ucideri[ id2 ][ i ] - decese[ id2 ][ i ], ucideri[ id2 ][ i ], decese[ id2 ][ i ] );
- SendFactionMessage( attackers, COLOR_GREEN, string);
- format(string, sizeof string, "Best Score: %s with a score of %d (%d kills, %d deaths). Worst Score: %s with a score of %d (%d kills, %d deaths).", GetName( id ), ucideri[ id ][ i ] - decese[ id ][ i ], ucideri[ id ][ i ], decese[ id ][ i ], GetName( id2 ), ucideri[ id2 ][ i ] - decese[ id2 ][ i ], ucideri[ id2 ][ i ], decese[ id2 ][ i ] );
- SendFactionMessage( defenders, COLOR_GREEN, string);
- foreach(new x : Player) {
- if( playerVariables[ x ][ pMember ] == attackers || playerVariables[ x ][ pMember ] == defenders ) {
- for( new j = 0; j != 5; j++ ) SendDeathMessageToPlayer( x, 1001, 1001, 1001 );
- format(string, sizeof string, "Your personal score: %d (%d kills, %d deaths).", ucideri[ x ][ i ] - decese[ x ][ i ], ucideri[ x ][ i ], decese[ x ][ i ] );
- SCM( x, COLOR_GREEN, string );
- PlayerTextDrawHide( x, TimeLeftWar1[ x ] );
- }
- }
- SendFactionMessage( attackers, COLOR_GREEN, "------------------------------------" );
- SendFactionMessage( defenders, COLOR_GREEN, "------------------------------------" );
- WarScoreF[ defenders ][ i ] = 0; WarScoreF[ attackers ][ i ] = 0; InWar[ attackers ] = 0; InWar[ defenders ] = 0;
- foreach(new x : Player) {
- if( playerVariables[ x ][ pMember ] == attackers || playerVariables[ x ][ pMember ] == defenders ) {
- SCM( x, COLOR_YELLOW, "Ai fost transferat in VW-ul 0." );
- if( GetPlayerInterior( x ) < 1 ) SetPlayerVirtualWorld( x, 0 );
- if( attackers == 4 || defenders == 4 || attackers == 5 || defenders == 5 || attackers == 6 || defenders == 6 || attackers == 10 || defenders == 10)
- if( attackers == 19 || defenders == 19 || attackers == 20 || defenders == 20 || attackers == 21 || defenders == 21 || attackers == 22 || defenders == 22 || attackers == 23 || defenders == 23) { for( new j = 0; j < sizeof VehicleInfo; j++ ) { if( VehicleInfo[ j ][ vehGroup ] == attackers || VehicleInfo[ j ][ vehGroup ] == defenders ) SetVehicleVirtualWorld( VehicleInfo[ j ][ vehCarID ], 0 ); } }
- mysql_format( SQL, gString, sizeof gString, "INSERT INTO `warlogs` (`PlayerID`,`WarID`,`Kills`,`Deaths`,`Faction`) VALUES ('%d','%d','%d','%d','%d')", playerVariables[ x ][ pSQLID ], warid, ucideri[ x ][ i ], decese[ x ][ i ], playerVariables[ x ][ pMember ] );
- mysql_tquery( SQL, gString, "", "" );
- ucideri[ x ][ i ] = 0; decese[ x ][ i ] = 0;
- }
- }
- DeelayWar[ WarInfo[ i ][ wFaction ] ] = 300; DeelayWar[ WarInfo[ i ][ wAttacker ] ] = 600; WarInfo[ i ][ wTime ] = 0; WarInfo[ i ][ wFaction ] = 0; WarInfo[ i ][ wAttacker ] = 0; worstscoreat[ i ] = 0; worstmemberat[ i ] = 999;
- bestscoreat[ i ] = 0; bestmemberat[ i ] = 999; worstscoredf[ i ] = 0; worstmemberdf[ i ] = 999; bestscoredf[ i ] = 0; bestmemberdf[ i ] = 999;
- }
- } else waitwar[ attackers ] = 60;
- }
- }
- }
- foreach(new i : Player)
- {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement