Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Criminal Enterprises
      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

*DO NOT* SHARE MEDIA OR LINKS TO LEAKED COPYRIGHTED MATERIAL. Discussion is allowed.

Pickup issues


masternewport
 Share

Recommended Posts

masternewport

Hello all,

 

I recently found out how to spawn adrenaline in GTA San Andreas,

 

So far i have spawned them in bars and club with no problems whatsoever,

 

I'm now trying to make 24/7 shops more useful by trying to spawn in police bribes, health and adrenaline the same way as before,

 

When i first walk in an 24/7 shop the pickups are all there but when i walk out the shop and go back in they all disappear,

 

Even if i don't pickup any of the pickups they will disappear when i walk out and back in,

 

I can re load the game and they will return but they will keep disappearing every time i re enter the 24/7 shops,

 

Anyone have any idea how to stop them from disappearing?

 

Here is a copy of my script below:

 

{$VERSION 3.1.0027}

{$CLEO .cs}

 

//-------------MAIN---------------

thread 'SHOP'

$HEALTH = Pickup.Create(1241, 2, -35.2222, -49.9957, 1003.547)

$HEALTH = Pickup.Create(1240, 2, -19.3367, -49.9272, 1003.547)

$HEALTH = Pickup.Create(1247, 2, -27.6212, -52.2661, 1003.547)

0A93: end_custom_thread

 

 

Any help will be much appreciated and if you are able to help you're more than welcome to use my script

 

 

Kind Regards,

 

Aaron

Link to comment
Share on other sites

Ashwin.Star

Don't just create them & Leave like this,

 

I don't know what the exact problem is

Guess : Change in Interior !

 

but

You may make a Loop script which will create them when you enter the Shop & Destroy them when you Leave,

Link to comment
Share on other sites

masternewport

Thanks for your reply,

 

Sounds like a good idea i'm not really that good of a modder

 

So forgive me if i'm sounding stupid but how would i make it so it creates the pickups when i enter and destroys them when i leave?

Link to comment
Share on other sites

The pickup type (2) specifies their spawning habits.

Link to comment
Share on other sites

masternewport

Thanks arjitsen good to hear from you again smile.gif

 

I tried that it doesn't seem to have made a difference sad.gif

 

Thanks for trying anyway do you have anymore ideas?

Link to comment
Share on other sites

masternewport

Hey Deji thanks for your reply

 

I've tried changing the type to 15 so it re grows every time it gets picked up but the same things happens again,

 

I walk out and go back in and they all disappear

Link to comment
Share on other sites

It's a pretty simple procedure and quite frankly I'm surprised nobody has helped you thus far.

 

Here's the script with a loop added:

 

 

{$CLEO}0000::1wait 0$HEALTH = Pickup.Create(1241, 2, -35.2222, -49.9957, 1003.547)$HEALTH1 = Pickup.Create(1240, 2, -19.3367, -49.9272, 1003.547)$HEALTH2 = Pickup.Create(1247, 2, -27.6212, -52.2661, 1003.547)jump @1

 

 

You need to add checks to see if the Pickups have been picked up before creating them again, this script doesn't do that because I don't have Sanny Builder or San Andreas installed at the moment, this was scripted from the knowledge of my terrible memory.

Edited by The_Sorrow
Link to comment
Share on other sites

God kills a kitten, every time someone uses a global variable in cleo script.

I don't like Kittens anyway.

 

But the global variables can be changed into locals easily.

Link to comment
Share on other sites

TheGodfather.

Let's not sacrifice the kittens so better use this:

 

 

{$CLEO}0000::1wait [email protected] = Pickup.Create(1241, 2, -35.2222, -49.9957, 1003.547)[email protected] = Pickup.Create(1240, 2, -19.3367, -49.9272, 1003.547)[email protected] = Pickup.Create(1247, 2, -27.6212, -52.2661, 1003.547)jump @1

 

 

That's the same thing which I told you earlier I guess you misunderstood me.

Link to comment
Share on other sites

If you create the pickups in this manner using loops, the pickups memory block will be filled up very soon, so new pickups either will not be created at all, or created incorrectly.

Edited by Seemann
Link to comment
Share on other sites

masternewport

 

Let's not sacrifice the kittens so better use this:

 

 

{$CLEO}0000::1wait [email protected] = Pickup.Create(1241, 2, -35.2222, -49.9957, 1003.547)[email protected] = Pickup.Create(1240, 2, -19.3367, -49.9272, 1003.547)[email protected] = Pickup.Create(1247, 2, -27.6212, -52.2661, 1003.547)jump @1

 

 

That's the same thing which I told you earlier I guess you misunderstood me.

Totally works i'm impressed guys i really am smile.gif

 

Thank you all so much for your help i massively appreciate it,

 

I've recently just got home from a stressful day at work and now my script is fixed you've all just made my day biggrin.gif

 

Thank you again!

 

The only thing left in my game to make it absolutely perfect is the ability to rob the 24/7 stores. But i know someone who's working on a mod like that. They know who they are wink.gif

 

