Problem with damage
#1

Hey. I canґt make any damage with guns on the server. Guns like flamethrower and RPGґs work, though. Hereґs the code.

Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    new Float:HP;
    GetPlayerHealth(playerid, HP);
    if(weaponid == 4) SetPlayerHealth(playerid, HP-30);
    if(weaponid == 22) SetPlayerHealth(playerid, HP-25);
    if(weaponid == 32) SetPlayerHealth(playerid, HP-25);
    if(weaponid == 28) SetPlayerHealth(playerid, HP-25);
    if(weaponid == 30) SetPlayerHealth(playerid, HP-30);
    if(weaponid == 31) SetPlayerHealth(playerid, HP-21);
    if(weaponid == 34) SetPlayerHealth(playerid, HP-70);
    if(weaponid == 29) SetPlayerHealth(playerid, HP-25);

    if(weaponid == 25) SetPlayerHealth(playerid, HP-40);

 	if(!IsPlayerConnected(playerid)) return 0;
  	if(!IsPlayerConnected(issuerid)) return 0;

   	if(issuerid != INVALID_PLAYER_ID)
   	{
   	    if(weaponid == 0 || weaponid == 1 || weaponid == 2 || weaponid == 3 || weaponid == 4 || weaponid == 5 ||
		    weaponid == 6 || weaponid == 7 || weaponid == 8 || weaponid == 15)
   	    {
   			sInfo[playerid][Misc] += 1;
		}
   	}
  	if(issuerid != INVALID_PLAYER_ID && weaponid == 34 && bodypart == 9)
   	{
		SetPlayerHealth(playerid, 0.0);
   	}
  	if(issuerid != INVALID_PLAYER_ID && bodypart == 3)
   	{
   		if(weaponid == 22 || weaponid == 23 || weaponid == 24 || weaponid == 25 || weaponid == 26 || weaponid == 27 ||
		    weaponid == 28 || weaponid == 29 || weaponid == 30 || weaponid == 31 || weaponid == 32 || weaponid == 33 || weaponid == 34)
   	    {
   			sInfo[playerid][Chest] += 1;
		}
   	}
  	if(issuerid != INVALID_PLAYER_ID && bodypart == 4)
   	{
   		if(weaponid == 22 || weaponid == 23 || weaponid == 24 || weaponid == 25 || weaponid == 26 || weaponid == 27 ||
		    weaponid == 28 || weaponid == 29 || weaponid == 30 || weaponid == 31 || weaponid == 32 || weaponid == 33 || weaponid == 34)
   	    {
   			sInfo[playerid][Crotch] += 1;
		}
   	}
  	if(issuerid != INVALID_PLAYER_ID && bodypart == 5)
   	{
   		if(weaponid == 22 || weaponid == 23 || weaponid == 24 || weaponid == 25 || weaponid == 26 || weaponid == 27 ||
		    weaponid == 28 || weaponid == 29 || weaponid == 30 || weaponid == 31 || weaponid == 32 || weaponid == 33 || weaponid == 34)
   	    {
   			sInfo[playerid][LArm] += 1;
		}
   	}
  	if(issuerid != INVALID_PLAYER_ID && bodypart == 6)
   	{
   		if(weaponid == 22 || weaponid == 23 || weaponid == 24 || weaponid == 25 || weaponid == 26 || weaponid == 27 ||
		    weaponid == 28 || weaponid == 29 || weaponid == 30 || weaponid == 31 || weaponid == 32 || weaponid == 33 || weaponid == 34)
   	    {
   			sInfo[playerid][RArm] += 1;
		}
   	}
  	if(issuerid != INVALID_PLAYER_ID && bodypart == 7)
   	{
   		if(weaponid == 22 || weaponid == 23 || weaponid == 24 || weaponid == 25 || weaponid == 26 || weaponid == 27 ||
		    weaponid == 28 || weaponid == 29 || weaponid == 30 || weaponid == 31 || weaponid == 32 || weaponid == 33 || weaponid == 34)
   	    {
   			sInfo[playerid][LLeg] += 1;
		}
   	}
  	if(issuerid != INVALID_PLAYER_ID && bodypart == 8)
   	{
   		if(weaponid == 22 || weaponid == 23 || weaponid == 24 || weaponid == 25 || weaponid == 26 || weaponid == 27 ||
		    weaponid == 28 || weaponid == 29 || weaponid == 30 || weaponid == 31 || weaponid == 32 || weaponid == 33 || weaponid == 34)
   	    {
   			sInfo[playerid][RLeg] += 1;
		}
   	}
  	if(issuerid != INVALID_PLAYER_ID && bodypart == 9)
   	{
   		if(weaponid == 22 || weaponid == 23 || weaponid == 24 || weaponid == 25 || weaponid == 26 || weaponid == 27 ||
		    weaponid == 28 || weaponid == 29 || weaponid == 30 || weaponid == 31 || weaponid == 32 || weaponid == 33 || weaponid == 34)
   	    {
   	    	SetPlayerHealth(playerid, HP-70);
   			sInfo[playerid][Head] += 1;
		}
   	}
	return 1;
}
Reply


Messages In This Thread
Problem with damage - by HNIC - 28.01.2018, 00:29
Re: Problem with damage - by iKarim - 28.01.2018, 05:12
Re: Problem with damage - by iSteve - 28.01.2018, 09:29
Re: Problem with damage - by HNIC - 28.01.2018, 13:11
Re: Problem with damage - by HNIC - 29.01.2018, 12:08
Re: Problem with damage - by Flamehaze7 - 29.01.2018, 12:38
Re: Problem with damage - by Mugala - 29.01.2018, 12:46
Re: Problem with damage - by HNIC - 29.01.2018, 19:20
Re: Problem with damage - by Mugala - 29.01.2018, 19:21

Forum Jump:


Users browsing this thread: 1 Guest(s)