masternewport Posted June 8, 2013 Share Posted June 8, 2013 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 More sharing options...
Ashwin.Star Posted June 8, 2013 Share Posted June 8, 2013 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 More sharing options...
masternewport Posted June 8, 2013 Author Share Posted June 8, 2013 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 More sharing options...
TheGodfather. Posted June 8, 2013 Share Posted June 8, 2013 I guess it's because you are using same global script in your code, change them into locals,i.e. Change $Health to [email protected],[email protected] & [email protected] respectively.I hope that should solve your problem. Link to comment Share on other sites More sharing options...
Deji Posted June 8, 2013 Share Posted June 8, 2013 The pickup type (2) specifies their spawning habits. Link to comment Share on other sites More sharing options...
masternewport Posted June 8, 2013 Author Share Posted June 8, 2013 Thanks arjitsen good to hear from you again I tried that it doesn't seem to have made a difference Thanks for trying anyway do you have anymore ideas? Link to comment Share on other sites More sharing options...
masternewport Posted June 8, 2013 Author Share Posted June 8, 2013 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 More sharing options...
Node Posted June 10, 2013 Share Posted June 10, 2013 (edited) 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 June 10, 2013 by The_Sorrow Link to comment Share on other sites More sharing options...
ThirteenAG Posted June 10, 2013 Share Posted June 10, 2013 God kills a kitten, every time someone uses a global variable in cleo script. Widescreen Fixes Pack || Project2DFX || SaveLoader || WindowedMode || CLEO Scripts Link to comment Share on other sites More sharing options...
Node Posted June 10, 2013 Share Posted June 10, 2013 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 More sharing options...
TheGodfather. Posted June 11, 2013 Share Posted June 11, 2013 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 More sharing options...
Seemann Posted June 13, 2013 Share Posted June 13, 2013 (edited) 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 June 13, 2013 by Seemann Sanny Builder 3 • SA Memory Handling • OpenIV • gtamodding.com CLEO.li - The CLEO Library - Official site Link to comment Share on other sites More sharing options...
masternewport Posted June 13, 2013 Author Share Posted June 13, 2013 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 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 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 Kind regards, Aaron Link to comment Share on other sites More sharing options...
masternewport Posted June 14, 2013 Author Share Posted June 14, 2013 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 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 More sharing options...
ThirteenAG Posted June 15, 2013 Share Posted June 15, 2013 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 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 Widescreen Fixes Pack || Project2DFX || SaveLoader || WindowedMode || CLEO Scripts Link to comment Share on other sites More sharing options...
masternewport Posted June 15, 2013 Author Share Posted June 15, 2013 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 More sharing options...
TheGodfather. Posted June 17, 2013 Share Posted June 17, 2013 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 Kind regards, Aaron That's me buddy.Well I am working on it: Arijit's Modding Workshop Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now