Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- new hit[MAX_PLAYERS];
- new Float:damage[MAX_PLAYERS];
- new timerdamage[MAX_PLAYERS];
- new PlayerText:Indicator[MAX_PLAYERS];
- new PlayerText:IndicatorBox[MAX_PLAYERS];
- public OnPlayerConnect(playerid)
- {
- IndicatorBox[playerid] = CreatePlayerTextDraw(playerid, 538.444458, 392.753326, "usebox");
- PlayerTextDrawLetterSize(playerid, IndicatorBox[playerid], 0.000000, -2.584319);
- PlayerTextDrawTextSize(playerid, IndicatorBox[playerid], 622.444458, 0.000000);
- PlayerTextDrawAlignment(playerid, IndicatorBox[playerid], 1);
- PlayerTextDrawColor(playerid, IndicatorBox[playerid], 0);
- PlayerTextDrawUseBox(playerid, IndicatorBox[playerid], true);
- PlayerTextDrawBoxColor(playerid, IndicatorBox[playerid], 102);
- PlayerTextDrawSetShadow(playerid, IndicatorBox[playerid], 0);
- PlayerTextDrawFont(playerid, IndicatorBox[playerid], 0);
- Indicator[playerid] = CreatePlayerTextDraw(playerid, 540.000183, 374.826660, "Hit: 4 - 150 dmg");
- PlayerTextDrawLetterSize(playerid, Indicator[playerid], 0.227333, 1.346132);
- PlayerTextDrawAlignment(playerid, Indicator[playerid], 1);
- PlayerTextDrawColor(playerid, Indicator[playerid], -1);
- PlayerTextDrawSetShadow(playerid, Indicator[playerid], 0);
- PlayerTextDrawSetOutline(playerid, Indicator[playerid], 1);
- PlayerTextDrawBackgroundColor(playerid, Indicator[playerid], 51);
- PlayerTextDrawFont(playerid, Indicator[playerid], 1);
- PlayerTextDrawSetProportional(playerid, Indicator[playerid], 1);
- return 1;
- }
- public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid)
- {
- if(issuerid != INVALID_PLAYER_ID)
- {
- if(timerdamage[playerid] != 0) KillTimer(timerdamage[playerid]);
- hit[playerid]++;
- damage[playerid] += amount;
- timerdamage[playerid] = SetTimerEx("DamageReset", 3000, 0, "i", playerid);
- PlayerTextDrawShow(playerid, IndicatorBox[playerid]);
- PlayerTextDrawShow(playerid, Indicator[playerid]);
- new str[20];
- format(str,sizeof(str),"%d hit(s) %.0f dmg", hit[playerid], damage[playerid]);
- PlayerTextDrawSetString(playerid, Indicator[playerid], str);
- }
- return 1;
- }
- forward DamageReset(playerid);
- public DamageReset(playerid)
- {
- hit[playerid] = 0;
- damage[playerid] = 0;
- PlayerTextDrawHide(playerid, IndicatorBox[playerid]);
- PlayerTextDrawHide(playerid, Indicator[playerid]);
- KillTimer(timerdamage[playerid]);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment