Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
      4. Frontier Pursuits
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA SA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA VC Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA III Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

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

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

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

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

    2. Forum Support

    3. Site Suggestions

Sign in to follow this  
darthbollo

[C#]

Am I stupid?  

10 members have voted

  1. 1. Am I stupid?

    • Yes
      0
    • You're retarded
    • No ;)


Recommended Posts

darthbollo
    void Bodyguard_Spawner(PedHash PedIndex, bool invincible, bool with_weapons)    {    Vector3 playerloc = player.Position + player.ForwardVector * 2;    int playergroup = Function.Call<int>(Hash.GET_PED_GROUP_INDEX, player.Handle);    List<Ped> Groupmember = new List<Ped>();    Ped bodyguardped = World.CreatePed(PedIndex, playerloc);    if (invincible == true)    {    bodyguardped.IsInvincible = true;    }    else    {    bodyguardped.IsInvincible = false;    }         if (with_weapons == true)    {    bodyguardped.Weapons.Give(GTA.Native.WeaponHash.AdvancedRifle, 3444, true, false);    bodyguardped.Weapons.Give(GTA.Native.WeaponHash.Bat, 0, false, false);    bodyguardped.Weapons.Give(GTA.Native.WeaponHash.Molotov, 10, false, false);    }         Groupmember.Add(bodyguardped);    bodyguardped.Task.ClearAllImmediately();    Function.Call(Hash.SET_PED_AS_GROUP_MEMBER, bodyguardped.Handle, playergroup);    if (player.IsInCombat == true)    {    Function.Call(Hash.TASK_COMBAT_HATED_TARGETS_IN_AREA, bodyguardped, 50000, 0);    }    if (player.IsDead == true)    {    for (int i = 0; i < Groupmember.Count; i++)    {    Groupmember[i].Kill();    }    }    }

My code wont spawn the bodyguard

Edited by darthbollo

Share this post


Link to post
Share on other sites
leftas

In World.CreatePed you need model and Vector3, not hash and Vector3.

So change like this.

 

World.CreatePed(new Model(PedIndex), playerloc);
All the best,

Paul.

Share this post


Link to post
Share on other sites
Cyron43

I haven't looked at your code as someone else helped you already but your idea with the poll is hilarious. :D:^:

Edited by Cyron43

Share this post


Link to post
Share on other sites
darthbollo

I haven't looked at your code as someone else helped you already but your idea with the poll is hilarious. :D:^:

xD 2 people voted that I'm retarded, I guess i am since i was putting the wrong arguments xD

In World.CreatePed you need model and Vector3, not hash and Vector3.

So change like this.

World.CreatePed(new Model(PedIndex), playerloc);
All the best,

Paul.

 

What do you mean by ped index you mean like

new Model(Hash.PedHash.Fabien)

?

?

Share this post


Link to post
Share on other sites
leftas

I'm not sure are you trolling or what...

PedIndex is your argument in Bodguard_Spawner function. In another thread you helped another guy how to use model, the f*ck dude ?

 

All the best,

Paul.

Share this post


Link to post
Share on other sites
darthbollo

I'm not sure are you trolling or what...

PedIndex is your argument in Bodguard_Spawner function. In another thread you helped another guy how to use model, the f*ck dude ?

 

All the best,

Paul.

So you want me to request the model of the ped index?

Share this post


Link to post
Share on other sites
leftas

You really trolling or just can't see your own parameters Types ?

Look first argument

void Bodyguard_Spawner(PedHash PedIndex, bool invincible, bool with_weapons)

What type it is ? let me help you: IT'S A PEDHASH, WHICH MEANS YOU NEED TO SELECT FROM ONE VALUE FROM ENUM OR TPYE BY YOURSELF AND CAST IT TO ENUM. IT ISN'T PED INDEX OR WHATEVER. YOU NEED TO DO SOMETHING LIKE THIS:

 Ped bodyguardPed = World.CreatePed(new Model(PedIndex), playerloc);   if(bodyguardPed != null || bodyguardPed.Exists()) // do your job. 

2. YOU ARE CREATING MEMORY LEAK, THANKS TO GARBAGE COLLERTOR YOU CAN'T DO THIS. THIS SHOULD BE GLOBAL

List<Ped> groupMembers = new List<Ped>();

3. YOU SHOULD READ ABOUT NAMING CONVETIONS.

 

To mods: Sorry, but I didn't have any choices left.

 

All the best,

Paul.

Share this post


Link to post
Share on other sites
darthbollo

You really trolling or just can't see your own parameters Types ?

Look first argument

void Bodyguard_Spawner(PedHash PedIndex, bool invincible, bool with_weapons)

