{"slug":"graphics/veg_modifier","category":"graphics","title":"Veg modifier","kind":"markdown","intro":"","body":"## Static veg modifiers\n\n**Static veg modifiers** remove or flatten grass, debris, bushes, snow etc.\n\n![veg_modifiers_example](https://femga.com:8080/images/samples/graphics/veg_modifier_01.jpg)\n![veg_modifiers_example](https://femga.com:8080/images/samples/graphics/veg_modifier_02.jpg)\n\n<h2>Veg Modifiers Flags</h2>\n\nVeg Modifier Flag Id | Veg Modifier Flag Name\n------------ | ----------------\n1 | Debris\n2 | Grass\n4 | Bush\n8 | Weed\n16 | Flower\n32 | Sapling\n64 | Tree\n128 | Rock\n256 | LongGrass\n\n<h2>Veg Modifier Types</h2>\n\nVeg Modifier Type Id | Veg Modifier Type Name\n------------ | ----------------\n1 | VMT_Cull\n2 | VMT_Flatten\n4 | VMT_FlattenDeepSurface\n8 | VMT_Explode\n16 | VMT_Push\n32 | VMT_Decal\n\n## Example of using:\n```lua\n\nlocal veg_modifier_sphere = 0\n\nif Citizen.InvokeNative(0x91AEF906BCA88877,0, 0x17BEC168) then   -- pressed E\n    if veg_modifier_sphere == nil or veg_modifier_sphere == 0 then\n\n\t\tlocal ped = PlayerPedId()\n\t\tlocal ped_coords = GetEntityCoords(ped)\n\t\tlocal x,y,z = table.unpack(ped_coords)\n\t\tlocal forward_fix = 5\n\t\tlocal forwardX=GetEntityForwardX(ped)\n\t\tlocal forwardY=GetEntityForwardY(ped)\n\t\tlocal veg_modifier_coords_x = x+(forwardX*forward_fix)\n\t\tlocal veg_modifier_coords_y = y+(forwardY*forward_fix)\n\t\tlocal veg_modifier_coords_z = z\n\n        local veg_radius = 3.0\n        local veg_Flags =  1 + 2 + 4 + 8 + 16 + 32 + 64 + 128 + 256   -- implement to all debris, grass, bush, etc...\n        local veg_ModType = 1 \t-- 1 | VMT_Cull\n\n        veg_modifier_sphere = Citizen.InvokeNative(0xFA50F79257745E74,veg_modifier_coords_x,veg_modifier_coords_y,veg_modifier_coords_z, veg_radius, veg_ModType, veg_Flags, 0);   -- ADD_VEG_MODIFIER_SPHERE\n\n    else\n        Citizen.InvokeNative(0x9CF1836C03FB67A2,Citizen.PointerValueIntInitialized(veg_modifier_sphere), 0);    -- REMOVE_VEG_MODIFIER_SPHERE\n        veg_modifier_sphere = 0\n    end\nend\n\n```","tables":[],"sourceUrl":"https://github.com/femga/rdr3_discoveries/tree/477aaaccadb7f0c042286611d9939009636cff12/graphics/veg_modifier","rows":[]}