Vehicle Destroying Problem
#1

well i have my cars in a FilterScript and i have it so it destroys the vehicles on exit. but i dont want it to destroy cars with people in them. i have tried

pawn Код:
public OnFilterScriptExit()
{
    for(new p = 0; p < 20; p++)
    {
        for(new i = 0; i < VEHICLES; i++)
        {
            if(!IsPlayerInVehicle(p, i))
            {
            DestroyVehicle(i);
            }
        }
    }
    return 1;
}
But it still takes away the cars for players.

Can someone please post a working code?

P.S. I Searched
Reply
#2

pawn Код:
public OnFilterScriptInit()
{
    for(new vehid;vehid<MAX_VEHICLES;vehid++)
    {
        if(!GetVehicleModel(vehid))continue;
        for(new playerid;playerid<MAX_PLAYERS;playerid++)
        {
            if(!IsPlayerConnected(playerid))continue;
            if(IsPlayerInVehicle(playerid,vehid))
            {
                playerid=-1;
                vehid++;
            }
        }
        DestroyVehicle(vehid);
    }
}
Reply
#3

well i dont know about the original thread starter but it worked for me .... thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)