What type it is ? let me help you: IT'S A PEDHASH, WHICH MEANS YOU NEED TO SELECT FROM ONE VALUE FROM ENUM OR TPYE BY YOURSELF AND CAST IT TO ENUM. IT ISN'T PED INDEX OR WHATEVER. YOU NEED TO DO SOMETHING LIKE THIS:

 Ped bodyguardPed = World.CreatePed(new Model(PedIndex), playerloc);   if(bodyguardPed != null || bodyguardPed.Exists()) // do your job. 

2. YOU ARE CREATING MEMORY LEAK, THANKS TO GARBAGE COLLERTOR YOU CAN'T DO THIS. THIS SHOULD BE GLOBAL

List<Ped> groupMembers = new List<Ped>();

3. YOU SHOULD READ ABOUT NAMING CONVETIONS.

 

To mods: Sorry, but I didn't have any choices left.

 

All the best,

Paul.

Wow! I got it to work No thanks to you.

Share this post


Link to post
Share on other sites
leftas

Wow, that's what you can only say ? Now next time I just gonna say: f*ck you, alright ?

You can f*ck off with your f*cking list which is worthless, because it's defined in f*cking function, which means - it's local... Oh yea, on top of that you also try to check if player dead, if it is, you delete all, excuse me, ONE ped in the list. Why the f*ck you bother with that list ? To f*ck performance, increase CPU instructions or memory, huh cowboy ?

 

Best f*ck to you,

Paul.

Share this post


Link to post
Share on other sites
darthbollo

Wow, that's what you can only say ? Now next time I just gonna say: f*ck you, alright ?

You can f*ck off with your f*cking list which is worthless, because it's defined in f*cking function, which means - it's local... Oh yea, on top of that you also try to check if player dead, if it is, you delete all, excuse me, ONE ped in the list. Why the f*ck you bother with that list ? To f*ck performance, increase CPU instructions or memory, huh cowboy ?

 

Best f*ck to you,

Paul.

Calm down buddy I was just being sarcastic......

 

So first all of there's need to rage I'm new to GTA scripting, and I was aiming to increase both CPU and memory stress; Thanks for noticing

 

All the Best,

David.

Share this post


Link to post
Share on other sites
leftas

 

Wow, that's what you can only say ? Now next time I just gonna say: f*ck you, alright ?

You can f*ck off with your f*cking list which is worthless, because it's defined in f*cking function, which means - it's local... Oh yea, on top of that you also try to check if player dead, if it is, you delete all, excuse me, ONE ped in the list. Why the f*ck you bother with that list ? To f*ck performance, increase CPU instructions or memory, huh cowboy ?

 

Best f*ck to you,

Paul.

Calm down buddy I was just being sarcastic......

 

So first all of there's need to rage I'm new to GTA scripting, and I was aiming to increase both CPU and memory stress; Thanks for noticing

 

All the Best,

David.

 

I didn't knew that you were sarcastic, as, I know newbies aren't so sarcastic, when it comes to programming. Why ? But why ? Of course that list making is a little "stress"(?), but

Little Things Can Make a Big Difference

 

Best wishes,

Paul.

 

 

 

Share this post


Link to post
Share on other sites
darthbollo

 

 

Wow, that's what you can only say ? Now next time I just gonna say: f*ck you, alright ?

You can f*ck off with your f*cking list which is worthless, because it's defined in f*cking function, which means - it's local... Oh yea, on top of that you also try to check if player dead, if it is, you delete all, excuse me, ONE ped in the list. Why the f*ck you bother with that list ? To f*ck performance, increase CPU instructions or memory, huh cowboy ?

 

Best f*ck to you,

Paul.

Calm down buddy I was just being sarcastic......

 

So first all of there's need to rage I'm new to GTA scripting, and I was aiming to increase both CPU and memory stress; Thanks for noticing

 

All the Best,

David.

 

I didn't knew that you were sarcastic, as, I know newbies aren't so sarcastic, when it comes to programming. Why ? But why ? Of course that list making is a little "stress"(?), but

Little Things Can Make a Big Difference

 

Best wishes,

Paul.

 

 

 

 

Well It's not like im spawning a huge list of 300000 peds so it shouldn't matter. also I use a list instead of an if statement because i almost never just spawn 1 ped.

Share this post


Link to post
Share on other sites
leftas

That list is worthless, you just creating it for one ped. You need to define it as global if you really access it more than one time with same peds.

 

All the best,

Paul.

Share this post


Link to post
Share on other sites
darthbollo

That list is worthless, you just creating it for one ped. You need to define it as global if you really access it more than one time with same peds.

 

All the best,

Paul.

Oh no I did declare it as global xD after you told me i declared it in a function i didn't notice it

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • 2 Users Currently Viewing
    0 members, 0 Anonymous, 2 Guests

×
×
  • Create New...

Important Information

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