The text appears, but he never goes away.
Code:
if(strcmp(cmdtext, "/infernus", true)==0)
{
if( PVeh[playerid] > 0 )
{
if(GetPlayerVehicleID(playerid) != PVeh[playerid])
{
if(IsPlayerInAnyVehicle(playerid))
{
RemovePlayerFromVehicle(playerid);
}
HidePlayerInfoTextDraws(playerid);
new Float: X, Float: Y, Float: Z, Float: Ang, Name[30];
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
GetPlayerName(playerid, Name, sizeof( Name ));
PutPlayerInVehicle(playerid, PVeh[playerid], 0);
SetVehiclePos(PVeh[playerid], X, Y, Z);
SetVehicleZAngle(PVeh[playerid], Ang);
SetVehicleHealth(PVeh[playerid], 1000.0);
LinkVehicleToInterior(PVeh[playerid], GetPlayerInterior(playerid));
TextDrawShowForPlayer(playerid, Text:VehicleCalled);
HidePlayerInfoTextDrawst[playerid] = SetTimerEx("HidePlayerInfoTextDraws", 4000, 0, "i", playerid);
}
else
{
HidePlayerInfoTextDraws(playerid);
TextDrawShowForPlayer(playerid, Text:VehicleError);
HidePlayerInfoTextDrawst[playerid] = SetTimerEx("HidePlayerInfoTextDraws", 4000, 0, "i", playerid);
}
}
else
{
if(IsPlayerInAnyVehicle(playerid))
{
RemovePlayerFromVehicle(playerid);
}
HidePlayerInfoTextDraws(playerid);
new Float: X, Float: Y, Float: Z, Float: Ang, Name[30];
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Ang);
GetPlayerName(playerid, Name, sizeof( Name ));
PVeh[playerid] = CreateVehicle(522, X, Y , Z, Ang, 75,3, 5000000);
PutPlayerInVehicle(playerid, PVeh[playerid], 0);
LinkVehicleToInterior(PVeh[playerid], GetPlayerInterior(playerid));
TextDrawShowForPlayer(playerid, Text:VehicleCreated);
HidePlayerInfoTextDrawst[playerid] = SetTimerEx("HidePlayerInfoTextDraws", 4000, 0, "i", playerid);
SetVehicleParamsForPlayer(PVeh[playerid], playerid, 0, 0);
for(new i=0; i <= MAX_PLAYERS; i++)
{
if ( IsPlayerConnected(i) )
{
if ( i != playerid )
{
SetVehicleParamsForPlayer(PVeh[playerid], i, 0, 1);
}
}
}
}
return 1;
}