SA-MP Forums Archive
Another problem with on player 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)
+--- Thread: Another problem with on player death (/showthread.php?tid=361923)



Another problem with on player death - CoDeZ - 22.07.2012

pawn Код:
public OnPlayerDeath(playerid,killerid,reason)
{      
                if(GetPlayerVehicleID(killerid)==432)//rhino
        {
            GameTextForPlayer(killerid,"~r~~h~~h~You made a Rhino Kill~n~~w~+2 Scores~n~~g~+500$",5000,3);
            GivePlayerMoney(killerid,500);
            SetPlayerScore(killerid,GetPlayerScore(killerid)+2);
            return 1;
        }
        if(GetPlayerVehicleID(killerid)==476)//rustler
        {
            GameTextForPlayer(killerid,"~r~~h~~h~You made a Plane Kill~n~~w~+3 Scores~n~~g~+1000$",5000,3);
            GivePlayerMoney(killerid,1000);
            SetPlayerScore(killerid,GetPlayerScore(killerid)+3);
            return 1;
        }
         return 1;
}
This should detect if the killer id used rhino , but it doesn't show the text written up in the code , same for the rustler
Why?


Re: Another problem with on player death - leonardo1434 - 22.07.2012

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


Re: Another problem with on player death - [KHK]Khalid - 22.07.2012

GetPlayerVehicleID returns the player's vehicle id not the model id. You should have used GetVehicleModel, like this:

pawn Код:
if(GetVehicleModel(GetPlayerVehicleID(killerid)) == 432)
// and
if(GetVehicleModel(GetPlayerVehicleID(killerid)) == 476)



Re: Another problem with on player death - CoDeZ - 22.07.2012

Quote:
Originally Posted by HellSphinX
Посмотреть сообщение
GetPlayerVehicleID returns the player's vehicle id not the model id. You should have used GetVehicleModel, like this:

pawn Код:
if(GetVehicleModel(GetPlayerVehicleID(killerid)) == 432)
// and
if(GetVehicleModel(GetPlayerVehicleID(killerid)) == 476)
Thanks mate worked