04.09.2011, 05:07
I wanted to create a textdraw that randomly selects a string and then sends the message/text draw to all player. My problem is that an unrelated textdraw that I have is the one that gets deleted. I know that the problem is that there is now "news" textdraw to destory so it gets confused but what would be a fix?
I tried changing it to this, but this does not destroy the previous text draw (the one with an actual message);
Any help would be appreciated!
Код:
public NewsChange() { new rand = random(3); new NewsString[128]; switch(rand) { case 0: format(NewsString,128,"1"); case 1: format(NewsString,128,"2"); case 2: format(NewsString,128,"3"); case 3: format(NewsString,128,"4"); } TextDrawDestroy(News); News=TextDrawCreate(350,430,NewsString); TextDrawFont(News,1); TextDrawLetterSize(News,0.4,1.0); TextDrawShowForAll(News); return 1; }
Код:
public NewsChange() { new rand = random(3); new NewsString[128]; switch(rand) { case 0: format(NewsString,128,"Super Jump Has Been Remade! Check It Out At ~r~//sj~w~!"); case 1: format(NewsString,128,"Orignal Dukes Of Hazard At ~r~//duke~w~!"); case 2: format(NewsString,128,"~r~Wanted: ~w~Apply For Admin!"); case 3: format(NewsString,128,"Want A Hydra? Get One At //army!"); } News=TextDrawCreate(400,430," "); TextDrawShowForAll(News); TextDrawDestroy(News); News=TextDrawCreate(350,430,NewsString); TextDrawFont(News,1); TextDrawLetterSize(News,0.4,1.0); TextDrawShowForAll(News); return 1; }