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

    2. News

    1. Red Dead Redemption 2

      1. News
      2. Red Dead Online
    1. GTA Online

      1. After Hours
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
    2. Crews

      1. Events
      2. Recruitment
    1. Grand Theft Auto Series

    2. GTA Next

    3. GTA V

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

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

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

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

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

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

      1. GTA Advance
      2. GTA 2
      3. GTA
    12. 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. Forum Support

    2. Site Suggestions

Sign in to follow this  
Zheung Yik

How to create a script which spawn weapon pickup

Recommended Posts

Zheung Yik

Title said everything

Share this post


Link to post
Share on other sites
Jitnaught

GTA IV or GTA V?

If IV, .NET Scripthook, C++ Scripthook, or SCOCL?

If .NET, then I believe the function is World.CreateWeaponPickup. I'm currently on my phone so I cannot confirm this.

Edited by LetsPlayOrDy

Share this post


Link to post
Share on other sites
Zheung Yik

GTA IV or GTA V?

If IV, .NET Scripthook, C++ Scripthook, or SCOCL?

If .NET, then I believe the function is World.CreateWeaponPickup. I'm currently on my phone so I cannot confirm this.

Gta iv. I will try world.createweaponpickup

 

But how can I determine the weapon type on the script and the location?

Share this post


Link to post
Share on other sites
byteMe420

here i made this a long time ago, you can have it...

void CreateRandomPickupAroundPlayer(){    Random random = new Random();    Pickup pickup = null;    int pickupSelection = random.Next(0, 3);    switch (pickupSelection)    {        case 0:            switch (episode == GameEpisode.GTAIV ? (random.Next(0, 9)) : episode == GameEpisode.TBOGT ? (random.Next(0, 2) == 0 ? random.Next(0, 9) : random.Next(9, 18)) : (random.Next(0, 2) == 0 ? random.Next(0, 9) : random.Next(18, 23)))            {                case 0: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.Handgun_DesertEagle, 500); break;                case 1: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.SMG_MP5, 500); break;                case 2: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.Shotgun_Baretta, 500); break;                case 3: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.Rifle_M4, 500); break;                case 4: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.Thrown_Grenade, 500); break;                case 5: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.Rifle_M4, 500); break;                case 6: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.Heavy_RocketLauncher, 500); break;                case 7: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.SniperRifle_M40A1, 500); break;                case 8: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.Thrown_Grenade, 500); break;                //tbogt                case 9: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.TBOGT_AdvancedMG, 600); break;                case 10: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.TBOGT_AdvancedSniper, 600); break;                case 11: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.TBOGT_AssaultSMG, 600); break;                case 12: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.TBOGT_ExplosiveShotgun, 600); break;                case 13: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.TBOGT_GoldenSMG, 600); break;                case 14: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.TBOGT_GrenadeLauncher, 600); break;                case 15: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.TBOGT_NormalShotgun, 600); break;                case 16: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.TBOGT_Pistol44, 600); break;                case 17: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.TBOGT_StickyBomb, 600); break;                //tlad                case 18: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.TLAD_AssaultShotgun, 600); break;                case 19: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.TLAD_Automatic9mm, 600); break;                case 20: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.TLAD_GrenadeLauncher, 600); break;                case 21: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.TLAD_PipeBomb, 600); break;                case 22: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.TLAD_SawedOffShotgun, 600); break;            }            break;        case 1:            pickup = Pickup.CreatePickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), "CJ_FIRST_AID_PICKUP", PickupType.Weapon);//health            break;        case 2:            pickup = Pickup.CreatePickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), 0x972daa10, PickupType.Weapon);//Armor            break;    }    if (!Game.Exists(pickup)) return;    Blip blip = pickup.AttachBlip();    blip.Name = pickupSelection == 0 ? "Weapon" : pickupSelection == 1 ? "Health" : "Armour";    blip.Color = pickupSelection == 0 ? BlipColor.Orange : pickupSelection == 1 ? BlipColor.LightRed : BlipColor.Cyan;//you can use BlipIcon if you like, I decided to just use colors for some reason    //pickupList.Add(pickup); pickupBlipList.Add(blip);//you can track what you create by creating lists if you want to refer to them later}
Edited by byteMe420

Share this post


Link to post
Share on other sites
Scrumilation

 

here i made this a long time ago, you can have it...

void CreateRandomPickupAroundPlayer(){    Random random = new Random();    Pickup pickup = null;    int pickupSelection = random.Next(0, 3);    switch (pickupSelection)    {        case 0:            switch (episode == GameEpisode.GTAIV ? (random.Next(0, 9)) : episode == GameEpisode.TBOGT ? (random.Next(0, 2) == 0 ? random.Next(0, 9) : random.Next(9, 18)) : (random.Next(0, 2) == 0 ? random.Next(0, 9) : random.Next(18, 23)))            {                case 0: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.Handgun_DesertEagle, 500); break;                case 1: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.SMG_MP5, 500); break;                case 2: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.Shotgun_Baretta, 500); break;                case 3: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.Rifle_M4, 500); break;                case 4: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.Thrown_Grenade, 500); break;                case 5: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.Rifle_M4, 500); break;                case 6: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.Heavy_RocketLauncher, 500); break;                case 7: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.SniperRifle_M40A1, 500); break;                case 8: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.Thrown_Grenade, 500); break;                //tbogt                case 9: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.TBOGT_AdvancedMG, 600); break;                case 10: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.TBOGT_AdvancedSniper, 600); break;                case 11: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.TBOGT_AssaultSMG, 600); break;                case 12: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.TBOGT_ExplosiveShotgun, 600); break;                case 13: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.TBOGT_GoldenSMG, 600); break;                case 14: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.TBOGT_GrenadeLauncher, 600); break;                case 15: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.TBOGT_NormalShotgun, 600); break;                case 16: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.TBOGT_Pistol44, 600); break;                case 17: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.TBOGT_StickyBomb, 600); break;                //tlad                case 18: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.TLAD_AssaultShotgun, 600); break;                case 19: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.TLAD_Automatic9mm, 600); break;                case 20: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.TLAD_GrenadeLauncher, 600); break;                case 21: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.TLAD_PipeBomb, 600); break;                case 22: pickup = Pickup.CreateWeaponPickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), Weapon.TLAD_SawedOffShotgun, 600); break;            }            break;        case 1:            pickup = Pickup.CreatePickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), "CJ_FIRST_AID_PICKUP", PickupType.Weapon);//health            break;        case 2:            pickup = Pickup.CreatePickup(Game.LocalPlayer.Character.Position.Around(random.Next(15, 25)).ToGround(), 0x972daa10, PickupType.Weapon);//Armor            break;    }    if (!Game.Exists(pickup)) return;    Blip blip = pickup.AttachBlip();    blip.Name = pickupSelection == 0 ? "Weapon" : pickupSelection == 1 ? "Health" : "Armour";    blip.Color = pickupSelection == 0 ? BlipColor.Orange : pickupSelection == 1 ? BlipColor.LightRed : BlipColor.Cyan;//you can use BlipIcon if you like, I decided to just use colors for some reason    //pickupList.Add(pickup); pickupBlipList.Add(blip);//you can track what you create by creating lists if you want to refer to them later}

what are arrays

baby dont hurt me

no more

Share this post


Link to post
Share on other sites
yoloman

So this script spawns a random weapon on an random location? And if so, when it spawns the next weapon if you picked up the previous before?

Share this post


Link to post
Share on other sites
alialherk

ALLAH AKBAR!!!

 

#E

Edited by alialherk

Share this post


Link to post
Share on other sites
yoloman

push

Share this post


Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

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