Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Scripting Help
Re: Scripting Help [message #418852 is a reply to message #418187] Sat, 30 January 2010 03:08 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
Oh yeah, I had the warning level at 3.


Re: Scripting Help [message #420744 is a reply to message #418187] Wed, 24 February 2010 00:22 Go to previous messageGo to next message
Gen_Blacky is currently offline  Gen_Blacky
Messages: 3250
Registered: September 2006
Karma: 1
General (3 Stars)
Im trying block players from refilling even when they buy a new character. They can buy new characters without the script effecting the players heath if they don't get damaged.

When the Player goes outside of the zone and get's damaged I want the script to somehow return a Boolean value or number to the refill zone. The refill zone will get the players health when they enter the zone and when they exit the zone it will see that they where damaged. It will then set the player health back to what it was when they entered the zone.


Code

void B_Refill_Zone::Entered(GameObject *obj,GameObject *enter)
{
	int x;
	x = Get_Int_Parameter("Player_Type");
	if (CheckPlayerType(enter,x))
	{
		return;
	}
	if (Commands->Is_A_Star(enter))
	{
		//Commands->Start_Timer(obj,this,5,Commands->Get_ID(enter));
		return
	}
	Console_Output("enter.\n");
	health = Commands->Get_Health(enter);
	shield = Commands->Get_Shield_Strength(enter);
	Console_Output("[Refill] Health %d Shiled %d.\n",health, shield );

}

void B_Refill_Zone::Exited(GameObject *obj,GameObject *exit)
{
	int x;
	x = Get_Int_Parameter("Player_Type");
	int player = Get_Player_ID(exit);
	if (CheckPlayerType(exit,x))
	{
		return;
	}
	if (!Commands->Is_A_Star(exit))
	{
		return;
	}

	else if (Commands->Get_Health(exit) > health || Commands->Get_Shield_Strength(exit) > shield ) 
	{
		if ( Damage > 0 )
		{
			Commands->Set_Health(exit,health);
			Commands->Set_Shield_Strength(exit,shield);

			char message[1000];
			sprintf(message,"ppage %d Do Not Refill",Get_Player_ID(exit));
			Console_Input(message);
			Console_Output("[Refill] %s tried to refill.\n",Get_Player_Name_By_ID(player));
			Console_Output("[Refill] is Damaged  %d.\n",Get_Player_Name_By_ID(player), Damage);
		}
		else
		{
			Console_Output("[Refill] %s Not Damaged %d.\n",Get_Player_Name_By_ID(player),Damage);
		}
	}

	else
	{
		Console_Output("[Refill] %s did not try to refill.\n",Get_Player_Name_By_ID(player));
	}
}



Example of what i want the script to do.

index.php?t=getfile&id=12470&private=0


http://s18.postimage.org/jc6qbn4k9/bricks3.png
Re: Scripting Help [message #420757 is a reply to message #418187] Wed, 24 February 2010 03:35 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
So wait, what you really want is to just stop people erfilling really?
If it was possible to remove the refill PT icon, that would suit your needs?



Re: Scripting Help [message #420777 is a reply to message #418187] Wed, 24 February 2010 08:16 Go to previous messageGo to next message
Tunaman
Messages: 1190
Registered: January 2005
Karma: 2
General (1 Star)
He's saying he doesn't want people to get more health even if they buy a new character.

http://img694.imageshack.us/img694/9055/tunamanlmao.png
Re: Scripting Help [message #420779 is a reply to message #418187] Wed, 24 February 2010 08:40 Go to previous messageGo to next message
raven
Messages: 595
Registered: January 2007
Location: Toronto, Ontario
Karma: 0
Colonel
store everyones health levels in an array and on purchase event set their health to that value

just a thought


-Jelly Administrator
-Exodus Administrator
Re: Scripting Help [message #420781 is a reply to message #418187] Wed, 24 February 2010 08:45 Go to previous messageGo to next message
reborn is currently offline  reborn
Messages: 3231
Registered: September 2004
Location: uk - london
Karma: 0
General (3 Stars)
I'm still not entirely sure what he really wants. I reckon there's a simple solution.


Re: Scripting Help [message #420783 is a reply to message #418187] Wed, 24 February 2010 09:29 Go to previous messageGo to next message
Gen_Blacky is currently offline  Gen_Blacky
Messages: 3250
Registered: September 2006
Karma: 1
General (3 Stars)
reborn wrote on Wed, 24 February 2010 04:35

So wait, what you really want is to just stop people erfilling really?
If it was possible to remove the refill PT icon, that would suit your needs?


I want to stop players from completely refilling even when they buy a new character. I don't know how I can explain this any better then I already have.


Tunaman wrote on Wed, 24 February 2010 09:16

He's saying he doesn't want people to get more health even if they buy a new character.


yes.

Lets says A player goes out and gets damaged by another player and they have 100 health and 50 shield. They go back to the pt and buy a new character that has more health then they currently have. Like an mendoza who has 200 health and 100 armor. When they exit the zone their health will just be set back to 100 health and 50 armor because they where damaged. ( Damage Value set to 1)

Lets say the player dies when they spawn they will have 100 heath and 100 armor. They can buy any character they wish that has more health and armor as long as they don't get damaged.
( Damage Value set to 0 )

raven wrote on Wed, 24 February 2010 09:40

store everyones health levels in an array and on purchase event set their health to that value

just a thought


I think that's more complicated then its needs to be. That would be a better way to do it though.


http://s18.postimage.org/jc6qbn4k9/bricks3.png

[Updated on: Wed, 24 February 2010 09:32]

Report message to a moderator

Re: Scripting Help [message #420798 is a reply to message #418187] Wed, 24 February 2010 12:46 Go to previous messageGo to next message
Omar007 is currently offline  Omar007
Messages: 1711
Registered: December 2007
Location: Amsterdam
Karma: 0
General (1 Star)
The easiest way to do this is as raven said imo
That's probably how i would do it if i wanted to

You could do this with a Purchase hook too i think. You would still need an array for the players though


http://tiberiumredux.omarpakker.nl/Old Unused Parts/Plaatjes/PromoteBanner_Hades_small.jpg

[Updated on: Wed, 24 February 2010 12:47]

Report message to a moderator

Re: Scripting Help [message #420810 is a reply to message #418187] Wed, 24 February 2010 13:22 Go to previous messageGo to next message
Gen_Blacky is currently offline  Gen_Blacky
Messages: 3250
Registered: September 2006
Karma: 1
General (3 Stars)
I have never made an arry in c++ only in perl or pascal. need to do some reading.

http://s18.postimage.org/jc6qbn4k9/bricks3.png
Re: Scripting Help [message #420830 is a reply to message #418187] Wed, 24 February 2010 14:47 Go to previous messageGo to next message
Omar007 is currently offline  Omar007
Messages: 1711
Registered: December 2007
Location: Amsterdam
Karma: 0
General (1 Star)
Here are a few examples

INT Array
int myInt[127];

example loop to put player ID's in it
for(int i = 0; i < sizeof(myInt); i++)
{
    myChar[i] = playerID;
}


Char Array
char myChar[127][255]; //char uses 2 number sets for 1 array. Last set always defines the max number of characters in 1 sentence/spot

example loop to put player names in it
for(int i = 0; i < sizeof(myChar); i++)
{
    myChar[i] = playerName;
}


Note that arrays for floats, doubles, longs, bytes etc are the same as an int array

Hope this helped you a bit Thumbs Up


http://tiberiumredux.omarpakker.nl/Old Unused Parts/Plaatjes/PromoteBanner_Hades_small.jpg

[Updated on: Wed, 24 February 2010 14:48]

Report message to a moderator

Re: Scripting Help [message #420834 is a reply to message #418187] Wed, 24 February 2010 15:25 Go to previous messageGo to next message
Sladewill is currently offline  Sladewill
Messages: 291
Registered: January 2009
Location: United Kingdom
Karma: 0
Recruit

If your preventing refill use ssgm its got a script already designed for that

FT-Owners - Sladewill,Snazy2007,Willdy
http://FT-Gaming.com for more info...
Re: Scripting Help [message #420844 is a reply to message #420834] Wed, 24 February 2010 16:33 Go to previous messageGo to next message
Gen_Blacky is currently offline  Gen_Blacky
Messages: 3250
Registered: September 2006
Karma: 1
General (3 Stars)
Sladewill wrote on Wed, 24 February 2010 16:25

If your preventing refill use ssgm its got a script already designed for that


yea but because its attached to the player they cant pickup health power ups.


http://s18.postimage.org/jc6qbn4k9/bricks3.png
Re: Scripting Help [message #424607 is a reply to message #418187] Sun, 04 April 2010 00:34 Go to previous messageGo to next message
Gen_Blacky is currently offline  Gen_Blacky
Messages: 3250
Registered: September 2006
Karma: 1
General (3 Stars)
Bump

Does ssgm have a purchase hook or would i have to make my own.


http://s18.postimage.org/jc6qbn4k9/bricks3.png

[Updated on: Sun, 04 April 2010 00:34]

Report message to a moderator

Re: Scripting Help [message #424611 is a reply to message #418187] Sun, 04 April 2010 02:44 Go to previous messageGo to next message
Hex is currently offline  Hex
Messages: 858
Registered: March 2004
Karma: 0
Colonel
Try looking instead of getting everyone else to do the work for you?, just a idea.

goztow wrote on Tue, 11 May 2010 08:00

If we had to ban all who ever cheated or ever created a cheat (obj3cts and such) then I don't think there would be many members left here (sad fact).


reborn wrote on Fri, 29 January 2010 23:37

std is for pro's. Razz
Re: Scripting Help [message #424612 is a reply to message #424611] Sun, 04 April 2010 02:50 Go to previous messageGo to next message
Gen_Blacky is currently offline  Gen_Blacky
Messages: 3250
Registered: September 2006
Karma: 1
General (3 Stars)
Hex wrote on Sun, 04 April 2010 03:44

Try looking instead of getting everyone else to do the work for you?, just a idea.


I did look i just wanted confirmation on how to load it in a plugin. I guess I should of asked more depth what i really wanted.I found the bhs hooks and the ssgm purchase hook. I did not see it in the plugin example so wasn't sure if ssgm plugins had support for it. I did not see where ssgm loads the SSGM_Purchase_Hook into the plugins looking through the ssgm source.



http://s18.postimage.org/jc6qbn4k9/bricks3.png

[Updated on: Sun, 04 April 2010 03:08]

Report message to a moderator

Re: Scripting Help [message #424668 is a reply to message #418187] Sun, 04 April 2010 14:46 Go to previous message
Gen_Blacky is currently offline  Gen_Blacky
Messages: 3250
Registered: September 2006
Karma: 1
General (3 Stars)
nvm i will just do what i want to do in scripts.dll

http://s18.postimage.org/jc6qbn4k9/bricks3.png
Previous Topic: how to add startup spawners and spawners etc!!! help!
Next Topic: Cables of the transport.
Goto Forum:
  


Current Time: Fri Dec 20 17:37:54 MST 2024

Total time taken to generate the page: 0.01029 seconds