26.10.2014, 06:41
(
Последний раз редактировалось Crayder; 28.10.2014 в 18:36.
)
-solved-
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 3) //example
{
new Float:armour, Float:health;
GetPlayerArmour(playerid, armour);
GetPlayerHealth(playerid, health);
if(GetPlayerArmour(playerid) > 0 && bodypart == 3)
{
SetPlayerHealth(playerid, health);
SetPlayerArmour(playerid, armour);
}
else
{
//Player had no armor or body part was different
}
}
return 1;
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 3)
new Float:armour, Float:health;
GetPlayerArmour(playerid, armour);
GetPlayerHealth(playerid, health);
if(GetPlayerArmour(playerid) > 0 && bodypart == 3)
{
SetPlayerHealth(playerid, health);
SetPlayerArmour(playerid, armour);
}
#include <YSI\y_hooks>
static PlayerTeam[MAX_PLAYERS];
forward TF_SetPlayerTeam(playerid, team);
public TF_SetPlayerTeam(playerid, team)
{
PlayerTeam[playerid] = team;
return SetPlayerTeam(playerid, 999);
}
#if defined _ALS_SetPlayerTeam
#undef SetPlayerTeam
#else
#define _ALS_SetPlayerTeam
#endif
#define SetPlayerTeam TF_SetPlayerTeam
forward TF_GetPlayerTeam(playerid);
public TF_GetPlayerTeam(playerid)
{
return PlayerTeam[playerid];
}
#if defined _ALS_GetPlayerTeam
#undef GetPlayerTeam
#else
#define _ALS_GetPlayerTeam
#endif
#define GetPlayerTeam TF_GetPlayerTeam