TextDrawSetString
#1

What's wrong with this script? If I set string TextDraw don't show up.

Код:
stock pInfoTextDraw(playerid)
{
	new textdrawstring[124];
	format(textdrawstring,sizeof(textdrawstring),"* Tu turi %d Jetpack, %d XP, %d nuzudymu. Tavo skin ID yra %d ", pInfo[ playerid ][ jetpackas ], pInfo[ playerid ][ score ], pInfo[ playerid ][ killai ], pInfo[ playerid ][ skin ]);
	Textdraw1 = TextDrawCreate(182 ,425 , "Tu turi 0 Jetpack, 10 XP, 50 nuzudymu. Tavo skin ID yra 555");
	TextDrawFont(Textdraw1 , 1);
	TextDrawLetterSize(Textdraw1 , 0.4, 2.8);
	TextDrawColor(Textdraw1 , 0x8f1111FF);
	TextDrawSetOutline(Textdraw1 , false);
	TextDrawSetProportional(Textdraw1 , true);
	TextDrawSetShadow(Textdraw1 , 1);
	TextDrawUseBox(Textdraw1, 1);
	TextDrawBoxColor(Textdraw1, COLOR_BLACK);
	TextDrawSetString(Textdraw1, textdrawstring);
	TextDrawShowForPlayer(playerid, Textdraw1);
}
Reply
#2

Anyone can help me, please?
Reply
#3

Hope this helped...
pawn Код:
// At the top of the script:
new Text:Textdraw1;

// The thing you needed changed:

stock pInfoTextDraw(playerid)
{
    new TDString[128];
    format(TDString,sizeof(TDString),"* Tu turi %d Jetpack, %d XP, %d nuzudymu. Tavo skin ID yra %d ", pInfo[playerid][jetpackas], pInfo[playerid][score], pInfo[playerid][killai], pInfo[playerid][skin]);
    Textdraw1 = TextDrawCreate(182 ,425 , TDString);
    TextDrawFont(Textdraw1 , 1);
    TextDrawLetterSize(Textdraw1 , 0.4, 2.8);
    TextDrawColor(Textdraw1 , 0x8f1111FF);
    TextDrawSetOutline(Textdraw1 , false);
    TextDrawSetProportional(Textdraw1 , true);
    TextDrawSetShadow(Textdraw1 , 1);
    TextDrawUseBox(Textdraw1, 1);
    TextDrawBoxColor(Textdraw1, COLOR_BLACK);
    TextDrawSetString(Textdraw1, TDString);
    TextDrawShowForPlayer(playerid, Textdraw1);
    return 1;
}
Reply
#4

pawn Код:
new time[MAX_PLAYERS]; // for every player
new textdrawstring[124]; // it gonna make just one string


public OnGameModeInit()
{
  Textdraw1 = TextDrawCreate(182 ,425 , "jetpackas: - Score: - Killai: - Skin:"); // your textdraw.
  TextDrawFont(Textdraw1 , 1);
  TextDrawLetterSize(Textdraw1 , 0.4, 2.8);
  TextDrawColor(Textdraw1 , 0x8f1111FF);
  TextDrawSetOutline(Textdraw1 , false);
  TextDrawSetProportional(Textdraw1 , true);
  TextDrawSetShadow(Textdraw1 , 1);
  TextDrawUseBox(Textdraw1, 1);
  TextDrawBoxColor(Textdraw1, COLOR_BLACK);
}
public OnPlayerConnect(playerid)
{
   time[playerid] = SetTimer("update",1000,true); // setting up for it update every second.
}
public OnPlayerDisconnect(playerid)
{
  KillTimer(time[playerid]);
}
public onPlayerUpdate(playerid)
{
   TextDrawShowForPlayer(playerid, Textdraw1); // it gonna show everytime...
}
forward update(playerid);
public update(playerid)
{
   // same thing, so they won't see too much different.
   format(textdrawstring,sizeof(textdrawstring),"jetpackas:%d - Score:%d - Killai:%d - Skin:%d", pInfo[ playerid ][ jetpackas ], pInfo[ playerid ][ score ], pInfo[ playerid ][ killai ], pInfo[ playerid ][ skin ]);
   TextDrawSetString(Textdraw1, textdrawstring);        
}
Reply
#5

better to use PlayerText:
for live stats
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)