SA-MP Forums Archive
[question / help] +1 Score for murder with a fighter / tank / apache - 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: [question / help] +1 Score for murder with a fighter / tank / apache (/showthread.php?tid=510283)



[question / help] +1 Score for murder with a fighter / tank / apache - Rhymed32 - 30.04.2014

hello
the problem is this: I need to when the player sitting in the fighter, tank or Apache and he somebody killed him (shot) that the murderer gave +1 Score
nothing I can not do
off site also do not know
help)


Re: [question / help] +1 Score for murder with a fighter / tank / apache - Rhymed32 - 02.05.2014

UP


Re: [question / help] +1 Score for murder with a fighter / tank / apache - BroZeus - 02.05.2014

do u want to give +1 score to person sitting in tank or the person who killed him?


Re: [question / help] +1 Score for murder with a fighter / tank / apache - Rhymed32 - 03.05.2014

Quote:
Originally Posted by BroZeus
Посмотреть сообщение
do u want to give +1 score to person sitting in tank or the person who killed him?
No! Look at this: you're sitting in the tank, the other player so zhe.Ty shoot him - he dies, and they give you one point, and the deceased -1


Re: [question / help] +1 Score for murder with a fighter / tank / apache - Dignity - 03.05.2014

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{

    if(killerid != INVALID_PLAYER_ID)
    {
        switch(GetPlayerVehicleID(killerid))
        {

            // Rhino and Hunter
            case 425, 432:
            {
                SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
                SetPlayerScore(playerid, GetPlayerScore(playerid) - 1);
            }
        }
    }

    return 1;
}



Re: [question / help] +1 Score for murder with a fighter / tank / apache - Rhymed32 - 04.05.2014

does not work((


Re: [question / help] +1 Score for murder with a fighter / tank / apache - Dignity - 04.05.2014

It's an example of how it could be, make it yourself using my example.


Re: [question / help] +1 Score for murder with a fighter / tank / apache - Rhymed32 - 04.05.2014

there may be other relevant options?


Re: [question / help] +1 Score for murder with a fighter / tank / apache - Rhymed32 - 08.05.2014

UP!!!


Re: [question / help] +1 Score for murder with a fighter / tank / apache - Konstantinos - 08.05.2014

Quote:
Originally Posted by Mionee
Посмотреть сообщение
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{

    if(killerid != INVALID_PLAYER_ID)
    {
        switch(GetPlayerVehicleID(killerid))
        {

            // Rhino and Hunter
            case 425, 432:
            {
                SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
                SetPlayerScore(playerid, GetPlayerScore(playerid) - 1);
            }
        }
    }

    return 1;
}
You need to get the vehicle's model ID so it should be:
pawn Код:
switch(GetVehicleModel(GetPlayerVehicleID(killerid)))
Note that it sometimes make the player dies from explosion and the killer is invalid (so it will fail there).