Hey,
ich habe schon wieder Probleme mit TextDraws:
Und zwar hat das Autohaus immer den Preis und das Auto angezeigt.
Nun zeigt er das Textdraw nicht mehr an..
1.
format(string,sizeof(string),"~r~- AUTOHAUS -~n~~g~Fahrzeug: ~w~%s~n~~g~Preis: ~w~$%d~n~~b~Auswaehlen:~n~~w~ <Num 4<~b~&~w~>Num 6> ~n~~b~Kaufen:~w~ Enter ~n~~b~Abbrechen:~w~ Tab",CarName[car-400],preis);
if(!CarKauf[playerid])
{
CarKauf[playerid] = TextDrawCreate(200,310,string);
TextDrawAlignment(CarKauf[playerid],1);
TextDrawUseBox(CarKauf[playerid],1);
TextDrawBoxColor(CarKauf[playerid],0x000000FF);
TextDrawSetOutline(CarKauf[playerid],1);
TextDrawBackgroundColor(CarKauf[playerid],COLOR_BLACK);
TextDrawSetOutline(CarKauf[playerid],1);
TextDrawFont(CarKauf[playerid], 2);
//TextDrawSetProportional(CarKauf[playerid], 2);
TextDrawTextSize(CarKauf[playerid],450,410);
TextDrawShowForPlayer(playerid,CarKauf[playerid]);
}
else
{
TextDrawHideForPlayer(playerid,CarKauf[playerid]);
TextDrawSetString(CarKauf[playerid],string);
TextDrawShowForPlayer(playerid,CarKauf[playerid]);
}
2.
new c1 = random(120);
new c2 = random(120);
DestroyVehicle(dtc_AutohausSCar[playerid]);
dtc_AutohausSCar[playerid] = AddStaticVehicleEx(car, DtcSonstiges[autohaus][1][0],DtcSonstiges[autohaus][1][1],DtcSonstiges[autohaus][1][2],DtcSonstiges[autohaus][1][3],c1,c2,-1);
SetVehicleVirtualWorld(dtc_AutohausSCar[playerid],55+playerid);
new string[246];
TextDrawHideForPlayer(playerid,CarKauf[playerid]);
TextDrawDestroy(CarKauf[playerid]);
format(string,sizeof(string),"~r~- AUTOHAUS -~n~~g~Fahrzeug: ~w~%s~n~~g~Preis: ~w~$%d~n~~b~Auswaehlen:~n~~w~ <Num 4<~b~&~w~>Num 6> ~n~~b~Kaufen:~w~ Enter ~n~~b~Abbrechen:~w~ Tab",CarName[car-400],preis);
CarKauf[playerid] = TextDrawCreate(200,310,string);
TextDrawAlignment(CarKauf[playerid],1);
TextDrawUseBox(CarKauf[playerid],1);
TextDrawBoxColor(CarKauf[playerid],0x000000FF);
TextDrawBackgroundColor(CarKauf[playerid],COLOR_BLACK);
TextDrawSetOutline(CarKauf[playerid],1);
TextDrawFont(CarKauf[playerid], 2);
//TextDrawSetProportional(CarKauf[playerid], 2);
TextDrawTextSize(CarKauf[playerid],450,410);
TextDrawShowForPlayer(playerid,CarKauf[playerid]);
dtc_AutohausCar[playerid] = carid;
}
3.
new c1 = random(120);
new c2 = random(120);
DestroyVehicle(dtc_AutohausSCar[playerid]);
dtc_AutohausSCar[playerid] = AddStaticVehicleEx(car, DtcSonstiges[autohaus][1][0],DtcSonstiges[autohaus][1][1],DtcSonstiges[autohaus][1][2],DtcSonstiges[autohaus][1][3],c1,c2,-1);
SetVehicleVirtualWorld(dtc_AutohausSCar[playerid],55+playerid);
new stringbuy[246];
TextDrawHideForPlayer(playerid,CarKauf[playerid]);
TextDrawDestroy(CarKauf[playerid]);
format(stringbuy,sizeof(stringbuy),"~r~- AUTOHAUS -~n~~g~Fahrzeug: ~w~%s~n~~g~Preis: ~w~$%d~n~~b~Auswaehlen:~n~~w~ <Num 4<~b~&~w~>Num 6> ~n~~b~Kaufen:~w~ Enter ~n~~b~Abbrechen:~w~ Tab",CarName[car-400],preis);
CarKauf[playerid] = TextDrawCreate(200,310,stringbuy);
TextDrawAlignment(CarKauf[playerid],1);
TextDrawUseBox(CarKauf[playerid],1);
TextDrawBoxColor(CarKauf[playerid],0x000000FF);
TextDrawSetOutline(CarKauf[playerid],1);
TextDrawBackgroundColor(CarKauf[playerid],COLOR_BLACK);
TextDrawFont(CarKauf[playerid], 2);
//TextDrawSetProportional(CarKauf[playerid], 2);
TextDrawTextSize(CarKauf[playerid],450,410);
TextDrawShowForPlayer(playerid,CarKauf[playerid]);
dtc_AutohausCar[playerid] = carid;
}
if(newkeys == 16)//Enter
{
new carid = dtc_AutohausCar[playerid];
new car,preis,counter;
for(new ah = 0; ah < sizeof(dtcKaufliste);ah++)
{
if(dtcKaufliste[ah][dtc_Autohaus] == autohaus)
{
if( counter == carid)
{
car = dtcKaufliste[ah][dtc_CarModel];
preis = dtcKaufliste[ah][dtc_CarPreis];
}
counter ++;
}
}
if(GetPlayerMoney(playerid) < preis)
{
SendClientMessage(playerid,COLOR_YELLOW,"Dein Geld reicht nicht aus, um dieses Fahrzeug zu kaufen!!");
return 1;
}
DestroyVehicle(dtc_AutohausSCar[playerid]);
SetPlayerPos(playerid, DtcSonstiges[autohaus][4][0],DtcSonstiges[autohaus][4][1],DtcSonstiges[autohaus][4][2]);
SetPlayerFacingAngle(playerid,DtcSonstiges[autohaus][4][3]);
dtc_AutohausCar[playerid] = 0;
dtc_AutohausCat[playerid] = 2000;
SetPlayerVirtualWorld(playerid,0);
TextDrawHideForPlayer(playerid,CarKauf[playerid]);
TextDrawDestroy(CarKauf[playerid]);
TogglePlayerControllable(playerid,1);
SetCameraBehindPlayer(playerid);
OnPlayerBuyCar(playerid,car,preis,autohaus);
//ResetPlayer
}
if(newkeys == KEY_ACTION) //Tab
{
//ResetPlayer
DestroyVehicle(dtc_AutohausSCar[playerid]);
SetPlayerPos(playerid, DtcSonstiges[autohaus][4][0],DtcSonstiges[autohaus][4][1],DtcSonstiges[autohaus][4][2]);
SetPlayerFacingAngle(playerid,DtcSonstiges[autohaus][4][3]);
dtc_AutohausCar[playerid] = 0;
dtc_AutohausCat[playerid] = 2000;
SetPlayerVirtualWorld(playerid,0);
TextDrawHideForPlayer(playerid,CarKauf[playerid]);
TextDrawDestroy(CarKauf[playerid]);
TogglePlayerControllable(playerid,1);
SetCameraBehindPlayer(playerid);
SetPlayerVirtualWorld(playerid,0);
}
}