removes player from player-owned Journeys when they disconnect
This commit is contained in:
parent
130f1c581e
commit
b9066187e6
@ -518,3 +518,30 @@ stock GetPlayerCausticSoda( playerid ) return p_CausticSoda{ playerid };
|
|||||||
stock SetPlayerCausticSoda( playerid, amount ) {
|
stock SetPlayerCausticSoda( playerid, amount ) {
|
||||||
p_CausticSoda{ playerid } = amount;
|
p_CausticSoda{ playerid } = amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stock RemovePlayersFromJourney( vehicleID )
|
||||||
|
{
|
||||||
|
new Float: x, Float: y, Float: z;
|
||||||
|
|
||||||
|
foreach ( new playerid : Player )
|
||||||
|
{
|
||||||
|
if ( GetPlayerVirtualWorld( playerid ) == ( vehicleID + VW_METH ) && !p_Spectating{ playerid } )
|
||||||
|
{
|
||||||
|
haltMethamphetamine( playerid, vehicleID );
|
||||||
|
|
||||||
|
GetVehiclePos( vehicleID, x, y, z );
|
||||||
|
SetPlayerPos( playerid, x, y, z );
|
||||||
|
SetPlayerInterior( playerid, 0 );
|
||||||
|
SetPlayerVirtualWorld( playerid, 0 );
|
||||||
|
|
||||||
|
p_MuriaticAcid{ playerid } = 0;
|
||||||
|
p_CausticSoda{ playerid } = 0;
|
||||||
|
p_Methamphetamine{ playerid } = 0;
|
||||||
|
p_HydrogenChloride{ playerid } = 0;
|
||||||
|
|
||||||
|
SendServerMessage( playerid, "You have been removed from a player-owned Journey as the player who owned it has left the server." );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
@ -846,8 +846,12 @@ stock dischargeVehicles( playerid )
|
|||||||
if ( p_OwnedVehicles[ playerid ] )
|
if ( p_OwnedVehicles[ playerid ] )
|
||||||
{
|
{
|
||||||
for( new v; v < MAX_BUYABLE_VEHICLES; v++ )
|
for( new v; v < MAX_BUYABLE_VEHICLES; v++ )
|
||||||
|
{
|
||||||
|
if ( g_vehicleData[ playerid ][ v ][ E_MODEL ] == 508 ) RemovePlayersFromJourney( g_vehicleData[ playerid ][ v ][ E_VEHICLE_ID ] );
|
||||||
DestroyBuyableVehicle( playerid, v, .db_remove = false );
|
DestroyBuyableVehicle( playerid, v, .db_remove = false );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user