Kind regards,

 

Aaron

Link to comment
Share on other sites

masternewport

I've now encountered a new problem after using the script it seems that when i kill a ped or cop money or weapons don't seem to spawn anymore as a previous comment said earlier this might happen sad.gif is there anything i can do??

 

Here's a copy of my script

 

{$VERSION 3.1.0027}

{$CLEO .cs}

 

//-------------MAIN---------------

0000: NOP

 

:NONAME_2

wait 0

[email protected] = Pickup.Create(1241, 2, -35.2222, -49.9957, 1003.547)

[email protected] = Pickup.Create(1240, 2, -19.3367, -49.9272, 1003.547)

[email protected] = Pickup.Create(323, 2, -27.6212, -52.2661, 1003.547)

[email protected] = Pickup.Create(1241, 2, -36.6742, -86.334, 1003.547)

[email protected] = Pickup.Create(1240, 2, -16.1988, -83.7933, 1003.547)

[email protected] = Pickup.Create(323, 2, -22.7131, -75.3089, 1003.547)

[email protected] = Pickup.Create(1241, 2, -34.233, -13.5066, 1003.557)

[email protected] = Pickup.Create(1240, 2, -27.2214, -3.6978, 1003.557)

[email protected] = Pickup.Create(323, 2, -29.9955, -15.9932, 1003.557)

jump @NONAME_2

 

 

 

Kind regards,

 

Aaron

Link to comment
Share on other sites

I've now encountered a new problem after using the script it seems that when i kill a ped or cop money or weapons don't seem to spawn anymore as a previous comment said earlier this might happen sad.gif is there anything i can do??

Uh, check this post: http://www.gtaforums.com/index.php?showtop...st&p=1062633253

 

And by the way, creating pickups through cleo isn't a good idea at all, they may mess up other things too. Last time i did that for vc, and it wasn't just couple of lines of code:

 

