10.01.2011, 11:45
well here is the fix code
pawn Код:
public ArmourUpdate()
{
new Float:armour;//this is our armour value
for(new i=0; i<=GetMaxPlayers(); i++)//i'm put this code, cause i had bug before, when armour can have only player with id 0!
{
GetPlayerArmour(i, armour);//checking hommuch armour player has...
if( armour > 0.0 )//...if player has more then 0.0 of armour...
{
SetPlayerAttachedObject( i, ARMOUR_INDEX, 373, 1, 0.286006, -0.038657, -0.158132, 67.128456, 21.916156, 33.972290, 1.000000, 1.000000, 1.000000 ); // ...armour getting on the players body...
}
else if( armour == 0.0 )//...if player do not have armour...
{
RemovePlayerAttachedObject(i, ARMOUR_INDEX); // ...armour getting off the players body...
}
return 1;//the value what function returning
}
return 0;
}

