SA-MP Forums Archive
Need Small Help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Need Small Help (/showthread.php?tid=528389)



Need Small Help - MBilal - 27.07.2014

why this not work?
PHP код:
public OnPlayerTakeDamage(playeridissueridFloatamountweaponidbodypart)
{
       if(
weaponid == 8)
          {
          new 
Float:HP;
        
GetPlayerHealth(playeridHP);
        
SetPlayerHealth(playerid,HP-50.0);
        
PlayerPlaySound(issuerid,17802,0.0,0.0,0.0);
        
PlayerPlaySound(playerid,17802,0.0,0.0,0.0);
        return 
1;
}
return 
1;
}
          } 



Re: Need Small Help - David (Sabljak) - 27.07.2014

Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
       if(issuerid != INVALID_PLAYER_ID && weaponid == 8)
          {
          new Float:HP;
        GetPlayerHealth(playerid, HP);
        SetPlayerHealth(playerid,HP-50.0);
        PlayerPlaySound(issuerid,17802,0.0,0.0,0.0);
        PlayerPlaySound(playerid,17802,0.0,0.0,0.0);
        }
return 1;
}
Try this?


Re: Need Small Help - MBilal - 27.07.2014

Dude I Already Try That Still not work


Re: Need Small Help - TheKillZone - 27.07.2014

what is the error code?


Re: Need Small Help - MBilal - 27.07.2014

I get no Error ,I want to Get Playerid Half HP when he Hit by Katana by Issuerid


Re: Need Small Help - David (Sabljak) - 27.07.2014

Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
	if(issuerid != INVALID_PLAYER_ID && weaponid == 8)
	{
		new Float:HP;
		print("Debug 1");
		GetPlayerHealth(playerid, HP);
		print("Debug 2");
		SetPlayerHealth(playerid,HP-50);
		print("Debug 3");
		PlayerPlaySound(issuerid,17802,0.0,0.0,0.0);
		print("Debug 4");
		PlayerPlaySound(playerid,17802,0.0,0.0,0.0);
		print("Debug 5");
	}
	return 1;
}
hit someone with katana and see server.log