{$CLEO}0000:05DF: write_memory 0x61D8F7 size 5 value 0x90 virtual_protect 105F7: [email protected] = label @injector offset05DF: write_memory 0x61D8BA size 1 value 0xE9 virtual_protect 105F5: call_scm_func @setMemOffset 3 memory 0x61D8BB pointing_to [email protected] virtual_protect 105F7: [email protected] = label @label [email protected] += 705F8: [email protected] = var [email protected] offset05DF: write_memory [email protected] size 4 value [email protected] virtual_protect 1//05F5: call_scm_func @setMemOffset 3 memory [email protected] pointing_to [email protected] virtual_protect [email protected] += 505F5: call_scm_func @setMemOffset 3 memory [email protected] pointing_to 0x0061D8BF virtual_protect 105F7: [email protected] = label @injector [email protected] += 205F8: [email protected] = var [email protected] offset05DF: write_memory [email protected] size 4 value [email protected] virtual_protect 105F5: call_scm_func @make_pickups params_count 0while truewait [email protected] == 1then   05F5: call_scm_func @destroy_pickups params_count 0    05F7: [email protected] = label @label offset   05DF: write_memory [email protected] size 1 value 0xE8 virtual_protect 1   [email protected] += 1   05F5: call_scm_func @setMemOffset 3 memory [email protected] pointing_to 0x0061A630 virtual_protect 1   05DF: write_memory 0x61D8F7 size 1 value 0xE8 virtual_protect 1     05F5: call_scm_func @setMemOffset 3 memory 0x61D8F8 pointing_to 0x0061A690 virtual_protect 1                   05E1: call 0x61D8B0 num_params 1 pop 0 [email protected]   [email protected] -= 1   05DF: write_memory [email protected] size 5 value 0x90 virtual_protect 1   05DF: write_memory 0x61D8F7 size 5 value 0x90 virtual_protect 1   05F5: call_scm_func @make_pickups params_count [email protected] = 0    [email protected] = 0 end                                     end:make_pickups05F7: [email protected] = label @marker_handles offset  05E0: [email protected] = read_memory [email protected] size 4 virtual_protect 0     if     [email protected] == 0     then     032B: [email protected] = create_weapon_pickup 103 15 ammo 25 at 206.6931 -477.5245 11.0698     05DF: write_memory [email protected] size 4 value [email protected] virtual_protect 0     end     [email protected] += 4     05E0: [email protected] = read_memory [email protected] size 4 virtual_protect 0     if     [email protected] == 0     then     032B: [email protected] = create_weapon_pickup 104 15 ammo 25 at 207.0516 -474.891 11.0698     05DF: write_memory [email protected] size 4 value [email protected] virtual_protect 0     end     [email protected] += 4     05E0: [email protected] = read_memory [email protected] size 4 virtual_protect 0     if     [email protected] == 0     then     032B: [email protected] = create_weapon_pickup 112 15 ammo 25 at 193.8191 -478.0816 11.0698     05DF: write_memory [email protected] size 4 value [email protected] virtual_protect 0     end     [email protected] += 4     05E0: [email protected] = read_memory [email protected] size 4 virtual_protect 0     if     [email protected] == 0     then     032B: 10@ = create_weapon_pickup 113 15 ammo 25 at 192.8336 -472.5663 11.0698     05DF: write_memory [email protected] size 4 value [email protected] virtual_protect 0     end     [email protected] += 4     05E0: [email protected] = read_memory [email protected] size 4 virtual_protect 0     if     [email protected] == 0     then     032B: [email protected] = create_weapon_pickup 103 15 ammo 25 at -976.5576 -691.8929 11.6103     05DF: write_memory [email protected] size 4 value [email protected] virtual_protect 0     end     [email protected] += 4     05E0: [email protected] = read_memory [email protected] size 4 virtual_protect 0     if     [email protected] == 0     then     032B: [email protected] = create_weapon_pickup 104 15 ammo 25 at -976.0306 -697.1039 11.4736     05DF: write_memory [email protected] size 4 value [email protected] virtual_protect 0     end     [email protected] += 4     05E0: [email protected] = read_memory [email protected] size 4 virtual_protect 0     if     [email protected] == 0     then     032B: [email protected] = create_weapon_pickup 112 15 ammo 25 at -971.574 -697.7538 11.4025     05DF: write_memory [email protected] size 4 value [email protected] virtual_protect 0     end     [email protected] += 4     05E0: [email protected] = read_memory [email protected] size 4 virtual_protect 0       if     [email protected] == 0     then     032B: [email protected] = create_weapon_pickup 113 15 ammo 25 at -969.9881 -693.1933 11.475     05DF: write_memory [email protected] size 4 value [email protected] virtual_protect 0     end05F6: ret 0:destroy_pickups05F7: [email protected] = label @marker_handles offset05F7: [email protected] = label @end offsetfor [email protected] = [email protected] to [email protected] step 0x405E0: [email protected] = read_memory [email protected] size 4 virtual_protect 0  if  [email protected] <> 0   then  0215: destroy_pickup [email protected]   05DF: write_memory [email protected] size 4 value 0 virtual_protect 0  endend05F6: ret 0:injectorhexC7 05 00000000 01000000 //- mov [00000000],00000001end:labelhex//E8 00000000           //- call 0061A63090 9090909089 05 00000000        //- mov [00400000],eaxE9 00000000           //- jmp 0061D8C0end{ FUNCTIONS INCLUDED:-   getMemOffset     Type: GET       Description: Get the relative offset of a memory pointing to a specific address.-   setMemOffset     Type: GET       Description: Set a 4-byte relative offset of a memory pointing to a specific address with virtual protection.}:getMemOffset{ Parameters:   Passed:     [email protected] - memory pointer     [email protected] - memory to point   Result:     [email protected] - memory offset Example:   05F5: call_scm_func @getMemOffset 2 memory 0x0 pointing_to 0x0 store_to [email protected] }[email protected] += 0x4 000E: [email protected] -= [email protected] 05F6: ret 1 [email protected] :setMemOffset{ Parameters:   Passed:     [email protected] - memory pointer     [email protected] - memory to point     [email protected] - virtual protection   Result:     none Example:   05F5: call_scm_func @setMemOffset 3 memory 0x0 pointing_to 0x0 virtual_protect 0 }05F5: call_scm_func @getMemOffset 2 memory [email protected] pointing_to [email protected] store_to [email protected] 05DF: write_memory [email protected] size 4 value [email protected] virtual_protect [email protected] 05F6: ret 0:marker_handleshex00 00 00 00 00 00 00 0000 00 00 00 00 00 00 0000 00 00 00 00 00 00 0000 00 00 00 00 00 00 0000 00 00 00 00 00 00 0000 00 00 00 00 00 00 0000 00 00 00 00 00 00 0000 00 00 00 00 00 00 0000 00 00 0000 00 00 00 00 00 00 0000 00 00 0000 00 00 00 00 00 00 0000 00 00 0000 00 00 00 00 00 00 0000 00 00 0000 00 00 00 00 00 00 0000 00 00 0000 00 00 00 00 00 00 0000 00 00 0000 00 00 00 00 00 00 0000 00 00 0000 00 00 00 00 00 00 0000 00 00 0000 00 00 00 00 00 00 0000 00 00 0000 00 00 00 00 00 00 0000 00 00 0000 00 00 00 00 00 00 00end:endhex 00 00 00 00end

 

Link to comment
Share on other sites

masternewport

Right in that case no loops as i can place pickups around the state without using loops and they still spawn back and money and weapons still spawn when peds and cops get killed. Just need to find other places to spawn hammers and screwdrivers hmm

Link to comment
Share on other sites

TheGodfather.

The only thing left in my game to make it absolutely perfect is the ability to rob the 24/7 stores. But i know someone who's working on a mod like that. They know who they are wink.gif

 

Kind regards,

 

Aaron

That's me buddy.Well I am working on it: Arijit's Modding Workshop

 

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.