12.03.2011, 08:54
Hello Ladies and Gentlemen! (Oh, more less Gentlemen
).
So, i have textdraw in "OnGameModeInit" called by TDShowForAll.
Then, i have td in command /td <id> <text>.
When i type /td, the textdraw from ongamemodeinit is invisible. But why? I have two variables for textdraws.
Video: (ignore the music, The Lonely Island rocks!
) [ame]http://www.youtube.com/watch?v=Et5SBvcyats[/ame]
Codes:
OnGameModeInit
[code]TextDrawDestroy(web);
web = TextDrawCreate(500,5,"www.lila.net");
TextDrawUseBox(web, 0);
TextDrawBoxColor(web, 0x00000055);
TextDrawTextSize(web,600,100);
TextDrawFont(web, 1);
TextDrawSetShadow(web,1); // no shadow
TextDrawSetOutline(web,3); // thickness 1
TextDrawBackgroundColor(web,0x000000FF);
TextDrawColor(web,0xFFFFFFFF);
TextDrawAlignment(web,1);
TextDrawLetterSize(web,0.5,1.5);
TextDrawShowForAll(web);
[code]
/td
MyTextdraw:
Any idea?
).So, i have textdraw in "OnGameModeInit" called by TDShowForAll.
Then, i have td in command /td <id> <text>.
When i type /td, the textdraw from ongamemodeinit is invisible. But why? I have two variables for textdraws.
Video: (ignore the music, The Lonely Island rocks!
) [ame]http://www.youtube.com/watch?v=Et5SBvcyats[/ame]Codes:
OnGameModeInit
[code]TextDrawDestroy(web);
web = TextDrawCreate(500,5,"www.lila.net");
TextDrawUseBox(web, 0);
TextDrawBoxColor(web, 0x00000055);
TextDrawTextSize(web,600,100);
TextDrawFont(web, 1);
TextDrawSetShadow(web,1); // no shadow
TextDrawSetOutline(web,3); // thickness 1
TextDrawBackgroundColor(web,0x000000FF);
TextDrawColor(web,0xFFFFFFFF);
TextDrawAlignment(web,1);
TextDrawLetterSize(web,0.5,1.5);
TextDrawShowForAll(web);
[code]
/td
Код:
dcmd_td(playerid,params[])
{
new ID = strval(params);
new par = chrfind(' ',params) + 1;
new str[200];
if(!params[0] || !par || !params[par]) return hlaska(playerid,"Show TextDraw: /td <id> <text>");
if(!IsPlayerConnected(ID)) return hlaska(playerid,"Invalid Playerid!");
format(str,200,params[par]);
MyTextdraw(ID,str,10);
printf("[TD]Admin: %s | Player: %s | Text: %s",meno(playerid),meno(ID),params[par]);
return 1;
}
Код:
stock MyTextdraw(playerid,text[],time)
{
TextDrawHideForPlayer(playerid,PlayerTextdraw[playerid]);
TextDrawDestroy(PlayerTextdraw[playerid]);
PlayerTextdraw[playerid] = TextDrawCreate(500,220,text);
TextDrawUseBox(PlayerTextdraw[playerid], 1);
TextDrawBoxColor(PlayerTextdraw[playerid], 0x00000055);
TextDrawTextSize(PlayerTextdraw[playerid],600,100);
TextDrawFont(PlayerTextdraw[playerid], 1);
TextDrawSetShadow(PlayerTextdraw[playerid],0); // no shadow
TextDrawSetOutline(PlayerTextdraw[playerid],1); // thickness 1
TextDrawBackgroundColor(PlayerTextdraw[playerid],0x00000055);
TextDrawColor(PlayerTextdraw[playerid],0xFFFFFFFF);
TextDrawAlignment(PlayerTextdraw[playerid],1);
TextDrawLetterSize(PlayerTextdraw[playerid],0.3,1.3);
TextDrawShowForPlayer(playerid,PlayerTextdraw[playerid]);
TextDrawTimer[playerid]=time;
}


Still, when I call MyTextdraw, web disappears. I have no idea to solve this problem.
