18.04.2015, 02:35
Hice esto, me gustarнa que me dijeran si las dos funciones son correctas o no, muchas gracias.
Y dejo los stock, por si acaso:
PHP код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
if(issuerid == INVALID_PLAYER_ID)
{
SetPlayerHealthEx(playerid, GetPlayerHealthEx(playerid) -amount);
}
return 1;
}
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
{
if(damagedid != INVALID_PLAYER_ID)
{
if(GetPlayerArmourEx(damagedid) == 0)
{
SetPlayerHealthEx(damagedid, GetPlayerHealthEx(playerid) -amount);
}
else
{
SetPlayerArmourEx(damagedid, GetPlayerArmourEx(damagedid) -amount);
}
}
return 1;
}
PHP код:
stock SetPlayerHealthEx(playerid, Float:health)
{
SetPlayerHealth(playerid, Float:health);
Informacion[playerid][pVida] = health;
return 1;
}
stock SetPlayerArmourEx(playerid, Float:armour)
{
SetPlayerArmour(playerid, armour);
Informacion[playerid][pChaleco] = armour;
return 1;
}
stock Float:GetPlayerHealthEx(playerid)
{
new Float:vida = Informacion[playerid][pVida];
return vida;
}
stock Float:GetPlayerArmourEx(playerid)
{
new Float:chaleco = Informacion[playerid][pChaleco];
return chaleco;
}