Cars destroying when player leaves
#1

As I said in the title, I want to destroy a players car, without messing up the vehicle IDs. I know how to do it, but the vehicle IDs are messing up... Does anyone have any solutions?
Reply
#2

I'm confused why do you exactly want to destroy someones car?

Also i don't know how some Gamemodes work. But if you are admin you could delete the car yourself.
Reply
#3

because of the vehicle's limit and for the space...
Reply
#4

here ya go
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
new xveh;
          xveh = GetPlayerVehicleID(playerid);
          DestroyVehicle(xveh);
return 1;
}
Reply
#5

Quote:
Originally Posted by XtremeR
Посмотреть сообщение
here ya go
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
new xveh;
          xveh = GetPlayerVehicleID(playerid);
          DestroyVehicle(xveh);
return 1;
}
.....
Reply
#6

ONE WAY
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{

    if(GetPlayerState(playerid)==PLAYER_STATE_DRIVER)
    {
        DestroyVehicle(vehicleid);//thats supposed to be in the timer. no slapping out
    }
}
ANOTHER WAY [UNTESTED]
pawn Код:
new bool:IsDriver[MAX_PLAYERS] = false;
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate==PLAYER_STATE_DRIVER)
    {
        IsDriver[playerid]=true;
    }
    return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
    if(IsDriver)
    {
        new currentveh;
        currentveh = GetPlayerVehicleID(playerid);
        DestroyVehicle(currentveh);
        IsDriver[playerid]=false;
    }
    return 1;
}
Reply
#7

I said, I know how to do this, but I need to know how to make the vehicle IDs not to mess up. All of you didn't read ... When the player LOGS OUT.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)