2024-03-03, 04:29 PM
(2023-12-28, 01:30 PM)ZynxLinclon Wrote: Hi i'm curious how to detect collision when bullet hit an object in samp like have a print like "You hit a object"
Here is an example
PHP Code:
forward OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if (hittype == BULLET_HIT_TYPE_OBJECT)
{
SendClientMessage(playerid, COLOR_YELLOW, "You hit an object!");
// You can add further actions here if needed
}
return 1;
}