Home » Renegade Discussions » Mod Forum » Infinite Ammo Mod
Re: Infinite Ammo Mod [message #330685 is a reply to message #330681] |
Thu, 15 May 2008 14:39 ![Go to previous message Go to previous message](/theme/Renegade_Forums/images/up.png) ![Go to next message Go to previous message](/theme/Renegade_Forums/images/down.png) |
![](http://renegadeforums.com/images/custom_avatars/20681.jpg) |
BlueThen
Messages: 2402 Registered: February 2006
Karma:
|
General (2 Stars) |
|
|
SSnipe wrote on Thu, 15 May 2008 16:02 |
Originally Blue wrote on Thu, 15 May 2008 13:59 |
reborn wrote on Thu, 15 May 2008 04:56 | I'm not entirely sure, but I think it's impossible to do what you want in level edit. Someone will most likely prove me wrong now, but I'm pretty sure to do what you want to do you will have to make a new server scripts.dll file.
The infinite ammo is possible in level edit, but it would be just as easy to do that via the API aswell, using this "Enable_Infinite_Ammo();".
To make the no-reload part of the mod I would look at the following functions:
int Get_Current_Bullets(GameObject *obj); //Get loaded bullets for an objects current gun
void Set_Current_Bullets(GameObject *obj,int bullets); //Set current loaded bullets for an object
You could attach a script to a player that has a timer, on the ::Created event it does something like this:
void reb_no_reload::Created(GameObject *obj) {
Max = Get_Current_Clip_Max_Bullets(obj);
Commands->Start_Timer(obj,this,1.0f,1);
}
Then on the timer expired event check what the current bullets are for that weapon, and if they are less then then Max value, set them to Max. Something like this:
void reb_no_reload::Timer_Expired(GameObject *obj, int number) {
if(number == 1){
if(Max > Get_Current_Bullets(obj)){
Set_Current_Bullets(obj, Max);
}
}
}
Obviously Max would have to be defined in the header file, like this:
class reb_no_reload : public ScriptImpClass {
public:
void Created(GameObject *obj);
void Timer_Expired(GameObject *obj, int number);
int Max
};
This would only work if the player had one weapon only though, if he switched weapons it would mess up. To make it work with all weapons would take a little more effort... You would have to use "Get_Max_Total_Bullets(GameObject *obj,const char *weapon);" of "int Get_Position_Bullets(GameObject *obj,int position);" and the other Bullet functions that require you to tell it what gun you're talking about.
That's the way I would first look at making a no-reload mod, there is probably a better way, but i've just woken up ![Razz](images/smiley_icons/icon_razz.gif)
| What? It's easily done in level edit. I think if you set the ammo clip to -1 (or was it 0?) it'd just be infinite.
|
i was bored and tryed that,,,,i set -1 on clip and ammo and put 0 on the otehr sniper rifle but yet nothing chnaged
|
...way to fail at typing...
also, it works for me...
|
|
|
Goto Forum:
Current Time: Sat Feb 08 20:44:24 MST 2025
Total time taken to generate the page: 0.00859 seconds
|