Textdraws werden blockiert / pls HELP

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Hallo,




    ich benutze das LOH Script und habe mein eigenen Tacho eingefügt, nur
    habe ich jetzt das Problem das alle anderen Textdraws die im Script
    erstellt wurden NICHT mehr angezeigt werden....


    Hier mein Tachocode:



    #include <a_samp>


    #define TACHOTIMER 250
    #define TFARBE 0x0067FF44
    #define BORDER 0x000000BB


    forward TachoTimer();


    new Text:Tacho[MAX_PLAYERS];
    new Text:Vehname[MAX_PLAYERS];
    new Text:Damage[MAX_PLAYERS];
    new Text:Border[MAX_PLAYERS];
    new Text:Box[MAX_PLAYERS];
    new Text:Benzin[MAX_PLAYERS];
    new Float:XT,Float:YT,Float:ZT;
    new FahrzeugName[][] = {
    "Landstalker","Bravura","Buffalo","Linerunner","Pereniel","Sentinel","Dumper","Firetruck","Trashmaster","Stretch","Manana","Infernus",
    "Voodoo","Pony","Mule","Cheetah","Ambulance","Leviathan","Moonbeam","Esperanto","Taxi","Washington","Bobcat","Mr Whoopee","BF Injection",
    "Hunter","Premier","Enforcer","Securicar","Banshee","Predator","Bus","Rhino","Barracks","Hotknife","Trailer","Previon","Coach","Cabbie",
    "Stallion","Rumpo","RC Bandit","Romero","Packer","Monster","Admiral","Squalo","Seasparrow","Pizzaboy","Tram","Trailer","Turismo","Speeder",
    "Reefer","Tropic","Flatbed","Yankee","Caddy","Solair","Berkley's RC Van","Skimmer","PCJ-600","Faggio","Freeway","RC Baron","RC Raider",
    "Glendale","Oceanic","Sanchez","Sparrow","Patriot","Quad","Coastguard","Dinghy","Hermes","Sabre","Rustler","ZR3 50","Walton","Regina",
    "Comet","BMX","Burrito","Camper","Marquis","Baggage","Dozer","Maverick","News Chopper","Rancher","FBI Rancher","Virgo","Greenwood",
    "Jetmax","Hotring","Sandking","Blista Compact","Police Maverick","Boxville","Benson","Mesa","RC Goblin","Hotring Racer","Hotring Racer",
    "Bloodring Banger","Rancher","Super GT","Elegant","Journey","Bike","Mountain Bike","Beagle","Cropdust","Stunt","Tanker","RoadTrain",
    "Nebula","Majestic","Buccaneer","Shamal","Hydra","FCR-900","NRG-500","HPV1000","Cement Truck","Tow Truck","Fortune","Cadrona","FBI Truck",
    "Willard","Forklift","Tractor","Combine","Feltzer","Remington","Slamvan","Blade","Freight","Streak","Vortex","Vincent","Bullet","Clover",
    "Sadler","Firetruck","Hustler","Intruder","Primo","Cargobob","Tampa","Sunrise","Merit","Utility","Nevada","Yosemite","Windsor","Monster A",
    "Monster B","Uranus","Jester","Sultan","Stratum","Elegy","Raindance","RC Tiger","Flash","Tahoma","Savanna","Bandito","Freight","Trailer",
    "Kart","Mower","Duneride","Sweeper","Broadway","Tornado","AT-400","DFT-30","Huntley","Stafford","BF-400","Newsvan","Tug","Trailer","Emperor",
    "Wayfarer","Euros","Hotdog","Club","Trailer B","Trailer C","Andromada","Dodo","RC Cam","Launch","Police Car","Police Car",
    "Police Car","Police Ranger","Picador","S.W.A.T.","Alpha","Phoenix","Glendale","Sadler","Luggage Trailer","Luggage Trailer",
    "Stair Trailer","Boxville","Farm Plow","Utility Trailer"
    };



    public OnGameModeInit()
    {
    SetGameModeText("Kenny's Tacho");
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    Border[i] = TextDrawCreate(143, 362, " ");
    TextDrawLetterSize(Border[i], 5.5, 2.2);
    TextDrawFont(Border[i], 2);
    TextDrawSetShadow(Border[i], 2);
    TextDrawSetOutline(Border[i],1);
    TextDrawUseBox(Border[i], 1);
    TextDrawBoxColor(Border[i],BORDER);
    TextDrawSetProportional(Border[i], 1);
    TextDrawBackgroundColor(Border[i], 255);
    TextDrawAlignment(Border[i], 1);
    TextDrawTextSize(Border[i], 328.00, 4.00);


    Box[i] = TextDrawCreate(145, 365, " ");
    TextDrawLetterSize(Box[i], 5.0, 2.0);
    TextDrawFont(Box[i], 2);
    TextDrawSetShadow(Box[i], 2);
    TextDrawSetOutline(Box[i],1);
    TextDrawUseBox(Box[i], 1);
    TextDrawBoxColor(Box[i],TFARBE);
    TextDrawSetProportional(Box[i], 1);
    TextDrawBackgroundColor(Box[i], 255);
    TextDrawAlignment(Box[i], 1);
    TextDrawTextSize(Box[i], 325.00, 4.00);


    Tacho[i] = TextDrawCreate(145, 365, "Tempo: ");
    TextDrawLetterSize(Tacho[i], 0.3, 1.0);
    TextDrawFont(Tacho[i], 2);
    TextDrawSetShadow(Tacho[i], 2);
    TextDrawSetOutline(Tacho[i],1);
    TextDrawSetProportional(Tacho[i], 1);
    TextDrawBackgroundColor(Tacho[i], 255);
    TextDrawAlignment(Tacho[i], 1);


    Vehname[i] = TextDrawCreate(145, 380, "Fahrzeug: ");
    TextDrawBackgroundColor(Vehname[i], 255);
    TextDrawFont(Vehname[i], 2);
    TextDrawLetterSize(Vehname[i], 0.3, 1.0);
    TextDrawSetOutline(Vehname[i], 1);
    TextDrawSetProportional(Vehname[i], 1);
    TextDrawSetShadow(Vehname[i], 2);


    Damage[i] = TextDrawCreate(145, 395, "Schaden: ");
    TextDrawBackgroundColor(Damage[i], 255);
    TextDrawFont(Damage[i], 2);
    TextDrawLetterSize(Damage[i], 0.3, 1.0);
    TextDrawSetOutline(Damage[i], 1);
    TextDrawSetProportional(Damage[i], 1);
    TextDrawSetShadow(Damage[i], 2);



    Benzin[i] = TextDrawCreate(145, 410, "Benzin: ");
    TextDrawBackgroundColor(Benzin[i], 255);
    TextDrawFont(Benzin[i], 2);
    TextDrawLetterSize(Benzin[i], 0.3, 1.0);
    TextDrawSetOutline(Benzin[i], 1);
    TextDrawSetProportional(Benzin[i], 1);
    TextDrawSetShadow(Benzin[i], 2);



    }
    SetTimer("TachoTimer",TACHOTIMER,1);
    return 1;
    }


    public TachoTimer()
    {
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i) && !IsPlayerNPC(i))
    {
    new Float:Tempo;
    new Model = GetVehicleModel(GetPlayerVehicleID(i));
    GetVehicleVelocity(GetPlayerVehicleID(i), XT, YT, ZT);
    if(Model == 462 || Model == 481)
    {
    Tempo = floatsqroot(XT*XT+YT*YT+ZT*ZT)*100*1.2;
    }
    else
    {
    Tempo = floatsqroot(XT*XT+YT*YT+ZT*ZT)*100*1.8;
    }
    new Tachostring[32];
    format(Tachostring, sizeof(Tachostring), "~g~Tempo: ~w~%d km/h", floatround(Tempo));
    TextDrawSetString(Tacho[i], Tachostring);
    TextDrawShowForPlayer(i, Tacho[i]);
    new Vehstring[128];
    format(Vehstring,sizeof(Vehstring),"~g~Fahrzeug: ~w~%s",FahrzeugName[GetVehicleModel(GetPlayerVehicleID(i))-400]);
    TextDrawSetString(Vehname[i],Vehstring);
    TextDrawShowForPlayer(i, Vehname[i]);
    new vid = GetPlayerVehicleID(i);
    new Float:carhp;
    GetVehicleHealth(vid,carhp);
    new Float:schaden = (carhp < 250.0) ? 100.0 : ((100.0 - (carhp / 10.0)) * (4.0 / 3.0)), Healthstring[128];
    format(Healthstring,sizeof Healthstring,"~g~Schaden: ~w~%d ~r~%%",floatround(schaden));
    TextDrawSetString(Damage[i],Healthstring);
    TextDrawShowForPlayer(i,Damage[i]);
    new Boxstring[128];
    new boxsize = 0;
    format(Boxstring,sizeof(Boxstring)," ",boxsize);
    TextDrawSetString(Box[i],Boxstring);
    TextDrawShowForPlayer(i,Box[i]);
    new Borderstring[128];
    new bordersize = 0;
    format(Borderstring,sizeof(Borderstring)," ",bordersize);
    TextDrawSetString(Border[i],Borderstring);
    TextDrawShowForPlayer(i,Border[i]);
    new Benzinstring[256];
    format(Benzinstring,sizeof(Benzinstring),"~g~Benzin: ~w~%d ~r~Liter",Gas[vid],GetGasMax(GetVehicleModel(vid)));
    TextDrawSetString(Benzin[i],Benzinstring);
    TextDrawShowForPlayer(i,Benzin[i]);
    }
    else
    {
    TextDrawHideForPlayer(i, Border[i]);
    TextDrawHideForPlayer(i, Box[i]);
    TextDrawHideForPlayer(i, Tacho[i]);
    TextDrawHideForPlayer(i, Vehname[i]);
    TextDrawHideForPlayer(i, Damage[i]);
    TextDrawHideForPlayer(i, Benzin[i]);
    }
    }
    return 1;


    }


    public OnGameModeExit()
    {
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
    TextDrawHideForAll(Border[i]);
    TextDrawDestroy(Border[i]);
    TextDrawHideForAll(Box[i]);
    TextDrawDestroy(Box[i]);
    TextDrawHideForAll(Tacho[i]);
    TextDrawDestroy(Tacho[i]);
    TextDrawHideForAll(Vehname[i]);
    TextDrawDestroy(Vehname[i]);
    TextDrawHideForAll(Damage[i]);
    TextDrawDestroy(Damage[i]);
    TextDrawHideForAll(Benzin[i]);
    TextDrawDestroy(Benzin[i]);
    }
    return 1;
    }




    Habe ich irgendwas vergessen einzublenden oder auszublenden, bin echt verwirrt :S




    Hoffe es kann mir jemand helfen......




    lg