Niko_boy

Untitled

Nov 8th, 2012
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 6.13 KB | None | 0 0
  1. //redefined MAX_PLAYERS to 20
  2.  
  3.     new Weapon_Names[][32] = {
  4.     {"Unarmed (Fist)"}, // 0
  5.     {"Brass Knuckles"}, // 1
  6.     {"Golf Club"}, // 2
  7.     {"Night Stick"}, // 3
  8.     {"Knife"}, // 4
  9.     {"Baseball Bat"}, // 5
  10.     {"Shovel"}, // 6
  11.     {"Pool Cue"}, // 7
  12.     {"Katana"}, // 8
  13.     {"Chainsaw"}, // 9
  14.     {"Purple Dildo"}, // 10
  15.     {"Big White Vibrator"}, // 11
  16.     {"Medium White Vibrator"}, // 12
  17.     {"Small White Vibrator"}, // 13
  18.     {"Flowers"}, // 14
  19.     {"Cane"}, // 15
  20.     {"Grenade"}, // 16
  21.     {"Teargas"}, // 17
  22.     {"Molotov"}, // 18
  23.     {" "}, // 19
  24.     {" "}, // 20
  25.     {" "}, // 21
  26.     {"Colt 45"}, // 22
  27.     {"Silenced"}, // 23
  28.     {"Deagle"}, // 24
  29.     {"Shotgun"}, // 25
  30.     {"Sawnoff"}, // 26
  31.     {"Spas12"}, // 27
  32.     {"Uzi"}, // 28
  33.     {"MP5"}, // 29
  34.     {"AK47"}, // 30
  35.     {"M4"}, // 31
  36.     {"Tec9"}, // 32
  37.     {"Rifle"}, // 33
  38.     {"Sniper"}, // 34
  39.     {"RPG"}, // 35
  40.     {"HS RPG"}, // 36
  41.     {"Flame"}, // 37
  42.     {"Minigun"}, // 38
  43.     {"Satchel Charge"}, // 39
  44.     {"Detonator"}, // 40
  45.     {"Spray Can"}, // 41
  46.     {"Fire Ext."}, // 42
  47.     {"Camera"}, // 43
  48.     {"NVG"}, // 44
  49.     {"IVG"}, // 45
  50.     {"Para."}, // 46
  51.     {"Fake Pistol"} ,// 47
  52.     {" "} ,// 48
  53.     {"Vehicle Collision"},//49
  54.     {"Heli Blades"},//50
  55.     {"Explosion"},//51
  56.     {" "},// 52
  57.     {"Drowned"},//53
  58.     {"Collsion"}//54
  59. };
  60.  
  61. #define DAMAGE_DISPLAY_TIME (3000)
  62.  
  63. new Text:DamageGivenTD[MAX_PLAYERS][4], Text:DamageTookTD[MAX_PLAYERS][4];
  64.  
  65. new pHits[MAX_PLAYERS][MAX_PLAYERS];
  66. new Float:pDamageAmt[MAX_PLAYERS][MAX_PLAYERS];
  67. new lastDamagedID[MAX_PLAYERS] = { INVALID_PLAYER_ID,...};
  68. new DamageDisplayTime[MAX_PLAYERS] = {0,...};
  69. new HideTD[MAX_PLAYERS];
  70. new ThisTD[MAX_PLAYERS][MAX_PLAYERS];
  71.  
  72. //---------------------------------
  73.  
  74. public OnFilterScriptInit()
  75. {
  76.     print("\n--------------------------------------");
  77.     print(" Blank Filterscript by your name here");
  78.     print("--------------------------------------\n");
  79.    
  80.    
  81.     for(new playerid = 0, slots=MAX_PLAYERS; playerid < slots; playerid++)
  82.     {
  83.         for( new x = 1; x < 4; x++ )//3 times
  84.         {
  85.             DamageGivenTD[playerid][x] = TextDrawCreate(230.0, 340.0 + ( 30.0 * x ), " ");
  86.             TextDrawLetterSize(DamageGivenTD[playerid][x], 0.24, 1.1);
  87.             TextDrawColor(DamageGivenTD[playerid][x], 0xCaCaCaFF);
  88.             TextDrawFont(DamageGivenTD[playerid][x], 1);
  89.             TextDrawSetShadow(DamageGivenTD[playerid][x], 0);
  90.             TextDrawAlignment(DamageGivenTD[playerid][x], 2);
  91.             TextDrawSetOutline(DamageGivenTD[playerid][x], 1);
  92.             TextDrawBackgroundColor(DamageGivenTD[playerid][x], 0x0000000F);
  93.  
  94.             DamageTookTD[playerid][x] = TextDrawCreate(340.0, 340.0 + ( 30.0 * x ), " ");
  95.             TextDrawLetterSize(DamageTookTD[playerid][x], 0.24, 1.1);
  96.             TextDrawColor(DamageTookTD[playerid][x], 0xDaDaDaFF);
  97.             TextDrawFont(DamageTookTD[playerid][x], 1);
  98.             TextDrawSetShadow(DamageTookTD[playerid][x], 0);
  99.             TextDrawAlignment(DamageTookTD[playerid][x], 2);
  100.             TextDrawSetOutline(DamageTookTD[playerid][x], 1);
  101.             TextDrawBackgroundColor(DamageTookTD[playerid][x], 0x0000000F);
  102.            
  103.             DamageR[playerid][x] = false;
  104.         }
  105.     }
  106.    
  107.     return 1;
  108. }
  109.  
  110. public OnFilterScriptExit()
  111. {
  112.     return 1;
  113. }
  114.  
  115. public OnPlayerConnect(playerid)
  116. {
  117.     ResetDamage(playerid);
  118.     return 1;
  119. }
  120.  
  121. public OnPlayerDisconnect(playerid, reason)
  122. {
  123.     return 1;
  124. }
  125.  
  126. public OnPlayerSpawn(playerid)
  127. {
  128.     return 1;
  129. }
  130.  
  131. public OnPlayerDeath(playerid, killerid, reason)
  132. {
  133.     return 1;
  134. }
  135.  
  136. public OnPlayerTakeDamage(playerid,issuerid,Float:amount,weaponid)
  137. {
  138.     new string[128], intd;
  139.     if( GetTickCount() - DamageDisplayTime[issuerid] < DAMAGE_DISPLAY_TIME )
  140.     {
  141.         KillTimer(HideTD[issuerid]);
  142.     }
  143.     if( lastDamagedID[issuerid] == playerid )
  144.     {
  145.         pHits[issuerid][playerid]++;
  146.         pDamageAmt[issuerid][playerid]  +=  amount;
  147.         format( string, sizeof(string), "-~g~%d  ~w~%s(~r~%s~w~) ~r~x%i", pDamageAmt[issuerid][playerid], GetName( playerid ), Weapon_Names[weaponid], pHits[issuerid][playerid] );
  148.         TextDrawSetString( DamageGivenTD[issuerid][1], string );
  149.         TextDrawHideForPlayer( issuerid, DamageGivenTD[issuerid][ ThisTD[issuerid][playerid]   ] );
  150.         TextDrawShowForPlayer( issuerid, DamageGivenTD[issuerid][1] );
  151.         intd = 1;
  152.         DamageR[issuerid][1] = true;
  153.         DamageR[issuerid][ ThisTD[issuerid][playerid] ] = false;
  154.     }
  155.     else
  156.     {
  157.         new count = -1;
  158.         for( new i = 1; i < 4; i++ )
  159.         {
  160.             if( DamageR[issuerid][i] == false )
  161.             {
  162.                 DamageR[issuerid][i] = true;
  163.                 count = i;
  164.                 break;
  165.             }
  166.         }
  167.         if( count )
  168.         {
  169.             format( string, sizeof(string), "-~g~%d  ~w~%s(~r~%s~w~) ~r~x%i", amount, GetName( playerid ), Weapon_Names[weaponid], 1 );
  170.             TextDrawSetString( DamageGivenTD[issuerid][count], string );
  171.             TextDrawHideForPlayer( issuerid, DamageGivenTD[issuerid][ count  ] );
  172.             TextDrawShowForPlayer( issuerid, DamageGivenTD[issuerid][count] );
  173.             intd = count;
  174.             DamageR[issuerid][count] = true;
  175.         }
  176.         else
  177.         {
  178.             for( new i = 1; i < 4; i++ )
  179.             {
  180.                 DamageR[issuerid][i] = false;
  181.                 TextDrawHideForPlayer( issuerid, DamageGivenTD[issuerid][i] );
  182.             }
  183.             format( string, sizeof(string), "-~g~%d  ~w~%s(~r~%s~w~) ~r~x%i", amount, GetName( playerid ), Weapon_Names[weaponid], 1 );
  184.             TextDrawSetString( DamageGivenTD[issuerid][1], string );
  185.             TextDrawHideForPlayer( issuerid, DamageGivenTD[issuerid][1] );
  186.             DamageR[issuerid][1] = true;
  187.             TextDrawShowForPlayer( issuerid, DamageGivenTD[issuerid][1] );
  188.             intd = 1;
  189.         }
  190.     }
  191.     ThisTD[issuerid][playerid] = intd;
  192.     lastDamagedID[issuerid] = playerid;
  193.     DamageDisplayTime[issuerid] = GetTickCount();
  194.     return HideTD[issuerid] = SetTimerEx("ResetDamage",DAMAGE_DISPLAY_TIME,false,"i",issuerid);
  195. }
  196.  
  197. forward ResetDamage(issuerid);
  198. public ResetDamage(issuerid)
  199. {
  200.     for( new i = 0; i < MAX_PLAYERS; i++ )
  201.     {
  202.         //TextDrawHideForPlayer( i, DamageTookTD[issuerid][ hitText[issuerid][i] ] );
  203.         TextDrawHideForPlayer( issuerid, DamageGivenTD[issuerid][1] );
  204.         TextDrawHideForPlayer( issuerid, DamageGivenTD[issuerid][2] );
  205.         TextDrawHideForPlayer( issuerid, DamageGivenTD[issuerid][3] );
  206.        
  207.         pHits[issuerid][i] = 0;
  208.         ThisTD[issuerid][i] = 0;
  209.         pDamageAmt[issuerid][i] = 0.0;
  210.     }
  211.     for( new j=1;j<4;j++) DamageR[issuerid][j] = false;
  212.     DamageDisplayTime[issuerid] = 0;
  213.     lastDamagedID[issuerid] = INVALID_PLAYER_ID;
  214.     KillTimer(HideTD[issuerid]);
  215. }
Advertisement
Add Comment
Please, Sign In to add comment