unreachable code
#2

That is because you put that line after return 1; so there is no way that code can be executed.
Try this:
PHP код:
public OnPlayerTakeDamage(playeridissueridFloat:amountweaponid)
{
if(
issuerid != INVALID_PLAYER_ID && (weaponid == 34 ) )
{
SetPlayerHealth(playerid0.0);
new 
stringa[MAX_PLAYER_NAME+40];
new 
name[MAX_PLAYER_NAME];
GetPlayerName(playeridnamesizeof(name));
format(stringasizeof(stringa), "[ ! ]:[%s] He was killed by a shot to the head"name);
SendClientMessageToAll(0xFFFF00FF,stringa);
}
if(
GetPVarInt(playerid"commitSuicide") == 1//line 98560
{
SetPVarInt(playerid"commitSuicide"0);
}
return 
1
Also, if you want to make a headshot system, use bodypart parameter by putting it in OnPlayerGiveDamage: https://sampwiki.blast.hk/wiki/OnPlayerGiveDamage
https://sampwiki.blast.hk/wiki/Body_Parts
Reply


Messages In This Thread
unreachable code - by hoangtn219 - 18.04.2015, 04:14
Re: unreachable code - by ATGOggy - 18.04.2015, 05:35

Forum Jump:


Users browsing this thread: 1 Guest(s)