{"hash":"0xAC0631C9","ns":"CFX","name":"TASK_SHOOT_AT_ENTITY","slug":"TASK_SHOOT_AT_ENTITY","official":true,"named":true,"luaName":"TaskShootAtEntity","game":"cfx","apiset":"server","returnType":"void","params":[{"name":"entity","type":"Entity"},{"name":"target","type":"Entity"},{"name":"duration","type":"int"},{"name":"firingPattern","type":"Hash"}],"summary":"Entity aimedentity; Player player = PLAYER::PLAYER_ID(); in practical usage, getting the entity the player is aiming at and then task the peds to shoot at the entity, at a button press event would be better.","descriptions":[{"source":"cfx","format":"md","body":"```\n//this part of the code is to determine at which entity the player is aiming, for example if you want to create a mod where you give orders to peds\nEntity aimedentity;\nPlayer player = PLAYER::PLAYER_ID();\nPLAYER::_GET_AIMED_ENTITY(player, &aimedentity);\n//bg is an array of peds\nTASK::TASK_SHOOT_AT_ENTITY(bg[i], aimedentity, 5000, MISC::GET_HASH_KEY(\"FIRING_PATTERN_FULL_AUTO\"));\nin practical usage, getting the entity the player is aiming at and then task the peds to shoot at the entity, at a button press event would be better.\nFiring Pattern Hash Information: https://pastebin.com/Px036isB\n```\n\n**This is the server-side RPC native equivalent of the client native [TASK_SHOOT_AT_ENTITY](?\\_0x08DA95E8298AE772).**"}],"examples":[],"aliases":[],"enums":[],"related":[],"sources":["cfx"],"doc":2,"url":"https://natives.borderlinerp.com/natives/CFX/TASK_SHOOT_AT_ENTITY","markdownUrl":"https://natives.borderlinerp.com/natives/CFX/TASK_SHOOT_AT_ENTITY.md","snippets":{"lua":"TaskShootAtEntity(entity, target, duration, firingPattern)","luaInvoke":"Citizen.InvokeNative(0xac0631c9, entity, target, duration, firingPattern)","js":"TaskShootAtEntity(entity, target, duration, firingPattern);","jsInvoke":"Citizen.invokeNative('0xac0631c9', entity, target, duration, firingPattern);","csharp":"Function.Call((Hash)0xac0631c9, entity, target, duration, firingPattern);","notes":["Hash parameters: the named function also accepts a string and hashes it for you; `Citizen.InvokeNative` needs the number — pass `joaat(\"name\")` or a backtick literal like `` `name` ``."]}}