SA-MP Forums Archive
Help With OnVehicleDeath!! - 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: Help With OnVehicleDeath!! (/showthread.php?tid=654791)



Help With OnVehicleDeath!! - PaulCrouseVS - 06.06.2018

When I try this, the killerid returns me to playerid

pawn Код:
#include a_samp
#include y_foreach

public OnVehicleDeath(vehicleid, killerid)
{
if (killerid != INVALID_PLAYER_ID)
{
    foreach(new i: Player)
    {
        if(GetPlayerVehicleID(i) == vehicleid && GetPlayerVehicleSeat(i) == 0)
        {
           Datos[killerid][pKillVeh]+= 1;
           Datos[i][pMuertes]+= 1;
           break;
        }
    }
}
return 1;
}
solution?


Re: Help With OnVehicleDeath!! - andrejc999 - 06.06.2018

What's the problem exactly? I can't understand what you mean by "the killerid returns me to playerid".


Re: Help With OnVehicleDeath!! - Sew_Sumi - 06.06.2018

Quote:
Originally Posted by PaulCrouseVS
Посмотреть сообщение
solution?
Read the wiki...

Quote:

killerid The ID of the player that reported (synced) the vehicle's destruction (name is misleading). Generally the driver or a passenger (if any) or the closest player.

This is the same as the OnVehicleDamageStatusUpdate where it's the person who is updating to the server, that is the reporter.