Server Side Stuff [message #255939] |
Thu, 26 April 2007 11:46 |
|
Spyder
Messages: 1070 Registered: March 2006
Karma: 0
|
General (1 Star) |
|
|
I asked for this multiple times, but I still don't have an answer.
I want to make a powerup that can only be picked up ONCE! When a player dies or purchases a new character he can pick it up again, but I want him to be able to pick it up once per character.
I already tried this with the laser rifle, but that was in a different way. So is there any script or any way to disallow a player to pick up the powerup multiple times with the same character?
|
|
|
Re: Server Side Stuff [message #255949 is a reply to message #255939] |
Thu, 26 April 2007 12:28 |
Genesis2001
Messages: 1397 Registered: August 2006
Karma: 0
|
General (1 Star) |
|
|
The only way I can think about doing this is to modify your own server scripts. (Source is included in SSAOW).
The file inside the source you want is called crates.cpp (or crate.cpp).
Other than that, I haven't tried to modify my server scripts yet, so...Don't ask me how to add a crate...
-Thanks,
MathK1LL
|
|
|
|
|
Re: Server Side Stuff [message #255992 is a reply to message #255964] |
Thu, 26 April 2007 14:50 |
Genesis2001
Messages: 1397 Registered: August 2006
Karma: 0
|
General (1 Star) |
|
|
darksnipa wrote on Thu, 26 April 2007 14:27 | It's not a crate. It's a powerup that belongs to the weapon spawners...
|
I don't know then..I would make it a crate myself though...
-MathK1LL
|
|
|
Re: Server Side Stuff [message #256017 is a reply to message #255939] |
Thu, 26 April 2007 18:34 |
a100
Messages: 45 Registered: March 2007
Karma: 0
|
Recruit |
|
|
If you're making it through scripts you could have a array of boolean for the players and if the player picks up a powerup then the pickedup[playerid] = true and if he tries to pickup another powerup then it checks if pickedup[playerid] == false and if its not then it doesnt give the powerup
|
|
|
Re: Server Side Stuff [message #256323 is a reply to message #255939] |
Sun, 29 April 2007 02:35 |
|
Spyder
Messages: 1070 Registered: March 2006
Karma: 0
|
General (1 Star) |
|
|
What I actually mean is this:
I get the double damage powerup. I attach an infinite ammo laserrifle to it, to make sbh's unable to pick up the powerup. Then I add a sniper rifle, the bugged sniper rifle with infi ammo and a ramjet rifle. I want it this way that sbh's can't pick it up and that players that already have picked it up can't pick it up either because their laser rifle is full. What happens to me is that the powerup ignores the laser rifle and still allows players to pickup the sniper rifle and ramjet rifle. I want the powerup this way that it disallows players to pickup the powerup when they already have a laser rifle.
Is there a script or some other way with this kinda effect (I go tell you in the java way):
Powerup -> Player pickup -> if laserrifle full -> then disallow pickup -> if no laserrifle -> allow pickup -> if then laserrifle -> disallow pickup
If someone knows a way to disallowe players from picking up the powerup when they already ave a laser rifle, please tell me...(I don't want the player to be able to grant any of the other weapons included in the powerup)
|
|
|
|
Re: Server Side Stuff [message #256345 is a reply to message #255939] |
Sun, 29 April 2007 05:35 |
|
Spyder
Messages: 1070 Registered: March 2006
Karma: 0
|
General (1 Star) |
|
|
There must be a way to make this work, because xphaze is having a similar powerup which is useing the same way of making the player unable to pick up a powerup when they already have an infinite ammo laserrifle or other weapon. Tho the xphaze modder is never online and never answers any questions about it (matty3k10 for the persons that know who i'm talking about).
There must be a way to make the player unable to pickup the powerup when they already have picked up a laserrifle. I could be that it's not a script, but a preset I have to set or remove. I already tried this by removing the marker in front of: AlwaysAllowGrant, but that doesn't seem to work either.
|
|
|
|
Re: Server Side Stuff [message #256538 is a reply to message #255939] |
Mon, 30 April 2007 12:41 |
a100
Messages: 45 Registered: March 2007
Karma: 0
|
Recruit |
|
|
This may help
Heres what i came up with really fast, Code maybe inefficent but im in a hurry
const char *Get_Powerup_Weapon(const char *Powerup); //Get the weapon name that a powerup will grant if collected
void Remove_Weapon_Player (GameObject *obj,const char *Weapon_Name){
int Number_Weapon = Get_Weapon_Count(obj);
std::string Current_Weapon;
int Location;
for (int i = 1; i <= Number_Weapon; i++) {
Current_Weapon = Get_Weapon(obj,i);
if (Current_Weapon.find(Weapon_Name)>= 0) {
Location = Current_Weapon.find("Weapon");
if (Location >= 0) Current_Weapon.replace(Location,6,"POW");
Commands->Give_Powerup(obj,Current_Weapon.c_str(),true);
}
}
}
If you're using kak_drop_weapon
So when the player picks up the powerup then do
Remove_Weapon_Player(sender,Get_Powerup_Weapon(Get_Preset_Name(obj)));
if the preset is something you dont want.
|
|
|
Re: Server Side Stuff [message #256540 is a reply to message #255939] |
Mon, 30 April 2007 12:58 |
Genesis2001
Messages: 1397 Registered: August 2006
Karma: 0
|
General (1 Star) |
|
|
using namespace std;
void Remove_Weapon_Player (GameObject *obj,const char *Weapon_Name){
int Number_Weapon = Get_Weapon_Count(obj);
string Current_Weapon;
int Location;
for (int i = 1; i <= Number_Weapon; i++) {
Current_Weapon = Get_Weapon(obj,i);
if (Current_Weapon.find(Weapon_Name)>= 0) {
Location = Current_Weapon.find("Weapon");
if (Location >= 0) Current_Weapon.replace(Location,6,"POW");
Commands->Give_Powerup(obj,Current_Weapon.c_str(),true);
}
}
}
A little bit of a more efficient code. (Yes, I do know that you were in a rush, but heck...Just thought I'd interject this.)
-Thanks,
MathK1LL
EDIT: Btw...darksnipa, do you know ANY C++ or even know how to modify the server scripts? Just a thought that came my way...
[Updated on: Mon, 30 April 2007 12:59] Report message to a moderator
|
|
|
|
|
|
|
Re: Server Side Stuff [message #256777 is a reply to message #255939] |
Wed, 02 May 2007 08:07 |
|
"I am pretty much done with Renegade" - MAtty3k10.
No one is ever done with Renegade... lol
Nice to see you're still about.
Renguard is a wonderful initiative
Toggle Spoiler
BBC news, quoting... |
Supporters of Proposition 8 will argue California does not discriminate against gays, as the current law allows them to get married - as long as they wed a partner of the opposite sex.
|
halokid wrote on Mon, 11 October 2010 08:46 |
R315r4z0r wrote on Mon, 11 October 2010 15:35 |
|
the hell is that?
|
|
|
|