Game Modding | Call of Duty: Black Ops 3 | Scripting
ModmeBot:
Thread By: XxCAFxX
Could anyone give me a script kind of similar to the ammo matic on MadGaz's map "Fabrik Der Untoten"? The only script I can find gives what is basically a max ammo. I want a script that only gives ammo to your current weapon and not your secondary or other players. If anyone could help out I would really apritiate it. I'll be sure to give credit if i upload the map.
ModmeBot:
Reply By: natesmithzombies
I did not write the Ammo Matic script for FDUT. From my understanding of how the machine works, this should do the same thing. Let me know if you have issues or not so I can mark the topic as answered.
Step 1) Paste this at the bottom of your mapname.gsc
functionammo_matic(){cost=5000;trigs=GetEntArray("ammo_matic","targetname");foreach(trigintrigs){trigthreadammo_matic_think(cost);trigSetCursorHint("HINT_NOICON");trigSetHintString("Press and Hold ^3&&1^7 to Buy Ammo [Cost: "+cost+"]");}}functionammo_matic_think(cost){while(1){selfwaittill("trigger",player);if(player.score>=cost){weapon=playerGetCurrentWeapon();playerzm_weapons::weapon_give(weapon);PlaySoundAtPosition("zmb_cha_ching",self.origin);playerzm_score::minus_to_player_score(cost);selfSetHintString("");wait(3);}else{selfSetHintString("You Do Not Have Enough Money");wait(3);}selfSetHintString("Press and Hold ^3&&1^7 to Buy Ammo [Cost: "+cost+"]");}}
Step 2) Add this to your function main in your mapname.gsc:
ammo_matic();
Step 3) Add this to the top of your mapname.gsc:
#using scripts\zm\_zm_weapons;
Step 4) Insert as many trigger uses in your map as you would like for each of the machines you want. Give it the following KVP:
targetname - ammo_matic
Good luck!
ModmeBot:
Reply By: XxCAFxX
natesmithzombies
I did not write the Ammo Matic script for FDUT. From my understanding of how the machine works, this should do the same thing. Let me know if you have issues or not so I can mark the topic as answered.
Step 1) Paste this at the bottom of your mapname.gsc
functionammo_matic(){cost=5000;trigs=GetEntArray("ammo_matic","targetname");foreach(trigintrigs){trigthreadammo_matic_think(cost);trigSetCursorHint("HINT_NOICON");trigSetHintString("Press and Hold ^3&&1^7 to Buy Ammo [Cost: "+cost+"]");}}functionammo_matic_think(cost){while(1){selfwaitill("trigger",player);if(player.score>=cost){weapon=playerGetCurrentWeapon();zm_weapons::weapon_give(weapon);playerzm_score::minus_to_player_score(cost);selfSetHintString("");wait(3);}else{selfSetHintString("You Do Not Have Enough Money");wait(3);}selfSetHintString("Press and Hold ^3&&1^7 to Buy Ammo [Cost: "+cost+"]");}}
Step 2) Add this to your function main in your mapname.gsc:
ammo_matic();
Step 3) Add this to the top of your mapname.gsc:
#using scripts\zm\_zm_weapons;
Step 4) Insert as many trigger uses in your map as you would like for each of the machines you want. Give it the following KVP:
targetname - ammo_matic
Good luck!
Thanks for the reply, I just tested it and got a compiling error.
I did not write the Ammo Matic script for FDUT. From my understanding of how the machine works, this should do the same thing. Let me know if you have issues or not so I can mark the topic as answered.
Step 1) Paste this at the bottom of your mapname.gsc
functionammo_matic(){cost=5000;trigs=GetEntArray("ammo_matic","targetname");foreach(trigintrigs){trigthreadammo_matic_think(cost);trigSetCursorHint("HINT_NOICON");trigSetHintString("Press and Hold ^3&&1^7 to Buy Ammo [Cost: "+cost+"]");}}functionammo_matic_think(cost){while(1){selfwaitill("trigger",player);if(player.score>=cost){weapon=playerGetCurrentWeapon();zm_weapons::weapon_give(weapon);playerzm_score::minus_to_player_score(cost);selfSetHintString("");wait(3);}else{selfSetHintString("You Do Not Have Enough Money");wait(3);}selfSetHintString("Press and Hold ^3&&1^7 to Buy Ammo [Cost: "+cost+"]");}}
Step 2) Add this to your function main in your mapname.gsc:
ammo_matic();
Step 3) Add this to the top of your mapname.gsc:
#using scripts\zm\_zm_weapons;
Step 4) Insert as many trigger uses in your map as you would like for each of the machines you want. Give it the following KVP:
targetname - ammo_matic
Good luck!
Thanks for the reply, I just tested it and got a compiling error.
I did not write the Ammo Matic script for FDUT. From my understanding of how the machine works, this should do the same thing. Let me know if you have issues or not so I can mark the topic as answered.
Step 1) Paste this at the bottom of your mapname.gsc
functionammo_matic(){cost=5000;trigs=GetEntArray("ammo_matic","targetname");foreach(trigintrigs){trigthreadammo_matic_think(cost);trigSetCursorHint("HINT_NOICON");trigSetHintString("Press and Hold ^3&&1^7 to Buy Ammo [Cost: "+cost+"]");}}functionammo_matic_think(cost){while(1){selfwaitill("trigger",player);if(player.score>=cost){weapon=playerGetCurrentWeapon();zm_weapons::weapon_give(weapon);playerzm_score::minus_to_player_score(cost);selfSetHintString("");wait(3);}else{selfSetHintString("You Do Not Have Enough Money");wait(3);}selfSetHintString("Press and Hold ^3&&1^7 to Buy Ammo [Cost: "+cost+"]");}}
Step 2) Add this to your function main in your mapname.gsc:
ammo_matic();
Step 3) Add this to the top of your mapname.gsc:
#using scripts\zm\_zm_weapons;
Step 4) Insert as many trigger uses in your map as you would like for each of the machines you want. Give it the following KVP:
targetname - ammo_matic
Good luck!
Thanks for the reply, I just tested it and got a compiling error.
lol I spelled waittill wrong. I forgot a 't'. The original code I posted has been updated
ModmeBot:
Reply By: XxCAFxX
alright, it compiled that time but when i purchased the ammo it took the points but didn't give any ammo
ModmeBot:
Reply By: natesmithzombies
XxCAFxX
alright, it compiled that time but when i purchased the ammo it took the points but didn't give any ammo
Man the little stuff always gets me. I am finally home and was able to test the code. Stupid typos get me every time. Code is updated and working perfect. Checked it myself ;)
ModmeBot:
Reply By: XxCAFxX
natesmithzombies
XxCAFxX
alright, it compiled that time but when i purchased the ammo it took the points but didn't give any ammo
Man the little stuff always gets me. I am finally home and was able to test the code. Stupid typos get me every time. Code is updated and working perfect. Checked it myself ;)