Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Headshot message for Server.  () 1 Vote
Re: Headshot message for Server. [message #439897 is a reply to message #439848] Mon, 22 November 2010 11:10 Go to previous messageGo to previous message
jnz is currently offline  jnz
Messages: 3396
Registered: July 2006
Location: 30th century
Karma:
General (3 Stars)
Something for you to try.

int headShotCount[127]; //bad, but whatever
extern cPlayer *(*FindPlayer)(int);


//player join
headshotCount[playerId] = 0;

//when player is damaged:
void my_script::Damaged(GameObject *o, GameObject *Attacker, float damage)
{
   int playerId = Get_Player_Id(o);
   cPlayer *p = FindPlayer(playerId);
   if(!p) return;

   headShotCount[playerId] = p->HeadShots;
}

//when player is killed
void my_script::Killed(GameObject *o, GameObject *Attacker)
{
   int killerId = Get_Player_Id(Attacker);
   cPlayer *killer = FindPlayer(killerId);
   if(!killer) return;
   if(killer->HeadShots > headShotCount[killerId])
   {
      headShotCount[killerId] = killer->HeadShots;
      Console_Input("msg headshot");
   }
}
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Can someone plz...
Next Topic: How to Make?
Goto Forum:
  


Current Time: Sun Jan 12 06:35:33 MST 2025

Total time taken to generate the page: 0.01191 seconds