A hitmarker is the little x that pops up in your crosshairs when one of your bullets hits someone.
- Changing the color of the marker by body part or transport.
- Disabling the marker for weapons of transport.
- Play sound when hit
- Setting the position and size of the hitmarker.
Include in your code and begin using the library:
#include <hitmarker>CMD:Hitmarker(playerid)
{
if(HitmarkerStatus(playerid) == false)
{
HitmarkerEnabled(playerid);
// Setting the hit colors
HitmarkerColor(playerid, HITMARKER_BODYPART_TORSO, 0xFFFFFFFF);
HitmarkerColor(playerid, HITMARKER_BODYPART_GROIN, 0x7CFC00FF);
HitmarkerColor(playerid, HITMARKER_BODYPART_LEFT_ARM, 0xFFA500FF);
HitmarkerColor(playerid, HITMARKER_BODYPART_RIGHT_ARM, 0xFFD700FF);
HitmarkerColor(playerid, HITMARKER_BODYPART_LEFT_LEG, 0x00BFFFFF);
HitmarkerColor(playerid, HITMARKER_BODYPART_RIGHT_LEG, 0x00FFFFFF);
HitmarkerColor(playerid, HITMARKER_BODYPART_HEAD, 0xFF00FFFF);
HitmarkerColor(playerid, HITMARKER_KILLSHOTS, 0xFF0000FF);
HitmarkerColor(playerid, HITMARKER_VEHICLE_DAMAGE, 0xB03060FF);
HitmarkerEnableVehicleDamage(playerid, true);
HitmarkerDisableWeapon(playerid, WEAPON_BAT, true);
HitmarkerDisableWeapon(playerid, HITMARKER_AIR_VEHICLE_WEAPON_MINIGUN, true);
GameTextForPlayer(playerid, "Hitmarker ~g~~h~On", 1200, 4);
}
else
{
HitmarkerDisable(playerid);
GameTextForPlayer(playerid, "Hitmarker ~r~~h~Off", 1200, 4);
}
return 1;
}Click to expand the list
Enable hitmarker
playerid- The ID of the player
Disable hitmarker
playerid- The ID of the player
Get hitmarker status
playerid- The ID of the player- Return (true) if enabled or (false) if disabled
Set hitmarker color
playerid- The ID of the playertype- Color definitioncolor- The color to set. Supports alpha values.
Get hitmarker color
playerid- The ID of the playertype- Color definition- Returns the color
Disable the hitmarker for a specific weapon
playerid- The ID of the playerweaponid- Weapon IDsdisable-trueto disable /falseto enable- При отключении огневого оружия, отключается оружие (ID: 18, 37)
- При отключении взрывного оружия, отключается оружие (ID: 16, 35, 36, 39, 51) Не распространяется на воздушный транспорт.
Get hitmarker status for a certain weapon
playerid- The ID of the playerweaponid- Weapon IDs- Return (true) if disabled or (false) if enabled
Enable hit sound
playerid- The ID of the playersoundid- Sound IDs
Get current hit sound
playerid- The ID of the player- Returns sound ID
Set the marker position
playerid- The ID of the playercrosshair_type- Position determinationFloat:x- The X (left/right) coordinate to create the textdraw at.Float:y- The Y (up/down) coordinate to create the textdraw at.Float:size_x- WidthFloat:size_y- Height
Get current hitmarker position
playerid- The ID of the playercrosshair_type- Position determination&Float:x- The X (left/right) coordinate&Float:y- The Y (up/down) coordinate&Float:size_x- Width&Float:size_y- Height
Enable player damage indication
playerid- The ID of the playerenable-trueto enable /falseto disable- По стандарту включено
Get player damage status
playerid- The ID of the player- Return (true) if enabled or (false) if disabled
Enable vehicle damage indication
playerid- The ID of the playerenable-trueto enable /falseto disable
Get vehicle damage status
playerid- The ID of the player- Return (true) if enabled or (false) if disabled
Click to expand the list
| Definition | ID | Notes |
|---|---|---|
| HITMARKER_KILLSHOTS | 0 | The player died |
| HITMARKER_VEHICLE_DAMAGE | 1 | Transport damage |
| HITMARKER_BODYPART_TORSO | 3 | When hit on the torso |
| HITMARKER_BODYPART_GROIN | 4 | When hit in the groin |
| HITMARKER_BODYPART_LEFT_ARM | 5 | When hit on the left hand |
| HITMARKER_BODYPART_RIGHT_ARM | 6 | When hit on the right hand |
| HITMARKER_BODYPART_LEFT_LEG | 7 | When hit on the left leg |
| HITMARKER_BODYPART_RIGHT_LEG | 8 | When hit on the right leg |
| HITMARKER_BODYPART_HEAD | 9 | When hit on the headу |
HitmarkerColor(playerid, HITMARKER_BODYPART_TORSO, 0xFFFFFFFF);HitmarkerDisableWeapon(playerid, HITMARKER_AIR_VEHICLE_WEAPON_MINIGUN, true);| Definition | ID | Notes |
|---|---|---|
| HITMARKER_STANDARD_CROSSHAIR | 0 | Set standard position Used for firearms (ID: 22 - 33, 37 - 38) |
| HITMARKER_CENTRE_CROSSHAIR | 1 | Set the center position Used for melee weapons and vehicles |
HitmarkerPosition(playerid, HITMARKER_STANDARD_CROSSHAIR, 332.5, 172.5, 0.33, 0.7);
</details>