12.01.2013, 18:41
Brackets fixed.
PHP код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
if(StrategyArmy == 1)
{
new Float: health;
GetPlayerHealth(playerid,health);
switch(weaponid)
{
case 31: SetPlayerHealth(playerid,health-30);
case 24: SetPlayerHealth(playerid,health-30);
case 35: SetPlayerHealth(playerid,health-40);
}
}
if(StrategyArmy == 2)
{
new Float: health;
GetPlayerHealth(playerid,health);
switch(weaponid)
{
case 34: SetPlayerHealth(playerid,health-60);
case 25: SetPlayerHealth(playerid,health-30);
case 16: SetPlayerHealth(playerid,health-70);
}
}
if(StrategyTerror == 1)
{
new Float: health;
GetPlayerHealth(playerid,health);
switch(weaponid)
{
case 31: SetPlayerHealth(playerid,health-30);
case 24: SetPlayerHealth(playerid,health-30);
case 35: SetPlayerHealth(playerid,health-40);
}
}
if(StrategyTerror == 2)
{
new Float: health;
GetPlayerHealth(playerid,health);
switch(weaponid)
{
case 34: SetPlayerHealth(playerid,health-60);
case 25: SetPlayerHealth(playerid,health-30);
case 16: SetPlayerHealth(playerid,health-70);
}
}
if(issuerid != INVALID_PLAYER_ID && weaponid == 4)
{
//One shot to kill with knife
SetPlayerHealth(playerid, 0.0);
}
return 1;
}