#define ARMOUR_INDEX 4 // this is the index of armour
public OnPlayerUpdate(playerid)
{
new Float:armour[MAX_PLAYERS];
GetPlayerArmour(playerid, armour[playerid]);
if( armour[playerid] > 0.0 )
{
SetPlayerAttachedObject( playerid, ARMOUR_INDEX, 1242, 1, 0.019999, 0.039999, 0.000000, 2.459999, 89.699989, -3.100000, 1.710000, 2.119999, 1.719999);//áðîíÿ
}
else if( armour[playerid] == 0.0 && IsPlayerAttachedObjectSlotUsed(i, ARMOUR_INDEX))
{
RemovePlayerAttachedObject(playerid, ARMOUR_INDEX); // armour
}
return 1;
}
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;
}
great job!!!!!fuck, this great!!!!!!!!!!!!!!!!!!!good job! |
well here is the fix code |
forward ArmourUpdate();
forward ArmourUpdate(); public ArmourUpdate() { new Float:armour;//this is our armour value for(new i=i;i<MAX_PLAYERS;i++)// { 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.034657, -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; }