Home » Renegade Discussions » Mod Forum » Timer_Expired
Re: Timer_Expired [message #371598 is a reply to message #371542] |
Wed, 11 February 2009 09:33 |
|
Omar007
Messages: 1711 Registered: December 2007 Location: Amsterdam
Karma:
|
General (1 Star) |
|
|
Part of my Enter script:
Toggle Spoiler
void O_Conquest::Entered(GameObject *obj, GameObject *enter)
{
if (teamid == 0 || teamid == 1)
{
char pick[256];
const char *c = Get_Player_Name(enter);
sprintf(pick,"msg %s Is contesting a zone!",c);
delete[] c;
Console_Input(pick);
}
else if (Commands->Get_Player_Type(enter) == 0)
{
if (currentcontrol == 0)
{
char pick[256];
const char *c = Get_Player_Name(enter);
sprintf(pick,"ppage %s This zone is already under NOD's Control",c);
delete[] c;
Console_Input(pick);
}
else if (currentcontrol == 1)
{
playerid = Commands->Get_ID(enter);
givepoints = false;
teamid = Commands->Get_Player_Type(enter); // Get the id of the team that entered the zone
Commands->Start_Timer(obj,this,Get_Float_Parameter("Time_Before_Takeover[secs]"),Get_Int_Parameter("TimerNumber"));
givepoints = true;
currentcontrol = Commands->Get_Player_Type(enter);
nod++;
gdi--;
char pick[256];
const char *c = Get_Player_Name(enter);
sprintf(pick,"msg %s has taken over a zone for NOD!",c);
delete[] c;
Console_Input(pick);
}
else
{
playerid = Commands->Get_ID(enter);
givepoints = false;
teamid = Commands->Get_Player_Type(enter); // Get the id of the team that entered the zone
Commands->Start_Timer(obj,this,Get_Float_Parameter("Time_Before_Takeover[secs]"),Get_Int_Parameter("TimerNumber"));
givepoints = true;
currentcontrol = Commands->Get_Player_Type(enter);
nod++;
char pick[256];
const char *c = Get_Player_Name(enter);
sprintf(pick,"msg %s has taken over a zone for NOD!",c);
delete[] c;
Console_Input(pick);
}
}
My Timer_Expired part:
Toggle Spoiler
void O_Conquest::Timer_Expired(GameObject *obj, int number)
{
if (nod == Get_Int_Parameter("Number_Of_Zones"))
{
Console_Input("win 0");
}
else if (gdi == Get_Int_Parameter("Number_Of_Zones"))
{
Console_Input("win 1");
}
else
{
if (number == 776600)
{
Commands->Start_Timer(obj,this,01.00,776600);
if (givepoints)
{
Commands->Give_Points(Commands->Find_Object(playerid),Get_Float_Parameter("Points_Per_Sec"),1);
}
}
}
}
This is now.
EDIT: Kill_All_Building_By_Team is no option when it is a map without buildings... (duhu) Anyone who could tell me an alternative for ConsoleInput so it will also work when not running a dedicated server??
EDIT2: Sorry if some things are really n00bish. This is my first script
[Updated on: Wed, 11 February 2009 11:41] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Tue Dec 24 13:44:19 MST 2024
Total time taken to generate the page: 0.00823 seconds
|