nekomaster Posted December 6, 2016 Share Posted December 6, 2016 (edited) FOR GTA SAN ANDREAS (Sorry, forgot to include GTA SA in the title) I'm posting here today in hopes to get help making a new weapon spawning script that's easy for a noob to modify and only spawns weapons if you have the money for it Since it would seem that its a tad complicated to add weapons to Ammunation for a noob, until I figure out how to do something like that I'll just have to resort to CLEO Scripts for now. At the moment this is what I use to spawn in weapons where ever I go, but I avoid using it since its rather cheaty as it costs nothing to spawn weapons right next to CJ //-------------MAIN---------------thread 'WEAP' :WEAP_11wait 0 [email protected] = -229908 if &0([email protected],4i) == 1464156496 else_jump @WEAP_11 &0([email protected],4i) = 1146440960 04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $0[3] with_offset -2.0 0.0 0.0 //FN FAL - ID 18902032B: [email protected] = create_weapon_pickup #FNFAL type 4 ammo 200 at [email protected] [email protected] [email protected] @WEAP_11 end_thread Of course I got this from the Weapon Limit Adjuster mod since i didn't like Fastman92's method of spawning weapons (only one place they spawn in the world and still free) Though my issue with this is that its free, no cost, so its cheating, and I can put that in many times to keep getting free ammo. I did try using this line of code : Player.Money($PLAYER_CHAR) += -8000 But that does nothing to check if I have the money and can actually put your money in the red/negative Heres what I'd like in a new spawning script... - Easy to modify like the above code (Basically so I can copy the code and use it for other weapons) - Supports Custom Weapons like the above code (Basically spawns weapons based on their ID so any weapon can be spawned) - IT NEEDS TO COST MONEY TO SPAWN WEAPONS! I would like it if the script could check out how much the player has, and only spawns the weapon if CJ has enough money (otherwise it just wont spawn at all) - Doesn't need a menu unless that can be done easy and simply (I don't understand cleo scripting very well at the moment) The above code does not need a menu but works by spawning weapons when you type in "WEAP" during gameplay. Though if a menu can be made simply and easily so that adding new entries can be as simple as adding a few lines of code and txt in a FXT file, that would be nice. I'm not making any demands or anything, but at the least, it might be nice if someone could show me how to add to the above code a money check to prevent spawning a weapon if you don't have the money the script wants to deduct. I'm sure that'll be simple enough even for a noob like me to understand. It might also be nice if we go the simple route by modifying the above code and add a message for when a Weapon is spawned like "FN FAL SPAWNED FOR $8000" and when you dont have enough money "NOT ENOUGH MONEY, FN FAL COSTS $8000" Anyways, any help would be really appreciated, I really need a spawning script that costs money to spawn weapons, other wise theres not much point in having custom weapons in a serious game (currently its only fun for screwing around, like going on a rampage) Edited December 6, 2016 by nekomaster Link to comment Share on other sites More sharing options...
fastman92 Posted December 6, 2016 Share Posted December 6, 2016 The FLA 4.0 got released yesterday and you're still using 3.0 ... While I can't make you a scripy (I don't use the computer at the moment), I'll give you some tips. Use opcode search in the Sunny Builder. Look for an opcode which checks if player has more money than specified amount, add jf (else jump) after that. Type monry in the opcode search. In case that there is no opcode to check whether player has more money than specified amount, choose the opcode which would store the money value into variable. Then make a condition with that variable such as [email protected] > 500, add jf to label after that. Link to comment Share on other sites More sharing options...
nekomaster Posted December 6, 2016 Author Share Posted December 6, 2016 (edited) The FLA 4.0 got released yesterday and you're still using 3.0 ... While I can't make you a scripy (I don't use the computer at the moment), I'll give you some tips. Use opcode search in the Sunny Builder. Look for an opcode which checks if player has more money than specified amount, add jf (else jump) after that. Type monry in the opcode search. In case that there is no opcode to check whether player has more money than specified amount, choose the opcode which would store the money value into variable. Then make a condition with that variable such as [email protected] > 500, add jf to label after that. It would help if I could access your website to download version 4.0, but all my browsers keep timing out when trying to load your website. Also, at the moment I'm trying to make individual spawner scripts for each weapon, but the code I posted originally wants WEAP to be typed in while in game. I thought that changing thread 'WEAP' to thread 'GIVEFAL' would change the code I need to type in game to GIVEFAL to spawn, but that didnt work (nothing happened when I typed GIVEFAL, but it spawned when i typed in WEAP) EDIT : I did an opcode search for "money" but I don't see anything I can understand to use. Gotta remember that I'm so green with scripting that I don't even know what most of the spawner code does, other then it spawns weapons ingame. I may as well be a script kiddy at the moment. Edited December 6, 2016 by nekomaster Link to comment Share on other sites More sharing options...
Jitnaught Posted December 6, 2016 Share Posted December 6, 2016 Here's the download link he provides on his website: http://www.mediafire.com/file/azwfhte4ioe70p0/fastman92_limit_adjuster_4_0.rar Link to comment Share on other sites More sharing options...
Gramps Posted December 6, 2016 Share Posted December 6, 2016 Moved thread to Coding section. Link to comment Share on other sites More sharing options...
OrionSR Posted December 6, 2016 Share Posted December 6, 2016 Here's an idea that might get you started. If you create your weapon as pickup type 18, the buy property type, the game will display "ammo" value above the weapon and will deduct that amount of money from CJ's wallet when the "Answer Phone" button is pressed. These pickups don't actually give CJ the weapon though. Your script will need to watch for when the pickups are picked up and then provide CJ will the weapon and ammo. Note that the colors for the prices are generated by the game based on the value - apparently some leftover code from III and VC, There are a few odd glitches though. When CJ walks over the pickup a "Cancel" message is displayed instead of instructions on how to buy the weapon, and the message displayed if CJ doesn't have enough cash refers to property. Also, the pickups can't be collected if CJ is on a mission, and that message refers to property as well. The text can be changed, but you'll need to put it back to normal for the properties when the buy weapons aren't active. You don't want to leave the pickups lying around anyway or they'll get saved, recreated, and saved again and again, cluttering the pool until it won't work anymore. Reference for SA's GXT keys. Test codes for buy pickups along the side of the Jefferson house (not a complete cleo script). 032B: [email protected] = create_weapon_pickup #COLT45 group 18 ammo 50 at 2101.0 -1265.75 25.5032B: [email protected] = create_weapon_pickup #TEC9 group 18 ammo 500 at 2101.0 -1267.75 25.5032B: [email protected] = create_weapon_pickup #M4 group 18 ammo 5000 at 2101.0 -1269.75 25.5032B: [email protected] = create_weapon_pickup #MINIGUN group 18 ammo 50000 at 2101.0 -1271.75 25.50ADF: add_dynamic_GXT_entry "FESZ_CA" text "Press ~k~~PED_ANSWER_PHONE~ to purchase the weapon."0ADF: add_dynamic_GXT_entry "PROP_1" text "You dont have enough cash for this weapon."0ADF: add_dynamic_GXT_entry "PROP_2" text "You cannot buy weapons whilst on a mission."//$ONMISSION = 1 // for testing{// original GXT keys0ADF: add_dynamic_GXT_entry "FESZ_CA" text "Cancel"0ADF: add_dynamic_GXT_entry "PROP_1" text "You dont have enough cash for this property."0ADF: add_dynamic_GXT_entry "PROP_2" text "You cannot buy property whilst on a mission."} Link to comment Share on other sites More sharing options...
nekomaster Posted December 6, 2016 Author Share Posted December 6, 2016 (edited) Here's an idea that might get you started. If you create your weapon as pickup type 18, the buy property type, the game will display "ammo" value above the weapon and will deduct that amount of money from CJ's wallet when the "Answer Phone" button is pressed. These pickups don't actually give CJ the weapon though. Your script will need to watch for when the pickups are picked up and then provide CJ will the weapon and ammo. Note that the colors for the prices are generated by the game based on the value - apparently some leftover code from III and VC, There are a few odd glitches though. When CJ walks over the pickup a "Cancel" message is displayed instead of instructions on how to buy the weapon, and the message displayed if CJ doesn't have enough cash refers to property. Also, the pickups can't be collected if CJ is on a mission, and that message refers to property as well. The text can be changed, but you'll need to put it back to normal for the properties when the buy weapons aren't active. You don't want to leave the pickups lying around anyway or they'll get saved, recreated, and saved again and again, cluttering the pool until it won't work anymore. Reference for SA's GXT keys. Test codes for buy pickups along the side of the Jefferson house (not a complete cleo script). 032B: [email protected] = create_weapon_pickup #COLT45 group 18 ammo 50 at 2101.0 -1265.75 25.5032B: [email protected] = create_weapon_pickup #TEC9 group 18 ammo 500 at 2101.0 -1267.75 25.5032B: [email protected] = create_weapon_pickup #M4 group 18 ammo 5000 at 2101.0 -1269.75 25.5032B: [email protected] = create_weapon_pickup #MINIGUN group 18 ammo 50000 at 2101.0 -1271.75 25.50ADF: add_dynamic_GXT_entry "FESZ_CA" text "Press ~k~~PED_ANSWER_PHONE~ to purchase the weapon."0ADF: add_dynamic_GXT_entry "PROP_1" text "You dont have enough cash for this weapon."0ADF: add_dynamic_GXT_entry "PROP_2" text "You cannot buy weapons whilst on a mission."//$ONMISSION = 1 // for testing{// original GXT keys0ADF: add_dynamic_GXT_entry "FESZ_CA" text "Cancel"0ADF: add_dynamic_GXT_entry "PROP_1" text "You dont have enough cash for this property."0ADF: add_dynamic_GXT_entry "PROP_2" text "You cannot buy property whilst on a mission."} How do get the exact location of stuff? Perhaps I could add some of my added weapons outside of Ammunation. ALso I'm not too worried about changing the text of the property buying messages as Weapons can be considered "property". Also it kinda makes sense if you can't buy stuff while on a mission, some of the added weapons may end up being more powerful then in game weapons. For example, I modified the Country Rifle to be a bolt action hunting rifle so its more powerful then a FAL but its slower with only 5 rounds, the FN FAL I added is faster but less accurate and holds 20 rounds. This idea may just work better then just spawning weapons in if I can figure out how to get the position of spawns to add them around san andreas. EDIT : To be honest though, while I can make the spawns appear, I have no idea how to actually make them give you a weapon and ammo. Like I mentioned before, I have next to no knowledge of scripting. Edited December 6, 2016 by nekomaster 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