Player not taking damage
#3

Yes here is it (It has some parts on Serbian language because Gamemode is on that language so I translated this)


Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    if(issuerid != INVALID_PLAYER_ID)
    {

                ////// THIS IS FOR POLICE TASER (tazer = taser maybe is spelled it wrong)

		if(IgracPolicajac(issuerid))
		{
			if(GetPlayerWeapon(issuerid) == 23)
			{
				new string[128], Float:Poz[3];
				GetPlayerPos(playerid, Poz[0], Poz[1], Poz[2]);
				if(IsPlayerInRangeOfPoint(issuerid, 5.0, Poz[0], Poz[1], Poz[2]))
				{
					if(PlayerInfo[playerid][pTrazeniLevel] == 0) return SCM(issuerid,-1,""PLAVA"[ERROR] "SIVA"That player does not have Wanted Level!");
					if(IgracPolicajac(playerid)) return SCM(issuerid,-1,""PLAVA"INFO | "SIVA"YOu can not do that on Police Officer!");
					if(PlayerInfo[issuerid][pRank] == 0) return SCM(issuerid,-1,""PLAVA"INFO | "SIVA"You are suspended!");
					if(AdminDuty[playerid] == 1) return SCM(issuerid,-1,""PLAVA"INFO | "SIVA"That player is Admin on duty!");
					format(string, sizeof(string), "%s shoots with tazer on %s.", GetName(issuerid) ,GetName(playerid));
					ProxDetector(20.0, issuerid, string, PROX,PROX,PROX,PROX,PROX);
					TogglePlayerControllable(playerid, 0); PlayerTazer[playerid] = 1;
					TazerTimerr[playerid] = SetTimerEx("TazerTimer", 15000, false, "i", playerid);
					OnePlayAnim(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
				}
			}
		}
	}

        /////// THIS IS DAMAGE TEXTDRAW IT SAYS LIKE [-9 Damage PlyerName]

	new s[20];
	format(s, 20, "%s (-Damage %.0f)", GetName(playerid),amount);
	TextDrawSetString(TakeDamage[playerid], s);
	TextDrawShowForPlayer(playerid, TakeDamage[playerid]);
	SetTimerEx("DestruirTextoDraw", 1000, false, "i", playerid);

        ////// This is something like for granades it is not very important

	if (weaponid == WEAPON_GRENADE || weaponid == 51)
	{
		new Float:health;
		GetPlayerHealth(playerid, health);
		SetPlayerHealth(playerid, (health - (amount * 0.3)));

		FlashbangStage[playerid] = 1;

		HandleFlashbangStage(playerid);
	}
	return 1;
}
Reply


Messages In This Thread
Player not taking damage - by TokicMajstor - 01.02.2019, 17:10
Re: Player not taking damage - by Nossa - 01.02.2019, 23:20
Re: Player not taking damage - by TokicMajstor - 02.02.2019, 10:20
Re: Player not taking damage - by lollypap54 - 02.02.2019, 14:21
Re: Player not taking damage - by TokicMajstor - 02.02.2019, 17:07
Re: Player not taking damage - by TokicMajstor - 03.02.2019, 09:08

Forum Jump:


Users browsing this thread: 1 Guest(s)