Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //redefined MAX_PLAYERS to 20
- new Weapon_Names[][32] = {
- {"Unarmed (Fist)"}, // 0
- {"Brass Knuckles"}, // 1
- {"Golf Club"}, // 2
- {"Night Stick"}, // 3
- {"Knife"}, // 4
- {"Baseball Bat"}, // 5
- {"Shovel"}, // 6
- {"Pool Cue"}, // 7
- {"Katana"}, // 8
- {"Chainsaw"}, // 9
- {"Purple Dildo"}, // 10
- {"Big White Vibrator"}, // 11
- {"Medium White Vibrator"}, // 12
- {"Small White Vibrator"}, // 13
- {"Flowers"}, // 14
- {"Cane"}, // 15
- {"Grenade"}, // 16
- {"Teargas"}, // 17
- {"Molotov"}, // 18
- {" "}, // 19
- {" "}, // 20
- {" "}, // 21
- {"Colt 45"}, // 22
- {"Silenced"}, // 23
- {"Deagle"}, // 24
- {"Shotgun"}, // 25
- {"Sawnoff"}, // 26
- {"Spas12"}, // 27
- {"Uzi"}, // 28
- {"MP5"}, // 29
- {"AK47"}, // 30
- {"M4"}, // 31
- {"Tec9"}, // 32
- {"Rifle"}, // 33
- {"Sniper"}, // 34
- {"RPG"}, // 35
- {"HS RPG"}, // 36
- {"Flame"}, // 37
- {"Minigun"}, // 38
- {"Satchel Charge"}, // 39
- {"Detonator"}, // 40
- {"Spray Can"}, // 41
- {"Fire Ext."}, // 42
- {"Camera"}, // 43
- {"NVG"}, // 44
- {"IVG"}, // 45
- {"Para."}, // 46
- {"Fake Pistol"} ,// 47
- {" "} ,// 48
- {"Vehicle Collision"},//49
- {"Heli Blades"},//50
- {"Explosion"},//51
- {" "},// 52
- {"Drowned"},//53
- {"Collsion"}//54
- };
- #define DAMAGE_DISPLAY_TIME (3000)
- new Text:DamageGivenTD[MAX_PLAYERS][4], Text:DamageTookTD[MAX_PLAYERS][4];
- new pHits[MAX_PLAYERS][MAX_PLAYERS];
- new Float:pDamageAmt[MAX_PLAYERS][MAX_PLAYERS];
- new lastDamagedID[MAX_PLAYERS] = { INVALID_PLAYER_ID,...};
- new DamageDisplayTime[MAX_PLAYERS] = {0,...};
- new HideTD[MAX_PLAYERS];
- new ThisTD[MAX_PLAYERS][MAX_PLAYERS];
- //---------------------------------
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Blank Filterscript by your name here");
- print("--------------------------------------\n");
- for(new playerid = 0, slots=MAX_PLAYERS; playerid < slots; playerid++)
- {
- for( new x = 1; x < 4; x++ )//3 times
- {
- DamageGivenTD[playerid][x] = TextDrawCreate(230.0, 340.0 + ( 30.0 * x ), " ");
- TextDrawLetterSize(DamageGivenTD[playerid][x], 0.24, 1.1);
- TextDrawColor(DamageGivenTD[playerid][x], 0xCaCaCaFF);
- TextDrawFont(DamageGivenTD[playerid][x], 1);
- TextDrawSetShadow(DamageGivenTD[playerid][x], 0);
- TextDrawAlignment(DamageGivenTD[playerid][x], 2);
- TextDrawSetOutline(DamageGivenTD[playerid][x], 1);
- TextDrawBackgroundColor(DamageGivenTD[playerid][x], 0x0000000F);
- DamageTookTD[playerid][x] = TextDrawCreate(340.0, 340.0 + ( 30.0 * x ), " ");
- TextDrawLetterSize(DamageTookTD[playerid][x], 0.24, 1.1);
- TextDrawColor(DamageTookTD[playerid][x], 0xDaDaDaFF);
- TextDrawFont(DamageTookTD[playerid][x], 1);
- TextDrawSetShadow(DamageTookTD[playerid][x], 0);
- TextDrawAlignment(DamageTookTD[playerid][x], 2);
- TextDrawSetOutline(DamageTookTD[playerid][x], 1);
- TextDrawBackgroundColor(DamageTookTD[playerid][x], 0x0000000F);
- DamageR[playerid][x] = false;
- }
- }
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- ResetDamage(playerid);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- return 1;
- }
- public OnPlayerTakeDamage(playerid,issuerid,Float:amount,weaponid)
- {
- new string[128], intd;
- if( GetTickCount() - DamageDisplayTime[issuerid] < DAMAGE_DISPLAY_TIME )
- {
- KillTimer(HideTD[issuerid]);
- }
- if( lastDamagedID[issuerid] == playerid )
- {
- pHits[issuerid][playerid]++;
- pDamageAmt[issuerid][playerid] += amount;
- 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] );
- TextDrawSetString( DamageGivenTD[issuerid][1], string );
- TextDrawHideForPlayer( issuerid, DamageGivenTD[issuerid][ ThisTD[issuerid][playerid] ] );
- TextDrawShowForPlayer( issuerid, DamageGivenTD[issuerid][1] );
- intd = 1;
- DamageR[issuerid][1] = true;
- DamageR[issuerid][ ThisTD[issuerid][playerid] ] = false;
- }
- else
- {
- new count = -1;
- for( new i = 1; i < 4; i++ )
- {
- if( DamageR[issuerid][i] == false )
- {
- DamageR[issuerid][i] = true;
- count = i;
- break;
- }
- }
- if( count )
- {
- format( string, sizeof(string), "-~g~%d ~w~%s(~r~%s~w~) ~r~x%i", amount, GetName( playerid ), Weapon_Names[weaponid], 1 );
- TextDrawSetString( DamageGivenTD[issuerid][count], string );
- TextDrawHideForPlayer( issuerid, DamageGivenTD[issuerid][ count ] );
- TextDrawShowForPlayer( issuerid, DamageGivenTD[issuerid][count] );
- intd = count;
- DamageR[issuerid][count] = true;
- }
- else
- {
- for( new i = 1; i < 4; i++ )
- {
- DamageR[issuerid][i] = false;
- TextDrawHideForPlayer( issuerid, DamageGivenTD[issuerid][i] );
- }
- format( string, sizeof(string), "-~g~%d ~w~%s(~r~%s~w~) ~r~x%i", amount, GetName( playerid ), Weapon_Names[weaponid], 1 );
- TextDrawSetString( DamageGivenTD[issuerid][1], string );
- TextDrawHideForPlayer( issuerid, DamageGivenTD[issuerid][1] );
- DamageR[issuerid][1] = true;
- TextDrawShowForPlayer( issuerid, DamageGivenTD[issuerid][1] );
- intd = 1;
- }
- }
- ThisTD[issuerid][playerid] = intd;
- lastDamagedID[issuerid] = playerid;
- DamageDisplayTime[issuerid] = GetTickCount();
- return HideTD[issuerid] = SetTimerEx("ResetDamage",DAMAGE_DISPLAY_TIME,false,"i",issuerid);
- }
- forward ResetDamage(issuerid);
- public ResetDamage(issuerid)
- {
- for( new i = 0; i < MAX_PLAYERS; i++ )
- {
- //TextDrawHideForPlayer( i, DamageTookTD[issuerid][ hitText[issuerid][i] ] );
- TextDrawHideForPlayer( issuerid, DamageGivenTD[issuerid][1] );
- TextDrawHideForPlayer( issuerid, DamageGivenTD[issuerid][2] );
- TextDrawHideForPlayer( issuerid, DamageGivenTD[issuerid][3] );
- pHits[issuerid][i] = 0;
- ThisTD[issuerid][i] = 0;
- pDamageAmt[issuerid][i] = 0.0;
- }
- for( new j=1;j<4;j++) DamageR[issuerid][j] = false;
- DamageDisplayTime[issuerid] = 0;
- lastDamagedID[issuerid] = INVALID_PLAYER_ID;
- KillTimer(HideTD[issuerid]);
- }
Advertisement
Add Comment
Please, Sign In to add comment