Advertisement
Guest User

Untitled

a guest
Oct 6th, 2019
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 16.76 KB | None | 0 0
  1. task OtherTimer[1000]() {
  2. new attackers, defenders, count = 0, warid, atscore, defscore, winner, id, id2, string[256];
  3.  
  4. // Paintball arena
  5. if( painttime > 0 ) painttime --;
  6. for( new i = 0; i < 3; i++ ) {
  7. if( PaintText[ i ] != 0 ) {
  8. PaintText[ i ] --;
  9. if(PaintText[i] == 0) format(string, sizeof(string), "~w~Runda a inceput~n~Succes tuturor!");
  10. else format(string, sizeof(string), "~w~Runda incepe in ~n~~b~%d secunde", PaintText[i]);
  11. GameTextForPaint(string, i);
  12. }
  13. if( PlayersOnPaint( i ) >= 2 && PaintTime[ i ] > 0 ) {
  14. PaintTime[ i ] --;
  15. if( PaintTime[ i ] == 0 ) {
  16. SendPaintMessage( i + 1, COLOR_YELLOW, "Runda va incepe peste un minut. Pentru a vota o mapa, foolsiti comanda [/votemap]." );
  17. PaintVote[ i ] = 1;
  18. if( PaintTimer[ i ] != 0 ) KillTimer( PaintTimer[ i ] ), PaintTimer[ i ] = 0;
  19. PaintTimer[ i ] = SetTimerEx( "CalculateVote", 60000, false, "d", i );
  20. }
  21. }
  22. }
  23. for( new i = 1; i < sizeof Turfs; i++ ) {
  24. attackers = WarInfo[ i ][ wAttacker ]; defenders = WarInfo[ i ][ wFaction ];
  25. if( WarInfo[ i ][ wTime ] > 0 ) {
  26. WarInfo[ i ][ wTime ] --;
  27. 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 ] ); }
  28. if( WarInfo[ i ][ wTime ] == 1 ) {
  29. atscore = WarScoreF[ attackers ][ i ]; defscore = WarScoreF[ defenders ][ i ];
  30. foreach(new x : Player) { if( playerVariables[ x ][ pMember ] == attackers || playerVariables[ x ][ pMember ] == defenders ) GangZoneStopFlashForPlayer( x, Turfs[ i ] ); }
  31. if( atscore > defscore ) winner = 1;
  32. else winner = 2;
  33. if( atscore == defscore || atscore < defscore) winner = 2;
  34. switch(winner) {
  35. case 1: TurfInfo[ i ][ zOwned ] = WarInfo[ i ][ wAttacker ];
  36. case 2: TurfInfo[ i ][ zOwned ] = WarInfo[ i ][ wFaction ];
  37. }
  38. foreach(new x : Player) {
  39. if(TurfsDisp[x] == 1) {
  40. if(TurfInfo[i][zOwned] == 4) GangZoneShowForPlayerEx(x, Turfs[i], 0x18EBD6C8); //Los Aztecas
  41. if(TurfInfo[i][zOwned] == 5) GangZoneShowForPlayerEx(x, Turfs[i], 0x40863CAA); //Grove Street
  42. if(TurfInfo[i][zOwned] == 6) GangZoneShowForPlayerEx(x, Turfs[i], 0xFFAE00C8); //Los Vagos
  43. if(TurfInfo[i][zOwned] == 10) GangZoneShowForPlayerEx(x, Turfs[i], 0xBD1CDEC8); //Ballas
  44. if(TurfInfo[i][zOwned] == 19) GangZoneShowForPlayerEx(x, Turfs[i], 0x6A4444FF); //Rifa
  45. if(TurfInfo[i][zOwned] == 20) GangZoneShowForPlayerEx(x, Turfs[i], 0x2F2F2FFF); //Russian
  46. if(TurfInfo[i][zOwned] == 21) GangZoneShowForPlayerEx(x, Turfs[i], 0x660000AA); //Red
  47. if(TurfInfo[i][zOwned] == 22) GangZoneShowForPlayerEx(x, Turfs[i], 0x24FF0AB9); //italian
  48. if(TurfInfo[i][zOwned] == 23) GangZoneShowForPlayerEx(x, Turfs[i], 0x993300AA); //Biker
  49. }
  50. }
  51. format( gString, sizeof gString, "INSERT INTO `wars` (`Attacker`, `Defender`, `Atscore`, `Defscore`, `Result`) VALUES ('%d', '%d', '%d', '%d', '%d')", attackers, defenders, atscore, defscore, winner );
  52. new Cache: warcache = mysql_query( SQL, gString );
  53. warid = cache_insert_id( ); cache_delete( warcache );
  54. if( winner == 1 ) {
  55. mysql_format( SQL, gString, sizeof gString, "UPDATE `turfs` SET `Owned` = '%d' WHERE `ID` = '%d'", TurfInfo[ i ][ zOwned ], i );
  56. mysql_tquery( SQL, gString, "", "" );
  57.  
  58. }
  59. id = CalculateBestScore( i ); id2 = CalculateWorstScore( i );
  60. 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 ] ) ) );
  61. SendClientMessageToAll( COLOR_ORANGE, string);
  62. format(string, sizeof string, "------------ [ war overview #%d ] ------------", warid );
  63. SCM(attackers, COLOR_GREEN, string);
  64. format(string, sizeof string, "------------ [ war overview #%d ] ------------", warid );
  65. SCM(defenders, COLOR_GREEN, string);
  66. 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 ] ) ) );
  67. SCM(attackers, COLOR_GREEN, string);
  68. 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 ] ) ) );
  69. SCM(defenders, COLOR_GREEN, string);
  70. 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 ] );
  71. SCM(attackers, COLOR_GREEN, string);
  72. 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 ] );
  73. SCM(defenders, COLOR_GREEN, string);
  74.  
  75. foreach(new x : Player) {
  76. if( playerVariables[ x ][ pMember ] == attackers || playerVariables[ x ][ pMember ] == defenders ) {
  77. for( new j = 0; j != 5; j++ ) SendDeathMessageToPlayer( x, 1001, 1001, 1001 );
  78. format(string, sizeof string, "Your personal score: %d (%d kills, %d deaths).", ucideri[ x ][ i ] - decese[ x ][ i ], ucideri[ x ][ i ], decese[ x ][ i ] );
  79. SCM( x, COLOR_GREEN, string );
  80. PlayerTextDrawHide( x, TimeLeftWar1[ x ] ); }
  81. }
  82. SendFactionMessage( attackers, COLOR_GREEN, "------------------------------------" );
  83. SendFactionMessage( defenders, COLOR_GREEN, "------------------------------------" );
  84. WarScoreF[ attackers ][ i ] = 0; WarScoreF[ defenders ][ i ] = 0; InWar[ attackers ] = 0; InWar[ defenders ] = 0; waitwar[ attackers ] = 60; waitwar[ defenders ] = 60;
  85. foreach(new x : Player) {
  86. if( playerVariables[ x ][ pMember ] == attackers || playerVariables[ x ][ pMember ] == defenders ) {
  87. SCM( x, COLOR_YELLOW, "Ai fost transferat in VW-ul 0." );
  88. if( GetPlayerInterior( x ) < 1 ) SetPlayerVirtualWorld( x, 0 );
  89. if( attackers == 4 || defenders == 4 || attackers == 5 || defenders == 5 || attackers == 6 || defenders == 6 || attackers == 10 || defenders == 10)
  90. 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 ); } }
  91. 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 ] );
  92. mysql_tquery( SQL, gString, "", "" );
  93. ucideri[ x ][ i ] = 0; decese[ x ][ i ] = 0;
  94. }
  95. }
  96. if( winner == 1 ) {
  97. foreach(new x : Player) {
  98. if( TurfsDisp[ x ] == 1 ) {
  99. GangZoneHideForPlayerEx( x, Turfs[ i ] );
  100. if( attackers == 4 ) GangZoneShowForPlayerEx( x, Turfs[ i ], 0xCC000099 );
  101. if( attackers == 5 ) GangZoneShowForPlayerEx( x, Turfs[ i ], 0x40863CAA );
  102. if( attackers == 6 ) GangZoneShowForPlayerEx( x, Turfs[ i ], 0x2F2F2F99 );
  103. if( attackers == 10 ) GangZoneShowForPlayerEx( x, Turfs[ i ], 0x88572499 );
  104. if( attackers == 19 ) GangZoneShowForPlayerEx( x, Turfs[ i ], 0x6A4444FF ); //Rifa
  105. if( attackers == 20 ) GangZoneShowForPlayerEx( x, Turfs[ i ], 0x2F2F2FFF ); //Russian
  106. if( attackers == 21 ) GangZoneShowForPlayerEx( x, Turfs[ i ], 0x660000AA ); //Red
  107. if( attackers == 22 ) GangZoneShowForPlayerEx( x, Turfs[ i ], 0x24FF0AB9 ); //italian
  108. if( attackers == 23 ) GangZoneShowForPlayerEx( x, Turfs[ i ], 0x993300AA ); //Bikers
  109. }
  110. } DeelayWar[ WarInfo[ i ][ wFaction ] ] = 300; DeelayWar[ WarInfo[ i ][ wAttacker ] ] = 600;
  111. }
  112. if( winner == 2 ) DeelayWar[ WarInfo[ i ][ wFaction ] ] = 300, DeelayWar[ WarInfo[ i ][ wAttacker ] ] = 600;
  113. WarInfo[ i ][ wTime ] = 0; WarInfo[ i ][ wFaction ] = 0; WarInfo[ i ][ wAttacker ] = 0; worstscoreat[ i ] = 0; worstmemberat[ i ] = 999;
  114. bestscoreat[ i ] = 0; bestmemberat[ i ] = 999; worstscoredf[ i ] = 0; worstmemberdf[ i ] = 999; bestscoredf[ i ] = 0; bestmemberdf[ i ] = 999;
  115. }
  116. if( WarInfo[ i ][ wTime ] > 2 ) {
  117. foreach(new x : Player) {
  118. if( IsPlayerInTurf( x, i ) && IsPlayerInAnyVehicle( x ) ) {
  119. if( playerVariables[ x ][ pMember ] == attackers || playerVariables[ x ][ pMember ] == defenders ) {
  120. SCM( x, COLOR_WHITE, "Nu ai voie sa folosesti masini in war area." );
  121. SetVehicleToRespawnEx( GetPlayerVehicleID( x ) ); SetPlayerVirtualWorld( GetPlayerVehicleID( x ), 1024 );
  122. }
  123. }
  124. if( playerVariables[ x ][ pMember ] == attackers || playerVariables[ x ][ pMember ] == defenders ) {
  125. if( WarInfo[ i ][ wAttacker ] == 4 ) GangZoneFlashForPlayer( x, Turfs[ i ], 0xCC000099 );
  126. else if( WarInfo[ i ][ wAttacker ] == 5 ) GangZoneFlashForPlayer( x, Turfs[ i ], 0x66857399 );
  127. else if( WarInfo[ i ][ wAttacker ] == 6 ) GangZoneFlashForPlayer( x, Turfs[ i ], 0x2F2F2F99 );
  128. else if( WarInfo[ i ][ wAttacker ] == 10 ) GangZoneFlashForPlayer( x, Turfs[ i ], 0x88572499 );
  129. else if( WarInfo[ i ][ wAttacker ] == 19 ) GangZoneFlashForPlayer( x, Turfs[ i ], 0x6A4444FF );
  130. else if( WarInfo[ i ][ wAttacker ] == 20 ) GangZoneFlashForPlayer( x, Turfs[ i ], 0x2F2F2FFF );
  131. else if( WarInfo[ i ][ wAttacker ] == 21 ) GangZoneFlashForPlayer( x, Turfs[ i ], 0x660000AA );
  132. else if( WarInfo[ i ][ wAttacker ] == 22 ) GangZoneFlashForPlayer( x, Turfs[ i ], 0x24FF0AB9 );
  133. else if( WarInfo[ i ][ wAttacker ] == 23 ) GangZoneFlashForPlayer( x, Turfs[ i ], 0x993300AA ); }
  134. if( IsPlayerInTurf( x, i ) && playerVariables[ x ][ pMember ] == attackers ) count ++;
  135. }
  136. if( count < 1 ) {
  137. if( waitwar[ attackers ] > 0 ) waitwar[ attackers ] --;
  138. if( !waitwar[ attackers ] ) {
  139. waitwar[ attackers ] = 0; atscore = WarScoreF[ attackers ][ i ]; defscore = WarScoreF[ defenders ][ i ];
  140. foreach(new x : Player) { if( playerVariables[ x ][ pMember ] == attackers || playerVariables[ x ][ pMember ] == defenders ) GangZoneStopFlashForPlayer( x, Turfs[ i ] ); }
  141. if( atscore > defscore ) winner = 1;
  142. else winner = 2;
  143. if( atscore == defscore ) winner = 2;
  144. format( gString, sizeof gString, "INSERT INTO `wars` (`Attacker`,`Defender`,`Atscore`,`Defscore`,`Result`) VALUES ('%d','%d','%d','%d','3')", attackers, defenders, atscore, defscore );
  145. new Cache: warcache = mysql_query( SQL, gString );
  146. warid = cache_insert_id( ); cache_delete( warcache ); id = CalculateBestScore( i ); id2 = CalculateWorstScore( i );
  147. 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 ] ) );
  148. SendFactionMessage( attackers, -1, string);
  149. 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 ] ) );
  150. SendFactionMessage( defenders, -1, string);
  151. format(string, sizeof string, "------------ [ war overview #%d ] ------------", warid );
  152. SendFactionMessage( attackers, COLOR_GREEN, string);
  153.  
  154. format(string, sizeof string, "------------ [ war overview #%d ] ------------", warid );
  155. SendFactionMessage( defenders, COLOR_GREEN, string);
  156.  
  157. 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 ] ) ) );
  158. SendFactionMessage( attackers, COLOR_GREEN, string);
  159. 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 ] ) ) );
  160. SendFactionMessage( defenders, COLOR_GREEN, string);
  161. 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 ] );
  162. SendFactionMessage( attackers, COLOR_GREEN, string);
  163. 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 ] );
  164. SendFactionMessage( defenders, COLOR_GREEN, string);
  165. foreach(new x : Player) {
  166. if( playerVariables[ x ][ pMember ] == attackers || playerVariables[ x ][ pMember ] == defenders ) {
  167. for( new j = 0; j != 5; j++ ) SendDeathMessageToPlayer( x, 1001, 1001, 1001 );
  168. format(string, sizeof string, "Your personal score: %d (%d kills, %d deaths).", ucideri[ x ][ i ] - decese[ x ][ i ], ucideri[ x ][ i ], decese[ x ][ i ] );
  169. SCM( x, COLOR_GREEN, string );
  170. PlayerTextDrawHide( x, TimeLeftWar1[ x ] );
  171. }
  172. }
  173. SendFactionMessage( attackers, COLOR_GREEN, "------------------------------------" );
  174. SendFactionMessage( defenders, COLOR_GREEN, "------------------------------------" );
  175. WarScoreF[ defenders ][ i ] = 0; WarScoreF[ attackers ][ i ] = 0; InWar[ attackers ] = 0; InWar[ defenders ] = 0;
  176. foreach(new x : Player) {
  177. if( playerVariables[ x ][ pMember ] == attackers || playerVariables[ x ][ pMember ] == defenders ) {
  178. SCM( x, COLOR_YELLOW, "Ai fost transferat in VW-ul 0." );
  179. if( GetPlayerInterior( x ) < 1 ) SetPlayerVirtualWorld( x, 0 );
  180. if( attackers == 4 || defenders == 4 || attackers == 5 || defenders == 5 || attackers == 6 || defenders == 6 || attackers == 10 || defenders == 10)
  181. 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 ); } }
  182. 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 ] );
  183. mysql_tquery( SQL, gString, "", "" );
  184. ucideri[ x ][ i ] = 0; decese[ x ][ i ] = 0;
  185. }
  186. }
  187. 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;
  188. bestscoreat[ i ] = 0; bestmemberat[ i ] = 999; worstscoredf[ i ] = 0; worstmemberdf[ i ] = 999; bestscoredf[ i ] = 0; bestmemberdf[ i ] = 999;
  189. }
  190. } else waitwar[ attackers ] = 60;
  191. }
  192. }
  193. }
  194. foreach(new i : Player)
  195. {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement