public OnPlayerShootPlayer(Shooter,Target,Float:HealthLost,Float:ArmourLost)
{
if (IsPlayerInRangeOfPoint(Target, 2.0, the x pos of the player spawn points, y, z))
{
new Float:health;
GetPlayerHealth(Shooter,health);
SetPlayerHealth(Shooter, health-5); // It will decrease 5 hp at each shoot
return 1;
}
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
if(issuerid != INVALID_PLAYER_ID)
{
if(IsPlayerInRangeOfPoint(playerid, range, x, y, z))
{
SetPlayerHealth(playerid, GetPlayerHealth(playerid)+amount);
SetPlayerHealth(issuerid, GetPlayerHealth(playerid)-amount);
}
}
return 1;
}
|
Код:
SetPlayerHealth(playerid, GetPlayerHealth(playerid)+amount);
SetPlayerHealth(issuerid, GetPlayerHealth(playerid)-amount);
|
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
if(issuerid != INVALID_PLAYER_ID)
{
if(IsPlayerInRangeOfPoint(playerid, range, x, y, z))
{
new Float:hp;
GetPlayerHealth(playerid, hp);
SetPlayerHealth(playerid, hp + amount);
GetPlayerHealth(playerid, hp);
SetPlayerHealth(issuerid, hp - amount);
}
}
return 1;
}
|
Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
if(issuerid != INVALID_PLAYER_ID)
{
if(IsPlayerInRangeOfPoint(playerid, range, x, y, z))
{
new Float:hp;
GetPlayerHealth(playerid, hp);
SetPlayerHealth(playerid, hp + amount);
GetPlayerHealth(playerid, hp);
SetPlayerHealth(issuerid, hp - amount);
}
}
return 1;
}
|
I didn't even compile my code