02.02.2015, 14:40

Ok , i'm trying to create a damage system..
When the player have weapon skill == 1 te reduce game 50%
when is == 5 to don't reduce.
As you can see in the screen i upgraded my weapon skill to 2 , and the damage still 46 was... how can i make it works ?
This is my system
pawn Код:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
{
new string[128], victim[MAX_PLAYER_NAME], attacker[MAX_PLAYER_NAME];
new weaponname[24];
GetPlayerName(playerid, attacker, sizeof (attacker));
GetPlayerName(damagedid, victim, sizeof (victim));
GetWeaponName(weaponid, weaponname, sizeof (weaponname));
format(string, sizeof(string), "%s has made %.0f damage to %s, weapon: %s", attacker, amount, victim, weaponname);
SendClientMessageToAll(0xFFFFFFFF, string);
new Float:HP;
GetPlayerHealth(damagedid, HP);
new Float: newamount;
if(PlayerInfo[playerid][WeaponSkills] == 1)
{
newamount = amount - 50;
}
if(PlayerInfo[playerid][WeaponSkills] == 2) { newamount = amount - 40; }
if(PlayerInfo[playerid][WeaponSkills] == 3) { newamount = amount - 30; }
if(PlayerInfo[playerid][WeaponSkills] == 4) { newamount = amount - 20; }
if(PlayerInfo[playerid][WeaponSkills] == 5) { newamount = amount; }
if(weaponid != 0)
{
SetPlayerHealth(damagedid, HP-newamount);
}
return 1;
}