SA-MP Forums Archive
How to get reason damage - 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: How to get reason damage (/showthread.php?tid=650456)



How to get reason damage - hoanduy - 28.02.2018

How to identify players attack by means


Re: How to get reason damage - PepsiCola23 - 28.02.2018

https://sampwiki.blast.hk/wiki/OnPlayerWeaponShot also includes death by heli blades and etc. have a look there

https://sampwiki.blast.hk/wiki/OnPlayerDeath


Re: How to get reason damage - jasperschellekens - 28.02.2018

public OnPlayerDeath(playerid, killerid, reason)

On player death, the cause of death ID will be saved into "reason"
This includes a weapon ID, or for example ID 51 for explosion.
IDS: https://sampwiki.blast.hk/wiki/Weapons


Re: How to get reason damage - hoanduy - 28.02.2018

I want to make the player attack someone by car, then automatically kick off the server


Re: How to get reason damage - jasperschellekens - 28.02.2018

Quote:
Originally Posted by hoanduy
Посмотреть сообщение
I want to make the player attack someone by car, then automatically kick off the server
Are you sure? what if someone accidentally crashes into someone? He gets kicked.. You might want to do it onplayerdeath.

PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
    if(
reason == 49// if weapon id is a vehicle
{
   
Kick(killerid);//kick killer id
}
return 
1;




Re: How to get reason damage - hoanduy - 01.03.2018

Quote:
Originally Posted by jasperschellekens
Посмотреть сообщение
Are you sure? what if someone accidentally crashes into someone? He gets kicked.. You might want to do it onplayerdeath.

PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
    if(
reason == 49// if weapon id is a vehicle
{
   
Kick(killerid);//kick killer id
}
return 
1;

But I do not want to put in OnPlayerDeath


Re: How to get reason damage - rolex - 01.03.2018

then.. try this.

PHP код:
public OnPlayerTakeDamage(playeridissueridFloatamountweaponidbodypart)
{
    if(
weaponid == 49)
    {
        
Kick(issuerid);
    }
    return 
1;

when someone get hurt by vehicle, the driver is kicked.