Home » Renegade Discussions » Mod Forum » Scripting Help
Re: Scripting Help [message #420744 is a reply to message #418187] |
Wed, 24 February 2010 00:22 |
|
Gen_Blacky
Messages: 3250 Registered: September 2006
Karma:
|
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.
|
|
|
|
|
Scripting Help
|
|
|
Re: Vector3 pos
By: Sir Kane on Fri, 22 January 2010 16:31
|
|
|
Re: Vector3 pos
By: zunnie on Fri, 22 January 2010 22:16
|
|
|
Re: Vector3 pos
|
|
|
Re: Vector3 pos
|
|
|
Re: Scripting Help
By: Omar007 on Sat, 23 January 2010 03:39
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
By: Omar007 on Sat, 23 January 2010 13:01
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
By: Omar007 on Sat, 23 January 2010 15:23
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
By: Omar007 on Sun, 24 January 2010 03:38
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
By: reborn on Wed, 27 January 2010 07:34
|
|
|
Re: Scripting Help
By: cAmpa on Mon, 25 January 2010 15:31
|
|
|
Re: Scripting Help
By: Hex on Wed, 27 January 2010 07:06
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
By: reborn on Wed, 27 January 2010 17:52
|
|
|
Re: Scripting Help
By: Hex on Thu, 28 January 2010 02:44
|
|
|
Re: Scripting Help
By: raven on Thu, 28 January 2010 10:31
|
|
|
Re: Scripting Help
By: reborn on Fri, 29 January 2010 16:37
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
By: reborn on Sat, 30 January 2010 03:08
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
By: reborn on Wed, 24 February 2010 03:35
|
|
|
Re: Scripting Help
By: Tunaman on Wed, 24 February 2010 08:16
|
|
|
Re: Scripting Help
By: raven on Wed, 24 February 2010 08:40
|
|
|
Re: Scripting Help
By: reborn on Wed, 24 February 2010 08:45
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
By: Omar007 on Wed, 24 February 2010 12:46
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
By: Omar007 on Wed, 24 February 2010 14:47
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
By: Hex on Sun, 04 April 2010 02:44
|
|
|
Re: Scripting Help
|
|
|
Re: Scripting Help
|
Goto Forum:
Current Time: Sat Nov 30 07:58:40 MST 2024
Total time taken to generate the page: 0.00988 seconds
|