SA-MP Forums Archive
death - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: death (/showthread.php?tid=247227)



death - fissekarl - 08.04.2011

How can I make Vehicle, Helicopter Blades, Explosion, Drowned, Splat count as a death count?


Re: death - Malcor - 08.04.2011

if player died. killed got a score right? with any types of killing


Re: death - fissekarl - 08.04.2011

It only gives kills/deaths when you kill a player or die by a player.

Nothing with those I stated above ^


Re: death - admantis - 08.04.2011

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if (killerid == INVALID_PLAYER_ID)
    {
          // Player died, but there's no killer (explosion, splat, drown, /kill command)...
    }
    return 1;
}



Re: death - fissekarl - 08.04.2011

do I need to add inside the brackets or?


Re: death - admantis - 08.04.2011

Replace the comment with the functions, what will happen if player died BUT there's no killer.


Re: death - Malcor - 08.04.2011

so when a vehicle is broken down you want the player to get a score? if im wrong please explain


Re: death - fissekarl - 08.04.2011

I dont understand man what I have to put inside i tried several ways but errors or it wont work


Re: death - admantis - 08.04.2011

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if (killerid == INVALID_PLAYER_ID)
    {
          // Put in -HERE- what will happen when a player dies BUT there is NO KILLER. So he died from
          // ¬SPLAT, ¬EXPLOSION, ¬DROWN.
    }
    return 1;
}



Re: death - fissekarl - 08.04.2011

Okay I got it working.

Thanks.

I have one question, the killerid which kills a player with a helicopter, vehicle, how can I give them a kill count?

I've done this

pawn Код:
if (killerid == INVALID_PLAYER_ID)
    {
        PInfo[playerid][Deaths]++;
    }
so I tried this

pawn Код:
if (killerid == INVALID_PLAYER_ID)
    {
            PInfo[playerid][Kills]++;
        PInfo[playerid][Deaths]++;
    }
but that will raise my kill count when I drown or fall too, so how to avoid that?