Props8New Year Props
r_props_newyear Exports & Hooks
New Year Props server export Hold, the onHit server event and the CanHit hook.
Hold (server)
exports.r_props_newyear:Hold(source, 'thunder')| Parameter | Type | Description |
|---|---|---|
source | number | The player. |
kind | string | thunder, turbo, career, roman, magnum, sparkler, horn or popper. |
Puts the firework or party item in the player's hand without an item, for example as a reward or from your own
shop. Returns true when it is in the hand. The player lights it like a normal one.
onHit (server event)
AddEventHandler('r_props_newyear:onHit', function(shooter, netId, kind, direct)
print(('%s hit %s with %s'):format(shooter, netId, kind))
end)| Value | Description |
|---|---|
shooter | The player who fired. |
netId | Net id of the player ped, pedestrian or vehicle that was hit. |
kind | The firework, for example thunder. |
direct | true when the shot landed on it, false when it was near the burst. |
Use it for logs, police alerts or fines.
CanHit (hook)
bridge/sv_hooks.lua is open. Return false to stop a hit:
function Hooks.CanHit(src, entity, kind)
if GetEntityType(entity) == 1 and IsPedAPlayer(entity) then
return false
end
return true
endThis example lets fireworks hit vehicles and pedestrians but never players.