Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Timer page Player
Timer page Player [message #340563] Sun, 13 July 2008 01:08 Go to next message
mrãçķz is currently offline  mrãçķz
Messages: 3069
Registered: August 2007
Karma: 0
General (3 Stars)
Permabanned for trying and failing DDoS
OK whats wrong with this code? it just pages me with "Harvesting..." but the Timer part doesnt do anything.
So how do i fix that ? (yep its for a ServerSide Script)




Code:
void A_Tiberium_Field::Entered(GameObject *obj,GameObject *enter)
{
int x;
   x = Commands->Get_Player_Type(enter);
   Vector3 spawn_position;
   if (CheckPlayerType(enter,x))
   {
      return;
   }
   char message[1000];
   if (Commands->Get_Player_Type(enter) == 1)
   {
      sprintf(message,"ppage %d Harvesting...",Get_Player_ID(enter));
      Console_Input(message);
          Commands->Start_Timer(obj,this,1.0f,1); 
     Commands->Start_Timer(obj,this,2.0f,2); 
     Commands->Start_Timer(obj,this,3.0f,3);
     Commands->Start_Timer(obj,this,4.0f,4);
     Commands->Start_Timer(obj,this,5.0f,5);
     Commands->Start_Timer(obj,this,6.0f,6);
     Commands->Start_Timer(obj,this,7.0f,7);
     Commands->Start_Timer(obj,this,8.0f,8);
     Commands->Start_Timer(obj,this,9.0f,9);
     Commands->Start_Timer(obj,this,10.0f,10);
     Commands->Start_Timer(obj,this,11.0f,11);
}
}


void A_Tiberium_Field::Timer_Expired(GameObject *obj, int number) {

      char message[1000];
   if(number == 1){
      sprintf(message,"ppage %d Harvesting Complete in: 10.",Get_Player_ID(obj));
      Console_Input(message);
   }
      if(number == 2){
      sprintf(message,"ppage %d Harvesting Complete in: 9.",Get_Player_ID(obj));
      Console_Input(message);
         }
      if(number == 3){
      sprintf(message,"ppage %d Harvesting Complete in: 8.",Get_Player_ID(obj));
      Console_Input(message);
               }
      if(number == 4){
            sprintf(message,"ppage %d Harvesting Complete in: 7.",Get_Player_ID(obj));
      Console_Input(message);
               }
      if(number == 5){
            sprintf(message,"ppage %d Harvesting Complete in: 6.",Get_Player_ID(obj));
      Console_Input(message);
               }
      if(number == 6){
            sprintf(message,"ppage %d Harvesting Complete in: 5.",Get_Player_ID(obj));
      Console_Input(message);
               }
      if(number == 7){
            sprintf(message,"ppage %d Harvesting Complete in: 4.",Get_Player_ID(obj));
      Console_Input(message);
               }
      if(number == 8){
            sprintf(message,"ppage %d Harvesting Complete in: 3.",Get_Player_ID(obj));
      Console_Input(message);
               }
      if(number == 9){
            sprintf(message,"ppage %d Harvesting Complete in: 2.",Get_Player_ID(obj));
      Console_Input(message);
               }
      if(number == 10){
            sprintf(message,"ppage %d Harvesting Complete in: 1.",Get_Player_ID(obj));
      Console_Input(message);
                     }
      if(number == 11){
            sprintf(message,"ppage %d Harvesting Completed. Return to the Refinery.",Get_Player_ID(obj));
      Console_Input(message);
   }
   }
ScriptRegistrant<A_Tiberium_Field> A_Tiberium_Field_Registrant("A_Tiberium_Field","");
Re: Timer page Player [message #340564 is a reply to message #340563] Sun, 13 July 2008 01:31 Go to previous messageGo to next message
cAmpa is currently offline  cAmpa
Messages: 597
Registered: March 2006
Karma: 0
Colonel
You're paging the timered messages to the object with your script.

Bückstabü!
Re: Timer page Player [message #340565 is a reply to message #340563] Sun, 13 July 2008 01:46 Go to previous messageGo to next message
mrãçķz is currently offline  mrãçķz
Messages: 3069
Registered: August 2007
Karma: 0
General (3 Stars)
Permabanned for trying and failing DDoS
so how to fix? *enter doesnt work either
Re: Timer page Player [message #340566 is a reply to message #340565] Sun, 13 July 2008 01:58 Go to previous messageGo to next message
saberhawk
Messages: 1068
Registered: January 2006
Location: ::1
Karma: 0
General (1 Star)
You store the playerid of the person who called it in the class and use it from Timer_Expired.
Re: Timer page Player [message #340575 is a reply to message #340563] Sun, 13 July 2008 03:01 Go to previous messageGo to next message
mrãçķz is currently offline  mrãçķz
Messages: 3069
Registered: August 2007
Karma: 0
General (3 Stars)
Permabanned for trying and failing DDoS
ehh what ?
Re: Timer page Player [message #340585 is a reply to message #340563] Sun, 13 July 2008 03:46 Go to previous messageGo to next message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma: 0
General (3 Stars)
Should look something like this.
class A_Tiberium_Field
{
    int PlayerID;
    void Entered(GameObject *obj,GameObject *enter);
    void Timer_Expired(GameObject *obj, int number);
};



void A_Tiberium_Field::Entered(GameObject *obj,GameObject *enter)
{
   int x = Commands->Get_Player_Type(enter);
   Vector3 spawn_position;
   if (CheckPlayerType(enter,x))
   {
      return;
   }
   char message[1000];
   if (Commands->Get_Player_Type(enter) == 1)
   {
       PlayerID = Get_Player_ID(enter);
       sprintf(message,"ppage %d Harvesting...",Get_Player_ID(enter));
       Console_Input(message);
       Commands->Start_Timer(obj,this,10f,1); 
       Commands->Start_Timer(obj,this,9f,2); 
       Commands->Start_Timer(obj,this,8f,3);
       Commands->Start_Timer(obj,this,7f,4);
       Commands->Start_Timer(obj,this,6f,5);
       Commands->Start_Timer(obj,this,5f,6);
       Commands->Start_Timer(obj,this,4f,7);
       Commands->Start_Timer(obj,this,3f,8);
       Commands->Start_Timer(obj,this,2f,9);
       Commands->Start_Timer(obj,this,1f,10);
   }
}


void A_Tiberium_Field::Timer_Expired(GameObject *obj, int number) {

   char message[256];
   sprintf(message,"ppage %d Harvesting Complete in: %d.",PlayerID, number);
   Console_Input(message);
}
ScriptRegistrant<A_Tiberium_Field> A_Tiberium_Field_Registrant("A_Tiberium_Field","");
Re: Timer page Player [message #340632 is a reply to message #340563] Sun, 13 July 2008 07:19 Go to previous message
mrãçķz is currently offline  mrãçķz
Messages: 3069
Registered: August 2007
Karma: 0
General (3 Stars)
Permabanned for trying and failing DDoS
Nice thank you roshambo, i always wondered how to int the player


Edit: oh fuck
Edit: 2 ok i fixed it by myselfe

.\gmmain.cpp(1781) : error C3861: 'CheckPlayerType': identifier not found
.\gmmain.cpp(1791) : error C2059: syntax error : 'bad suffix on number'
.\gmmain.cpp(1791) : error C2146: syntax error : missing ')' before identifier 'f'
.\gmmain.cpp(1791) : error C2198: '_Start_Timer' : too few arguments for call
.\gmmain.cpp(1791) : error C2059: syntax error : ')'
.\gmmain.cpp(1792) : error C2059: syntax error : 'bad suffix on number'
.\gmmain.cpp(1792) : error C2146: syntax error : missing ')' before identifier 'f'
.\gmmain.cpp(1792) : error C2198: '_Start_Timer' : too few arguments for call
.\gmmain.cpp(1792) : error C2059: syntax error : ')'
.\gmmain.cpp(1793) : error C2059: syntax error : 'bad suffix on number'
.\gmmain.cpp(1793) : error C2146: syntax error : missing ')' before identifier 'f'
.\gmmain.cpp(1793) : error C2198: '_Start_Timer' : too few arguments for call
.\gmmain.cpp(1793) : error C2059: syntax error : ')'
.\gmmain.cpp(1794) : error C2059: syntax error : 'bad suffix on number'
.\gmmain.cpp(1794) : error C2146: syntax error : missing ')' before identifier 'f'
.\gmmain.cpp(1794) : error C2198: '_Start_Timer' : too few arguments for call
.\gmmain.cpp(1794) : error C2059: syntax error : ')'
.\gmmain.cpp(1795) : error C2059: syntax error : 'bad suffix on number'
.\gmmain.cpp(1795) : error C2146: syntax error : missing ')' before identifier 'f'
.\gmmain.cpp(1795) : error C2198: '_Start_Timer' : too few arguments for call
.\gmmain.cpp(1795) : error C2059: syntax error : ')'
.\gmmain.cpp(1796) : error C2059: syntax error : 'bad suffix on number'
.\gmmain.cpp(1796) : error C2146: syntax error : missing ')' before identifier 'f'
.\gmmain.cpp(1796) : error C2198: '_Start_Timer' : too few arguments for call
.\gmmain.cpp(1796) : error C2059: syntax error : ')'
.\gmmain.cpp(1797) : error C2059: syntax error : 'bad suffix on number'
.\gmmain.cpp(1797) : error C2146: syntax error : missing ')' before identifier 'f'
.\gmmain.cpp(1797) : error C2198: '_Start_Timer' : too few arguments for call
.\gmmain.cpp(1797) : error C2059: syntax error : ')'
.\gmmain.cpp(1798) : error C2059: syntax error : 'bad suffix on number'
.\gmmain.cpp(1798) : error C2146: syntax error : missing ')' before identifier 'f'
.\gmmain.cpp(1798) : error C2198: '_Start_Timer' : too few arguments for call
.\gmmain.cpp(1798) : error C2059: syntax error : ')'
.\gmmain.cpp(1799) : error C2059: syntax error : 'bad suffix on number'
.\gmmain.cpp(1799) : error C2146: syntax error : missing ')' before identifier 'f'
.\gmmain.cpp(1799) : error C2198: '_Start_Timer' : too few arguments for call
.\gmmain.cpp(1799) : error C2059: syntax error : ')'
.\gmmain.cpp(1800) : error C2059: syntax error : 'bad suffix on number'
.\gmmain.cpp(1800) : error C2146: syntax error : missing ')' before identifier 'f'
.\gmmain.cpp(1800) : error C2198: '_Start_Timer' : too few arguments for call
.\gmmain.cpp(1800) : error C2059: syntax error : ')'

[Updated on: Sun, 13 July 2008 07:28]

Report message to a moderator

Previous Topic: Question On C++
Next Topic: "BOO" Stealth Effect
Goto Forum:
  


Current Time: Tue Dec 24 13:37:53 MST 2024

Total time taken to generate the page: 0.00731 seconds