Another problem with on player death
#1

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

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

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

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)