[Help] On player exit vehicle (destroying.)
#1

Hey guys..
i need help with this
when u exit of vehicle vehicle destroy ( it works perfect)
but i want when player exit of vehicle , car destroy for 2 mins

public OnPlayerExitVehicle(playerid, vehicleid)
{
new currentveh;
currentveh = GetPlayerVehicleID(playerid);
DestroyVehicle(currentveh);
return 1;
}
__________________________________________________ ____________
IP : 188.40.57.132:7777
Drift - Generation
Reply
#2

It destroys IN two minutes, or FOR two minutes?
Reply
#3

after exit destroy for 2 mins (example 2 mins )
Reply
#4

For 2 mins = Destroys immediatly after the player exists AND recreated after 2 minutes.
In 2 mins = Destroys AFTER 2 mins.
So what did you mean?
Reply
#5

pawn Код:
CreateVehicle(modelid, Float:x, Float:y, Float:z, Float:angle, color1, color2, 120);

https://sampwiki.blast.hk/wiki/CreateVehicle
Reply
#6

In 2 mins = Destroys AFTER 2 mins.
rofl haha
Reply
#7

some1 knows?!
Reply
#8

pawn Код:
forward destroytimer(playerid);
new timer[MAX_PLAYERS];
public OnPlayerExitVehicle(playerid, vehicleid)
{
    timer[playerid] = SetTimerEx("destroytimer",2*60*1000,false,"i",playerid);
    return 1;
}
public destroytimer(playerid)
{
    KillTimer(timer[playerid]);
    DestroyVehicle(GetPlayerVehicleID(playerid));
    return 1;
}
I think that should work.
Reply
#9

this 1 dont works..
So can i find /destroyallcars command?
Reply
#10

pawn Код:
// At The Top
new
    timer[ MAX_PLAYERS ];

public OnPlayerStateChange( playerid, newstate, oldstate )
{
    if( oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT )
    {
        timer[ playerid ] = SetTimerEx( "destroytimer", 120000, false, "i", playerid );
    }
    return 1;
}

forward destroytimer( playerid );
public destroytimer( playerid )
{
    DestroyVehicle( GetPlayerVehicleID( playerid ) );
    return 1;
}
pawn Код:
CMD:destroyallcars( playerid, params[ ] )
{
    for( new i = 1; i <= MAX_VEHICLES; i ++ )
    {
        DestroyVehicle( i );
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)