GetPlayerVehicleID help
#1

Right now I'm working on a script where if a user crashes into this building with an andromada the building will go down. I used CreateDynamicCube to make an area for it but how do I make it so that it will check the players vehicle ID after he dies?
Reply
#2

Make a timer that will check : Player Vehicle ID, If is player in that specific zone and to check player health ^^. Run it every secounds or so.
Reply
#3

it's impossible to check it AFTER player dies, because player gets removed from vehicle..
Reply
#4

Mm...

Use GetPlayerVehicleID in the OnPlayerDeath callback?

pawn Код:
pubilc OnPlayerDeath(playerid, killerid)
{
     return 1;
}
Store what is a returned in a global variable so that AFTER he dies the vehicle id will still be available in that variable.
Reply
#5

I'm really not sure how. Could someone give an example?
Reply
#6

Create that building
Create gang zone a bit bigger than a building (about 5 meters bigger)
If player enter that gang zone get player vehicle id
Reply
#7

OnPlayerStreamIn maybe ?
Reply
#8

here's my code...
pawn Код:
public OnPlayerEnterDynamicArea(playerid, areaid)
{
    if(areaid == CommercialBuildingArea && GetPlayerVehicleID(playerid) == 592 && gTeam[playerid] == TEAM_TERRORIST)
    {
        AbleToBlowCommercialBuilding[playerid] = 1;
    }
}
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(AbleToBlowCommercialBuilding[playerid] == 1)
    {
        MoveDynamicObject(CommercialBuilding,1024.31127930,3727.24169922,-119.52521515,15);
        SendClientMessage(playerid, 0x00C7FFAA, "You have crashed your Andromada into the Commercial Building");
        AbleToBlowCommercialBuilding[playerid] = 0;
    }
Reply
#9

pawn Код:
public OnPlayerEnterDynamicArea(playerid, areaid)
{
    if(areaid == CommercialBuildingArea && GetPlayerVehicleID(GetPlayerVehicleID(playerid)) == 592 && gTeam[playerid] == TEAM_TERRORIST)
    {
        AbleToBlowCommercialBuilding[playerid] = 1;
    }
}
Or you can just use:

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(IsInRangeOfPoint(...)
    {
        if(GetPlayerVehicleID(GetPlayerVehicleID(playerid)) ==  592 && gTeam[playerid] == TEAM_TERRORIST)
        {
            MoveObject(...);
        }
    }
    return 1;
}
Reply
#10

I could use that but as *IsBack pointed out, you can't get a player's vehicle id after he dies because it removes him from the vehicle.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)