Hey,
ich habe ein Problem und zwar habe ich das DTC-Car System im Script drin doch wenn ich ein Auto kaufen möchte wird
kein Textdraw erstellt wo Name, Preis steht.
Hier wird das Textdraw erstellt:
for(new x = 0; x < AUTOHAUSER;x++)
{
if(PlayerToPoint(1.5, playerid, DtcSonstiges[x][0][0],DtcSonstiges[x][0][1],DtcSonstiges[x][0][2]) && !Dtc_PlayerHaveCar[playerid][Dtc_PlayerKey[playerid]] || pickupid == Dtc_Info[x] && !Dtc_PlayerHaveCar[playerid][Dtc_PlayerKey[playerid]])
{
TogglePlayerControllable(playerid, 0);
SetPlayerVirtualWorld(playerid,55+playerid);
new string[246];
dtc_AutohausCar[playerid] = 0;
dtc_AutohausCat[playerid] = x;
new c1 = random(120);
new c2 = random(120);
new car;
new preis;
for(new ah = 0; ah < sizeof(dtcKaufliste);ah++)
{
if(car == 0 && dtcKaufliste[ah][dtc_Autohaus] == x)
{
car = dtcKaufliste[ah][dtc_CarModel];
preis = dtcKaufliste[ah][dtc_CarPreis];
}
}
SetPlayerCameraPos(playerid, DtcSonstiges[x][2][0],DtcSonstiges[x][2][1],DtcSonstiges[x][2][2]);
SetPlayerCameraLookAt(playerid, DtcSonstiges[x][1][0],DtcSonstiges[x][1][1],DtcSonstiges[x][1][2]);
dtc_AutohausSCar[playerid] = CreateVehicle(car, DtcSonstiges[x][1][0],DtcSonstiges[x][1][1],DtcSonstiges[x][1][2],DtcSonstiges[x][1][3],c1,c2,-1);
SetPlayerPos(playerid, DtcSonstiges[x][3][0],DtcSonstiges[x][3][1],DtcSonstiges[x][3][2]);
SetVehicleVirtualWorld(dtc_AutohausSCar[playerid],55+playerid);
format(string,sizeof(string),"~r~<< AUTOHAUS >>~n~~w~Name: ~b~%s~n~~w~Preis: ~b~$%d~n~~w~Auswaehlen:~n~~w~ <Num 4<~b~&~w~>Num 6> ~n~~w~Kaufen:~b~ Enter ~n~~w~Abbrechen:~b~ Tab",CarName[car-400],preis);
if(!CarKauf[playerid])
{
CarKauf[playerid] = TextDrawCreate(200,350,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]);
}
}
Und hier die Zeilen wenn man Numpad drückt um die Autos zu tauschen:
if(newkeys == KEY_ANALOG_RIGHT || newkeys == KEY_LOOK_RIGHT || newkeys == KEY_FIRE) //right (4 Numpad/e)
{
new carid = dtc_AutohausCar[playerid] +1;
if(carid >= AhCars)
{
carid = 0;
}
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 ++;
}
}
new c1 = random(120);
new c2 = random(120);
DestroyVehicle(dtc_AutohausSCar[playerid]);
dtc_AutohausSCar[playerid] = CreateVehicle(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~~w~Name: ~b~%s~n~~w~Preis: ~b~$%d~n~~w~Auswaehlen:~n~~w~ <Num 4<~b~&~w~>Num 6> ~n~~w~Kaufen:~b~ Enter ~n~~w~Abbrechen:~b~ Tab",CarName[car-400],preis);
CarKauf[playerid] = TextDrawCreate(200,350,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;
}
if(newkeys == KEY_ANALOG_LEFT || newkeys == KEY_LOOK_LEFT || newkeys == KEY_JUMP) //left (6 Numpad/q)
{
new carid = dtc_AutohausCar[playerid] -1;
if(carid < 0)
{
carid = AhCars;
}
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 ++;
}
}
new c1 = random(120);
new c2 = random(120);
DestroyVehicle(dtc_AutohausSCar[playerid]);
dtc_AutohausSCar[playerid] = CreateVehicle(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~~w~Name: ~b~%s~n~~w~Preis: ~b~$%d~n~~w~Auswaehlen:~n~~w~ <Num 4<~b~&~w~>Num 6> ~n~~w~Kaufen:~b~ Enter ~n~~w~Abbrechen:~b~ Tab",CarName[car-400],preis);
CarKauf[playerid] = TextDrawCreate(200,350,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;
}
Ich hoffe mir kann jemand helfen