How to get reason damage
#1

How to identify players attack by means
Reply
#2

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

https://sampwiki.blast.hk/wiki/OnPlayerDeath
Reply
#3

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
Reply
#4

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

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;

Reply
#6

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
Reply
#7

then.. try this.

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)