Es kommen beim Compilen keine Fehler.
Wenn man der Befehl eingibt erscheinen die Textdraws jedoch nicht.
Vorher hatte ich es so:
TextDrawShowForPlayer(playerid,Textdraw4);
TextDrawShowForPlayer(playerid,Textdraw0);
TextDrawShowForPlayer(playerid,Textdraw1);
TextDrawShowForPlayer(playerid,Textdraw2);
TextDrawShowForPlayer(playerid,Textdraw3);
Bei dieser Variante wurde jedoch nur Textdraw 4 (also der Schwarze Hintergrund) geladen.
new Text:Textdraw0,Text:Textdraw1;
new Text:Textdraw2,Text:Textdraw3;
new Text:Textdraw4;
public OnGameModeInit()
{
print("Textdraw Test");
Textdraw0 = TextDrawCreate(0.0, 0.0, "ld_grav:tvcorn");
TextDrawLetterSize(Textdraw0, 0.0, 0.0);
TextDrawTextSize(Textdraw0, 320.0, 240.0);
TextDrawAlignment(Textdraw0, 1);
TextDrawColor(Textdraw0, -1);
TextDrawSetShadow(Textdraw0, 0);
TextDrawSetOutline(Textdraw0, 0);
TextDrawFont(Textdraw0, 4);
Textdraw1 = TextDrawCreate(0.0, 450.0, "ld_grav:tvcorn");
TextDrawLetterSize(Textdraw1, 320.0, -240.0);
TextDrawAlignment(Textdraw1, 1);
TextDrawColor(Textdraw1, -1);
TextDrawSetShadow(Textdraw1, 0);
TextDrawSetOutline(Textdraw1, 0);
TextDrawFont(Textdraw1, 4);
Textdraw2 = TextDrawCreate(640.0, 0.0, "ld_grav:tvcorn");
TextDrawLetterSize(Textdraw2, 0.0, 0.0);
TextDrawTextSize(Textdraw2, -320.0, 240.0);
TextDrawAlignment(Textdraw2, 1);
TextDrawColor(Textdraw2, -1);
TextDrawSetShadow(Textdraw2, 0);
TextDrawSetOutline(Textdraw2, 0);
TextDrawFont(Textdraw2, 4);
Textdraw3 = TextDrawCreate(640.00, 450.0, "ld_grav:tvcorn");
TextDrawLetterSize(Textdraw3, 0.0, 0.0);
TextDrawTextSize(Textdraw3, -320.0, -240.0);
TextDrawAlignment(Textdraw3, 1);
TextDrawColor(Textdraw3, -1);
TextDrawSetShadow(Textdraw3, 0);
TextDrawSetOutline(Textdraw3, 0);
TextDrawFont(Textdraw3, 4);
Textdraw4 = TextDrawCreate(-33.500000, -70.933387, "intro1:intro1");
TextDrawLetterSize(Textdraw4, 0.000000, 0.000000);
TextDrawTextSize(Textdraw4, 897.000000, 693.933471);
TextDrawAlignment(Textdraw4, 1);
TextDrawColor(Textdraw4, -1);
TextDrawSetShadow(Textdraw4, 0);
TextDrawSetOutline(Textdraw4, 0);
TextDrawFont(Textdraw4, 4);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/textdrawshow",cmdtext,true)== 0)
{
TextDrawShowForPlayer(playerid,Textdraw0);
TextDrawShowForPlayer(playerid,Textdraw1);
TextDrawShowForPlayer(playerid,Textdraw2);
TextDrawShowForPlayer(playerid,Textdraw3);
TextDrawShowForPlayer(playerid,Textdraw4);
return 1;
}
if(strcmp("/textdrawhide",cmdtext,true) == 0)
{
TextDrawHideForPlayer(playerid,Textdraw4);
TextDrawHideForPlayer(playerid,Textdraw0);
TextDrawHideForPlayer(playerid,Textdraw1);
TextDrawHideForPlayer(playerid,Textdraw2);
TextDrawHideForPlayer(playerid,Textdraw3);
}
return 0;
}