Wie füge ich ein TextDraw ein?

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
  • Hi,
    Also ich hab mir schon ein TextDraw erstellt:


    Textdraw0 = TextDrawCreate(220.000000,432.000000,"German Stunt Server");
    TextDrawAlignment(Textdraw0,0);
    TextDrawBackgroundColor(Textdraw0,0x000000ff);
    TextDrawFont(Textdraw0,1);
    TextDrawLetterSize(Textdraw0,1.000000,1.000000);
    TextDrawColor(Textdraw0,0xff0000ff);
    TextDrawSetOutline(Textdraw0,1);
    TextDrawSetProportional(Textdraw0,1);
    TextDrawSetShadow(Textdraw0,5);


    Nur weiß ich jetzt nicht wie ich es einfüge!
    Ich weiß nur unter gamemodin glaub ich aber wo muss ich ihn hier einfügen?:
    public OnGameModeInit()
    {


    SetGameModeText("Stunt mod");
    AddPlayerClass(0,2018.9148,1342.9307,12.0348,267.8081,0,0,0,0,0,0); // Spwanpunkt




    //Converted objects and vehicles below!
    AddStaticVehicleEx(522,2025.86108398,1333.12866211,10.32264328,272.00000000,-1,-1,15); //NRG-500
    AddStaticVehicleEx(522,2025.80163574,1334.47839355,10.32056713,272.00000000,-1,-1,15); //NRG-500
    AddStaticVehicleEx(522,2025.85961914,1335.78125000,10.32645988,274.00000000,-1,-1,15); //NRG-500
    AddStaticVehicleEx(522,2026.13769531,1351.39526367,10.35471821,270.00000000,-1,-1,15); //NRG-500
    AddStaticVehicleEx(522,2026.24890137,1350.12866211,10.36601925,270.00000000,-1,-1,15); //NRG-500
    AddStaticVehicleEx(522,2026.07897949,1352.59729004,10.34945869,270.00000000,-1,-1,15); //NRG-500
    AddStaticVehicleEx(541,2026.32788086,1358.12036133,10.52031231,230.00000000,-1,-1,15); //Bullet
    AddStaticVehicleEx(541,2026.49389648,1369.75183105,10.52031231,230.00000000,-1,-1,15); //Bullet
    AddStaticVehicleEx(541,2026.51464844,1361.93847656,10.52031231,230.00000000,-1,-1,15); //Bullet
    AddStaticVehicleEx(541,2026.52966309,1365.55151367,10.52031231,230.00000000,-1,-1,15); //Bullet
    AddStaticVehicleEx(541,2026.48022461,1373.85437012,10.52031231,226.00000000,-1,-1,15); //Bullet
    AddStaticVehicleEx(541,2026.94812012,1382.54455566,10.52031231,220.00000000,-1,-1,15); //Bullet
    AddStaticVehicleEx(541,2027.10327148,1378.01245117,10.52031231,220.00000000,-1,-1,15); //Bullet
    AddStaticVehicleEx(451,2026.31579590,1329.28588867,10.58468437,310.00000000,-1,-1,15); //Turismo
    AddStaticVehicleEx(451,2025.83288574,1320.57226562,10.58468437,310.00000000,-1,-1,15); //Turismo
    AddStaticVehicleEx(451,2025.82263184,1311.92810059,10.58468437,310.00000000,-1,-1,15); //Turismo
    AddStaticVehicleEx(451,2025.86181641,1316.20471191,10.58468437,310.00000000,-1,-1,15); //Turismo
    AddStaticVehicleEx(451,2026.01843262,1307.04565430,10.58468437,310.00000000,-1,-1,15); //Turismo
    AddStaticVehicleEx(451,2026.07287598,1324.98547363,10.58468437,310.00000000,-1,-1,15); //Turismo
    AddStaticVehicleEx(451,2026.57287598,1302.66552734,10.58468437,310.00000000,-1,-1,15); //Turismo
    CreateObject(3080,2108.95336914,1575.38220215,11.12042522,0.00000000,0.00000000,270.00000000); //object(ad_jump) (1)
    CreateObject(3080,2112.17187500,1575.36010742,12.80344582,12.00000000,0.00000000,270.00000000); //object(ad_jump) (3)
    CreateObject(3080,2114.70874023,1575.38269043,14.97176743,24.00000000,0.00000000,270.00000000); //object(ad_jump) (4)
    CreateObject(3080,2116.52172852,1575.51721191,17.45570183,36.00000000,0.00000000,270.00000000); //object(ad_jump) (5)
    CreateObject(3080,2198.28881836,1685.06103516,20.69073677,0.00000000,0.00000000,318.00000000); //object(ad_jump) (6)
    CreateObject(3080,2199.99267578,1686.91467285,22.76260757,16.00000000,0.00000000,318.00000000); //object(ad_jump) (7)
    CreateObject(3080,2276.18945312,1716.21875000,24.25124741,0.00000000,0.00000000,230.00000000); //object(ad_jump) (8)
    CreateObject(3399,2306.44213867,1589.89978027,24.98360443,0.00000000,0.00000000,0.00000000); //object(cxrf_a51_stairs) (1)
    CreateObject(3399,2313.14648438,1589.77038574,28.06202698,0.00000000,0.00000000,0.00000000); //object(cxrf_a51_stairs) (2)
    CreateObject(3399,2318.97290039,1589.70715332,30.64044952,0.00000000,0.00000000,0.00000000); //object(cxrf_a51_stairs) (3)
    CreateObject(3399,2325.47119141,1589.67724609,33.71887207,0.00000000,0.00000000,0.00000000); //object(cxrf_a51_stairs) (4)
    CreateObject(3399,2330.30371094,1589.56359863,36.04320145,0.00000000,0.00000000,0.00000000); //object(cxrf_a51_stairs) (5)
    CreateObject(14416,2340.03076172,1589.76770020,35.57364273,346.00000000,0.00000000,90.00000000); //object(carter-stairs07) (1)
    CreateObject(2931,2347.67700195,1601.60314941,35.90629578,0.00000000,0.00000000,0.00000000); //object(kmb_jump1) (1)
    CreateObject(3080,2348.55151367,1700.16918945,19.64694023,0.00000000,0.00000000,0.00000000); //object(ad_jump) (2)
    CreateObject(3080,2348.49511719,1703.88183594,22.28693962,19.99804688,0.00000000,0.00000000); //object(ad_jump) (9)
    CreateObject(3080,2348.34082031,1707.47009277,26.39694023,30.00000000,0.00000000,0.00000000); //object(ad_jump) (10)
    CreateObject(3080,2412.93383789,1738.67602539,20.94073677,4.00000000,0.00000000,269.99996948); //object(ad_jump) (11)
    CreateObject(1633,2476.96777344,1727.50305176,21.53466606,0.00000000,0.00000000,230.00000000); //object(landjump) (1)
    CreateObject(1633,2480.95117188,1724.24426270,24.03466606,12.00000000,0.00000000,230.00000000); //object(landjump) (2)
    CreateObject(1633,2480.95117188,1724.24414062,24.03466606,11.99707031,0.00000000,229.99877930); //object(landjump) (3)
    CreateObject(1632,2534.91894531,1695.79077148,19.64694405,0.00000000,0.00000000,348.00000000); //object(waterjump1) (1)
    CreateObject(18367,2541.74951172,1769.88342285,17.30926132,6.00000000,0.00000000,238.00000000); //object(cw2_bikelog) (1)
    CreateObject(18367,2490.17236328,1800.93750000,16.28038406,4.00000000,0.00000000,60.00000000); //object(cw2_bikelog) (2)
    CreateObject(18367,2490.79345703,1800.46203613,16.29972839,16.00000000,0.00000000,240.00000000); //object(cw2_bikelog) (3)
    CreateObject(13645,2494.79931641,1826.50634766,16.06507874,0.00000000,0.00000000,0.00000000); //object(kickramp06) (1)
    CreateObject(13645,2494.73266602,1828.87060547,17.17447090,8.00000000,0.00000000,0.00000000); //object(kickramp06) (2)
    CreateObject(18262,2495.12890625,1853.21972656,19.63472366,18.00000000,0.00000000,356.00000000); //object(cw2_phroofstuf) (1)
    CreateObject(18367,2494.73242188,1861.92309570,19.94093704,350.00000000,0.00000000,278.00000000); //object(cw2_bikelog) (4)
    CreateObject(1633,2433.73852539,1832.74877930,34.21548462,3.99023438,4.00973511,99.72052002); //object(landjump) (4)
    CreateObject(13648,2298.63256836,1807.26220703,15.45236588,0.00000000,0.00000000,0.00000000); //object(wall2) (1)


    /*
    Objects converted: 31
    Vehicles converted: 20
    Vehicle models found: 3
    ----------------------
    In the time this conversion took to finish a hummingbird could have flapped it's wings 22.56 times!
    */


    return 1;
    }
    Danke im vorraus
    MFG K1ng106

  • Entweder unter der Klammer also:


    public OnGameModeInit
    {
    //Hier


    oder ganz unten vorm Return:


    //hier
    return 1;
    }


    oder auch dazwischen, muss nur unter dem Public sein.
    Damits halt übersichtlicher ist am Besten oben oder unten, ist aber egal.


    Wenn du außerdem willst, dass es dann gleich allen angezeigt wird, einach noch
    TextDrawShowForAll(Textdraw0);
    hinzufügen.

  • Den Textdraw createst du unter OnGameModeInıt aber du musst ıhn noch anzeıgen lassen (TextDrawShowForPlayer oder TextDrawShowForAll)

  • Jetzt sieht meine GameModInit so aus:
    public OnGameModeInit()
    {
    TextDrawShowForAll(Textdraw0);
    Textdraw0 = TextDrawCreate(220.000000,432.000000,"German Stunt Server");
    TextDrawAlignment(Textdraw0,0);
    TextDrawBackgroundColor(Textdraw0,0x000000ff);
    TextDrawFont(Textdraw0,1);
    TextDrawLetterSize(Textdraw0,1.000000,1.000000);
    TextDrawColor(Textdraw0,0xff0000ff);
    TextDrawSetOutline(Textdraw0,1);
    TextDrawSetProportional(Textdraw0,1);
    TextDrawSetShadow(Textdraw0,5);


    SetGameModeText("Stunt mod");
    AddPlayerClass(0,2018.9148,1342.9307,12.0348,267.8081,0,0,0,0,0,0); // Spwanpunkt




    //Converted objects and vehicles below!
    AddStaticVehicleEx(522,2025.86108398,1333.12866211,10.32264328,272.00000000,-1,-1,15); //NRG-500
    AddStaticVehicleEx(522,2025.80163574,1334.47839355,10.32056713,272.00000000,-1,-1,15); //NRG-500
    AddStaticVehicleEx(522,2025.85961914,1335.78125000,10.32645988,274.00000000,-1,-1,15); //NRG-500
    AddStaticVehicleEx(522,2026.13769531,1351.39526367,10.35471821,270.00000000,-1,-1,15); //NRG-500
    AddStaticVehicleEx(522,2026.24890137,1350.12866211,10.36601925,270.00000000,-1,-1,15); //NRG-500
    AddStaticVehicleEx(522,2026.07897949,1352.59729004,10.34945869,270.00000000,-1,-1,15); //NRG-500
    AddStaticVehicleEx(541,2026.32788086,1358.12036133,10.52031231,230.00000000,-1,-1,15); //Bullet
    AddStaticVehicleEx(541,2026.49389648,1369.75183105,10.52031231,230.00000000,-1,-1,15); //Bullet
    AddStaticVehicleEx(541,2026.51464844,1361.93847656,10.52031231,230.00000000,-1,-1,15); //Bullet
    AddStaticVehicleEx(541,2026.52966309,1365.55151367,10.52031231,230.00000000,-1,-1,15); //Bullet
    AddStaticVehicleEx(541,2026.48022461,1373.85437012,10.52031231,226.00000000,-1,-1,15); //Bullet
    AddStaticVehicleEx(541,2026.94812012,1382.54455566,10.52031231,220.00000000,-1,-1,15); //Bullet
    AddStaticVehicleEx(541,2027.10327148,1378.01245117,10.52031231,220.00000000,-1,-1,15); //Bullet
    AddStaticVehicleEx(451,2026.31579590,1329.28588867,10.58468437,310.00000000,-1,-1,15); //Turismo
    AddStaticVehicleEx(451,2025.83288574,1320.57226562,10.58468437,310.00000000,-1,-1,15); //Turismo
    AddStaticVehicleEx(451,2025.82263184,1311.92810059,10.58468437,310.00000000,-1,-1,15); //Turismo
    AddStaticVehicleEx(451,2025.86181641,1316.20471191,10.58468437,310.00000000,-1,-1,15); //Turismo
    AddStaticVehicleEx(451,2026.01843262,1307.04565430,10.58468437,310.00000000,-1,-1,15); //Turismo
    AddStaticVehicleEx(451,2026.07287598,1324.98547363,10.58468437,310.00000000,-1,-1,15); //Turismo
    AddStaticVehicleEx(451,2026.57287598,1302.66552734,10.58468437,310.00000000,-1,-1,15); //Turismo
    CreateObject(3080,2108.95336914,1575.38220215,11.12042522,0.00000000,0.00000000,270.00000000); //object(ad_jump) (1)
    CreateObject(3080,2112.17187500,1575.36010742,12.80344582,12.00000000,0.00000000,270.00000000); //object(ad_jump) (3)
    CreateObject(3080,2114.70874023,1575.38269043,14.97176743,24.00000000,0.00000000,270.00000000); //object(ad_jump) (4)
    CreateObject(3080,2116.52172852,1575.51721191,17.45570183,36.00000000,0.00000000,270.00000000); //object(ad_jump) (5)
    CreateObject(3080,2198.28881836,1685.06103516,20.69073677,0.00000000,0.00000000,318.00000000); //object(ad_jump) (6)
    CreateObject(3080,2199.99267578,1686.91467285,22.76260757,16.00000000,0.00000000,318.00000000); //object(ad_jump) (7)
    CreateObject(3080,2276.18945312,1716.21875000,24.25124741,0.00000000,0.00000000,230.00000000); //object(ad_jump) (8)
    CreateObject(3399,2306.44213867,1589.89978027,24.98360443,0.00000000,0.00000000,0.00000000); //object(cxrf_a51_stairs) (1)
    CreateObject(3399,2313.14648438,1589.77038574,28.06202698,0.00000000,0.00000000,0.00000000); //object(cxrf_a51_stairs) (2)
    CreateObject(3399,2318.97290039,1589.70715332,30.64044952,0.00000000,0.00000000,0.00000000); //object(cxrf_a51_stairs) (3)
    CreateObject(3399,2325.47119141,1589.67724609,33.71887207,0.00000000,0.00000000,0.00000000); //object(cxrf_a51_stairs) (4)
    CreateObject(3399,2330.30371094,1589.56359863,36.04320145,0.00000000,0.00000000,0.00000000); //object(cxrf_a51_stairs) (5)
    CreateObject(14416,2340.03076172,1589.76770020,35.57364273,346.00000000,0.00000000,90.00000000); //object(carter-stairs07) (1)
    CreateObject(2931,2347.67700195,1601.60314941,35.90629578,0.00000000,0.00000000,0.00000000); //object(kmb_jump1) (1)
    CreateObject(3080,2348.55151367,1700.16918945,19.64694023,0.00000000,0.00000000,0.00000000); //object(ad_jump) (2)
    CreateObject(3080,2348.49511719,1703.88183594,22.28693962,19.99804688,0.00000000,0.00000000); //object(ad_jump) (9)
    CreateObject(3080,2348.34082031,1707.47009277,26.39694023,30.00000000,0.00000000,0.00000000); //object(ad_jump) (10)
    CreateObject(3080,2412.93383789,1738.67602539,20.94073677,4.00000000,0.00000000,269.99996948); //object(ad_jump) (11)
    CreateObject(1633,2476.96777344,1727.50305176,21.53466606,0.00000000,0.00000000,230.00000000); //object(landjump) (1)
    CreateObject(1633,2480.95117188,1724.24426270,24.03466606,12.00000000,0.00000000,230.00000000); //object(landjump) (2)
    CreateObject(1633,2480.95117188,1724.24414062,24.03466606,11.99707031,0.00000000,229.99877930); //object(landjump) (3)
    CreateObject(1632,2534.91894531,1695.79077148,19.64694405,0.00000000,0.00000000,348.00000000); //object(waterjump1) (1)
    CreateObject(18367,2541.74951172,1769.88342285,17.30926132,6.00000000,0.00000000,238.00000000); //object(cw2_bikelog) (1)
    CreateObject(18367,2490.17236328,1800.93750000,16.28038406,4.00000000,0.00000000,60.00000000); //object(cw2_bikelog) (2)
    CreateObject(18367,2490.79345703,1800.46203613,16.29972839,16.00000000,0.00000000,240.00000000); //object(cw2_bikelog) (3)
    CreateObject(13645,2494.79931641,1826.50634766,16.06507874,0.00000000,0.00000000,0.00000000); //object(kickramp06) (1)
    CreateObject(13645,2494.73266602,1828.87060547,17.17447090,8.00000000,0.00000000,0.00000000); //object(kickramp06) (2)
    CreateObject(18262,2495.12890625,1853.21972656,19.63472366,18.00000000,0.00000000,356.00000000); //object(cw2_phroofstuf) (1)
    CreateObject(18367,2494.73242188,1861.92309570,19.94093704,350.00000000,0.00000000,278.00000000); //object(cw2_bikelog) (4)
    CreateObject(1633,2433.73852539,1832.74877930,34.21548462,3.99023438,4.00973511,99.72052002); //object(landjump) (4)
    CreateObject(13648,2298.63256836,1807.26220703,15.45236588,0.00000000,0.00000000,0.00000000); //object(wall2) (1)


    /*
    Objects converted: 31
    Vehicles converted: 20
    Vehicle models found: 3
    ----------------------
    In the time this conversion took to finish a hummingbird could have flapped it's wings 22.56 times!
    */


    return 1;
    }
    Aber es kommen folgender errors:


    C:\Users\Adrian\Desktop\SAMP Server\gamemodes\Gamemod.pwn(35) : error 017: undefined symbol "Textdraw0"
    C:\Users\Adrian\Desktop\SAMP Server\gamemodes\Gamemod.pwn(36) : error 017: undefined symbol "Textdraw0"
    C:\Users\Adrian\Desktop\SAMP Server\gamemodes\Gamemod.pwn(37) : error 017: undefined symbol "Textdraw0"
    C:\Users\Adrian\Desktop\SAMP Server\gamemodes\Gamemod.pwn(38) : error 017: undefined symbol "Textdraw0"
    C:\Users\Adrian\Desktop\SAMP Server\gamemodes\Gamemod.pwn(39) : error 017: undefined symbol "Textdraw0"
    C:\Users\Adrian\Desktop\SAMP Server\gamemodes\Gamemod.pwn(40) : error 017: undefined symbol "Textdraw0"
    C:\Users\Adrian\Desktop\SAMP Server\gamemodes\Gamemod.pwn(41) : error 017: undefined symbol "Textdraw0"
    C:\Users\Adrian\Desktop\SAMP Server\gamemodes\Gamemod.pwn(42) : error 017: undefined symbol "Textdraw0"
    C:\Users\Adrian\Desktop\SAMP Server\gamemodes\Gamemod.pwn(43) : error 017: undefined symbol "Textdraw0"
    C:\Users\Adrian\Desktop\SAMP Server\gamemodes\Gamemod.pwn(44) : error 017: undefined symbol "Textdraw0"
    C:\Users\Adrian\Desktop\SAMP Server\gamemodes\Gamemod.pwn(46) : warning 217: loose indentation
    C:\Users\Adrian\Desktop\SAMP Server\gamemodes\Gamemod.pwn(142) : warning 217: loose indentation
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    10 Errors.


    Hast du noch ne Idee? :S

  • Es bıetet sıch an, das dırekt unter
    #ınclude <a_samp>
    zu packen. Achte aber darauf, dass du es global defınıerst und nıcht local.

  • do.de - Domain-Offensive - Domains für alle und zu super Preisen
  • OnPlayerSpawn

    Stimmt das so?:
    TextDrawShowForAll(Textdraw0);
    Textdraw0 = TextDrawCreate(220.000000,432.000000,"German Stunt Server");
    TextDrawAlignment(Textdraw0,0);
    TextDrawBackgroundColor(Textdraw0,0x000000ff);
    TextDrawFont(Textdraw0,1);
    TextDrawLetterSize(Textdraw0,1.000000,1.000000);
    TextDrawColor(Textdraw0,0xff0000ff);
    TextDrawSetOutline(Textdraw0,1);
    TextDrawSetProportional(Textdraw0,1);
    TextDrawSetShadow(Textdraw0,5);
    Und unter #include <a_samp> hab ich new Text:Textdraw0; geschrieben!
    Ist das so richtig?

  • Ich wuede keın TextDrawShowForAll benutzen sondern TextDrawShowForPlayer unter OnPlayerSpawn bzw TextDrawHıdeForPlayer unter OnPlayerDeath

  • Jetzt komme folgende errors:
    C:\Users\Adrian\Desktop\SAMP Server\gamemodes\Gamemod.pwn(50) : warning 217: loose indentation
    C:\Users\Adrian\Desktop\SAMP Server\gamemodes\Gamemod.pwn(145 -- 146) : error 076: syntax error in the expression, or invalid function call
    C:\Users\Adrian\Desktop\SAMP Server\gamemodes\Gamemod.pwn(147) : warning 217: loose indentation
    C:\Users\Adrian\Desktop\SAMP Server\gamemodes\Gamemod.pwn(152) : error 017: undefined symbol "TextDrawH"
    C:\Users\Adrian\Desktop\SAMP Server\gamemodes\Gamemod.pwn(152 -- 153) : error 001: expected token: ":", but found "return"
    C:\Users\Adrian\Desktop\SAMP Server\gamemodes\Gamemod.pwn(153) : warning 217: loose indentation
    C:\Users\Adrian\Desktop\SAMP Server\gamemodes\Gamemod.pwn(153) : warning 215: expression has no effect
    Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase



    3 Errors.

    ?( ?( ?( ?( ?(