24.01.2019, 17:05
HitMarker:
PHP код:
#include <a_samp>
static Text:aim_hit_td;
static aim_show[MAX_PLAYERS] = {false,...};
static const nweps[] =
{
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
34, 35, 39, 41, 42, 43
};
public OnFilterScriptInit()
{
aim_hit_td = TextDrawCreate(336.400512, 176.088546, "x");
TextDrawLetterSize(aim_hit_td, 0.263998, 0.629333);
TextDrawTextSize(aim_hit_td, -8.000000, 0.000000);
TextDrawAlignment(aim_hit_td, 1);
TextDrawColor(aim_hit_td, -16776961);
TextDrawSetShadow(aim_hit_td, 0);
TextDrawBackgroundColor(aim_hit_td, 255);
TextDrawFont(aim_hit_td, 1);
TextDrawSetProportional(aim_hit_td, 1);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
aim_show[playerid] = false;
return 1;
}
public OnFilterScriptExit()
{
TextDrawDestroy(aim_hit_td);
return 1;
}
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
for(new i = 0; i < sizeof(nweps); i++)
{
if(weaponid == nweps[i]) return 0;
}
if(issuerid != 0xFFFF && !IsPlayerNPC(issuerid) && !aim_show[issuerid])
{
TextDrawShowForPlayer(issuerid, aim_hit_td);
SetTimerEx("HideTD", 200, false, "i", issuerid);
aim_show[issuerid] = true;
}
return 0;
}
forward HideTD(playerid);
public HideTD(playerid)
{
TextDrawHideForPlayer(playerid, aim_hit_td);
aim_show[playerid] = false;
return 1;
}