Guten Tag Community, Ich habe ein Problem sonder das Attach3DTextLabelToVehicle. Wie kann ichs machen das wenn das Car schrott geht soll Attach3DTextLabelToVehicle auch weg sein.
Hier die Sachen :
if(dialogid == DIALOG_ADMINCARS)
{
if(response==1)
{
switch(listitem)
{
case 0 : // Wenn er Auto Sultan nimmt
{
new Text3D:vehicle3Dtext;
//Creating TextLabel
vehicle3Dtext = Create3DTextLabel( "Support-Car", COLOR_YELLOW, 0.0, 0.0, 0.0, 50.0, 0, 1 );
new Float:x,Float:y,Float:z,Float:a;
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,a);
sultan=CreateVehicle(560,x,y,z,a,1,1,60);
SetVehicleHealth(sultan,10000);
PutPlayerInVehicle(playerid, sultan, 0);
Attach3DTextLabelToVehicle( vehicle3Dtext, sultan, 0.0, 0.0, 2.0);
}
case 1 : // Wenn er Auto Golfmobile nimmt
{
new Text3D:vehicle3Dtext;
//Creating TextLabel
vehicle3Dtext = Create3DTextLabel( "Support-Car", COLOR_YELLOW, 0.0, 0.0, 0.0, 50.0, 0, 1 );
new Float:x,Float:y,Float:z,Float:a;
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,a);
golfmobile=CreateVehicle(457,x,y,z,a,1,1,60);
SetVehicleHealth(golfmobile,10000);
PutPlayerInVehicle(playerid, golfmobile, 0);
//Attaching Text Label To Vehicle
Attach3DTextLabelToVehicle( vehicle3Dtext, golfmobile, 0.0, 0.0, 2.0);
}
case 2 : //Wenn er die NRG nimmt
{
new Text3D:vehicle3Dtext;
//Creating TextLabel
vehicle3Dtext = Create3DTextLabel( "Support-Car", COLOR_YELLOW, 0.0, 0.0, 0.0, 50.0, 0, 1 );
new Float:x,Float:y,Float:z,Float:a;
GetPlayerPos(playerid,x,y,z);
GetPlayerFacingAngle(playerid,a);
nrg=CreateVehicle(522,x,y,z,a,1,1,60);
SetVehicleHealth(nrg,10000);
PutPlayerInVehicle(playerid, nrg, 0);
Attach3DTextLabelToVehicle( vehicle3Dtext, nrg, 0.0, 0.0, 2.0);
}
}
}
}
Und Hier ist das Tot:
if(vehicleid==golfmobile)DestroyVehicle(golfmobile);
if(vehicleid==nrg)DestroyVehicle(nrg);
if(vehicleid==sultan)DestroyVehicle(sultan);