Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

Happy Holidays from the GTANet team!

c# Add_decal help!


NModds
 Share

Recommended Posts

Hi all,

 

I am very new to c#/scripthookdotnetV, I started coding with lua, which doesn't even need variables to be declared like c#. Add_decal worked for me when I used lua, but I can't seem to get it to work for c#. Any help would be appreciated.

 

GRAPHICS.ADD_DECAL(int decalType, float posX, float posY, float posZ, float p4, float p5, float p6, float p7, float p8, float p9, float width, float height, float rCoef, float gCoef, float bCoef, float opacity, float timeout, BOOL p17, BOOL p18, BOOL p19)

 

And thanks to JulioNib, we have the decalType:

 

 

decal types:

public enum DecalTypes
{
splatters_blood = 1010,
splatters_blood_dir = 1015,
splatters_blood_mist = 1017,
splatters_mud = 1020,
splatters_paint = 1030,
splatters_water = 1040,
splatters_water_hydrant = 1050,
splatters_blood2 = 1110,
weapImpact_metal = 4010,
weapImpact_concrete = 4020,
weapImpact_mattress = 4030,
weapImpact_mud = 4032,
weapImpact_wood = 4050,
weapImpact_sand = 4053,
weapImpact_cardboard = 4040,
weapImpact_melee_glass = 4100,
weapImpact_glass_blood = 4102,
weapImpact_glass_blood2 = 4104,
weapImpact_shotgun_paper = 4200,
weapImpact_shotgun_mattress,
weapImpact_shotgun_metal,
weapImpact_shotgun_wood,
weapImpact_shotgun_dirt,
weapImpact_shotgun_tvscreen,
weapImpact_shotgun_tvscreen2,
weapImpact_shotgun_tvscreen3,
weapImpact_melee_concrete = 4310,
weapImpact_melee_wood = 4312,
weapImpact_melee_metal = 4314,
burn1 = 4421,
burn2,
burn3,
burn4,
burn5,
bang_concrete_bang = 5000,
bang_concrete_bang2,
bang_bullet_bang,
bang_bullet_bang2 = 5004,
bang_glass = 5031,
bang_glass2,
solidPool_water = 9000,
solidPool_blood,
solidPool_oil,
solidPool_petrol,
solidPool_mud,
porousPool_water,
porousPool_blood,
porousPool_oil,
porousPool_petrol,
porousPool_mud,
porousPool_water_ped_drip,
liquidTrail_water = 9050
}

 

 

Link to comment
Share on other sites

stillhere

Hi all,

 

I am very new to c#/scripthookdotnetV, I started coding with lua, which doesn't even need variables to be declared like c#. Add_decal worked for me when I used lua, but I can't seem to get it to work for c#. Any help would be appreciated.

 

GRAPHICS.ADD_DECAL(int decalType, float posX, float posY, float posZ, float p4, float p5, float p6, float p7, float p8, float p9, float width, float height, float rCoef, float gCoef, float bCoef, float opacity, float timeout, BOOL p17, BOOL p18, BOOL p19)

 

You can use this method:

 

void AddDecal(Vector3 pos, DecalTypes decalType, float width = 1.0f, float height = 1.0f, float rCoef = 0.1f, float gCoef = 0.1f, float bCoef = 0.1f, float opacity = 1.0f, float timeout = 20.0f)        {            Function.Call<int>(Hash.ADD_DECAL, (int)decalType, pos.X, pos.Y, pos.Z, 0, 0, -1.0, 0, 1.0, 0, width, height, rCoef, gCoef, bCoef, opacity, timeout, 0, 0, 0);        }
And call it like so:
AddDecal(position, DecalTypes.bang_concrete_bang2, 10f, 10f);
if you want to place a decal on the ground, you can use these together:
void AddDecal(Vector3 pos, DecalTypes decalType, float width = 1.0f, float height = 1.0f, float rCoef = 0.1f, float gCoef = 0.1f, float bCoef = 0.1f, float opacity = 1.0f, float timeout = 20.0f)        {            Function.Call<int>(Hash.ADD_DECAL, (int)decalType, pos.X, pos.Y, GetGroundZ(pos), 0, 0, -1.0, 0, 1.0, 0, width, height, rCoef, gCoef, bCoef, opacity, timeout, 0, 0, 0);        }float GetGroundZ(Vector3 pos) //thanks Jitnaught!        {            OutputArgument outArg = new OutputArgument();            Function.Call<bool>(Hash.GET_GROUND_Z_FOR_3D_COORD, pos.X, pos.Y, pos.Z, outArg, false);            return outArg.GetResult<float>();        }
  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.