Trying to make anti health hack
#9

Quote:
Originally Posted by [uL]Pottus
Посмотреть сообщение
All the players need to be on the same team so OnPlayerTakeDamage() doesn't do anything though.
So something like this?

Код:
public OnPlayerRequestClass(playerid, classid)
{
      //....
      switch(classid)
      {
	    case 0,1,2,3:
	    {
                   //...
                   SetPlayerTeam(playerid,0);
                   gTeam[playerid] = BLUE_TEAM;
            }
            case 4,5,6,7:
	    {
                   //...
                   SetPlayerTeam(playerid,0); 
                   gTeam[playerid] = RED_TEAM;
            }
      }
      return 1;
}
Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
{
	if(playerid != INVALID_PLAYER_ID) // If not self-inflicted
        {
               if(gTeam[playerid] != gTeam[damagedid])
	       {
   		    GetPlayerHealth(damagedid,pHealth[damagedid]);
    		    SetPlayerHealth(damagedid,pHealth[damagedid]-amount);
	 	}
	}
	if(playerid == damagedid) // If self-inflicted
       {
   	      GetPlayerHealth(damagedid,pHealth[damagedid]);
    	      SetPlayerHealth(damagedid,pHealth[damagedid]-amount);
	}
 	KilledBy[damagedid] = playerid;
        KillReason[damagedid] = weaponid;
	return 1;
}
Reply


Messages In This Thread
Trying to make anti health hack - by Remba031 - 28.03.2014, 22:01
Re: Trying to make anti health hack - by Pottus - 28.03.2014, 22:10
Re: Trying to make anti health hack - by Remba031 - 28.03.2014, 22:21
Re: Trying to make anti health hack - by Pottus - 28.03.2014, 22:45
Re: Trying to make anti health hack - by Remba031 - 28.03.2014, 22:55
Re: Trying to make anti health hack - by Pottus - 28.03.2014, 23:03
Re: Trying to make anti health hack - by Remba031 - 28.03.2014, 23:29
Re: Trying to make anti health hack - by Pottus - 28.03.2014, 23:34
Re: Trying to make anti health hack - by Remba031 - 28.03.2014, 23:40
Re: Trying to make anti health hack - by Pottus - 29.03.2014, 00:02

Forum Jump:


Users browsing this thread: 5 Guest(s)