Hey,
ich bekomme es einfach nicht hin mit meinem Textdraw Chat in einer Box.
So sieht das ganze Ding aus:
0-29 sind die Textdraws "ChatZeile[0] - ChatZeile[29]" mit jeweils einen String, der deren Inhalt widerspiegelt: "ChatInhalt[0] - ChatInhalt[29]".
Nun möchte ich, wenn jemand etwas reinschreibt, dass alles ein Strück nach oben rückt, und die neuste Nachricht unten (ChatZeile[0]) steht,
jedoch bekomme ich das einfach nicht hin, dass es auch funktioniert. Wie kann ich das machen?
Ich habe diese 2 Varianten versucht, und beides ist fehlgeschlagen: Hat einer noch eine Idee?
// -- Versuch 1 --
stock ChatInput(playerid, text[])
{
	new Ausgabe[128];
	format(Ausgabe,128,"~b~%s:~w~ %s",GetName(playerid),text);
	new x=28;
	for(new i=29; i>0; i--)
	{
		format(ChatInhalt[i],128,"%s",ChatInhalt[x]);
		TextDrawSetString(ChatZeile[i],ChatInhalt[i]);
		x--;
		if(x == 0)
		{
  		  	format(ChatInhalt[i],128,"%s",ChatInhalt[x]);
			TextDrawSetString(ChatZeile[i],ChatInhalt[i]);
			TextDrawSetString(ChatZeile[0],Ausgabe);
			format(ChatInhalt[0],128,"%s",Ausgabe);
			break;
		}
	}
	return 1;
}
// -- Versuch 2 --
stock ChatInput(playerid, text[])
{
	for(new i=29; i>0; i--)
	{
		switch(i)
		{
	    	case 29:{
	        	format(ChatInhalt[i],128,"_");
				TextDrawSetString(ChatZeile[i],"_");
			}
			case 0..27:{
				format(ChatInhalt[i+1],128,ChatInhalt[i]);
				TextDrawSetString(ChatZeile[i+1],ChatInhalt[i]);
				if(i==0){
					new output[128];
					format(output,128,"%s: %s", GetName(playerid),text);
				}
			}
		}
	}
	return 1;
}
 
		 
		
		
	 
			
									
		