Textdraw problem
#1

I can't see more than one TD, I made a new clock&date textdraw but I can't see my previous textdraw
I have a textdraw that shows "GP: %i" and I can't see it when the other one shows, this GP updates every 5 seconds, and the clock updates every 1 second, So I can see the "GP" textdraw only once per every 5 seconds for a second
What should I do?
Reply
#2

without any codes we cant help u
Reply
#3

Quote:
Originally Posted by Azula
Посмотреть сообщение
without any codes we cant help u
Same as Azula. Give us post your code. We will help
Reply
#4

PHP код:
public Time(playerid){
TextDrawDestroy(Textdraw1);
new 
Year,Month,Day,Hour,Minute,Second;
getdate(Day,Month,Year);
gettime(Hour,Minute,Second);
format(String,sizeof(String),"%i/%i/%i ; %i:%i:%i",Day,Month,Year,Hour,Minute,Second);
Textdraw1 TextDrawCreate(523.000000436.000000String);
TextDrawBackgroundColor(Textdraw1255);
TextDrawFont(Textdraw13);
TextDrawLetterSize(Textdraw10.2900001.100000);
TextDrawColor(Textdraw1, -1);
TextDrawSetOutline(Textdraw11);
TextDrawSetProportional(Textdraw11);
TextDrawShowForPlayer(playeridTextdraw1);
return 
1;}
public 
GPU(playerid){
GPUpdate(playerid);
return 
1;}
stock GPUpdate(playerid){
format(String,sizeof(String),"GP: %s",Comma(DOF2_GetInt(pFile(playerid),"GP")));
TextDrawDestroy(Textdraw0);
Textdraw0 TextDrawCreate(1.000000429.000000String);
TextDrawBackgroundColor(Textdraw0255);
TextDrawFont(Textdraw01);
TextDrawLetterSize(Textdraw00.4199992.099999);
TextDrawColor(Textdraw016777215);
TextDrawSetOutline(Textdraw01);
TextDrawSetProportional(Textdraw01);
TextDrawShowForPlayer(playeridTextdraw0);
return 
1;} 
Reply
#5

why do you keep creating and destroying?
you can use TextDrawSetString:
pawn Код:
public OnGameModeInit()
{
     Textdraw1 = TextDrawCreate(523.000000, 436.000000, " "); // empty for now, cuz the timer will update it once the server started
     TextDrawBackgroundColor(Textdraw1, 255);
     TextDrawFont(Textdraw1, 3);
     TextDrawLetterSize(Textdraw1, 0.290000, 1.100000);
     TextDrawColor(Textdraw1, -1);
     TextDrawSetOutline(Textdraw1, 1);
     TextDrawSetProportional(Textdraw1, 1);
     TextDrawShowForPlayer(playerid, Textdraw1);
     SetTimer("Time", 1000, true); // once the server started, the timer of callback "Time" will start
     return 1;
}
pawn Код:
forward Time();
public Time()
{
    new Year,Month,Day,Hour,Minute,Second;
    getdate(Day,Month,Year);
    gettime(Hour,Minute,Second);
    format(String,sizeof(String),"%i/%i/%i ; %i:%i:%i",Day,Month,Year,Hour,Minute,Second);
    TextDrawSetString(Textdraw1, String);
    return 1;
}
you can do the same for the GP textdraw
Reply
#6

Quote:
Originally Posted by Sawalha
Посмотреть сообщение
why do you keep creating and destroying?
you can use TextDrawSetString:
pawn Код:
public OnGameModeInit()
{
     Textdraw1 = TextDrawCreate(523.000000, 436.000000, " "); // empty for now, cuz the timer will update it once the server started
     TextDrawBackgroundColor(Textdraw1, 255);
     TextDrawFont(Textdraw1, 3);
     TextDrawLetterSize(Textdraw1, 0.290000, 1.100000);
     TextDrawColor(Textdraw1, -1);
     TextDrawSetOutline(Textdraw1, 1);
     TextDrawSetProportional(Textdraw1, 1);
     TextDrawShowForPlayer(playerid, Textdraw1);
     SetTimer("Time", 1000, true); // once the server started, the timer of callback "Time" will start
     return 1;
}
pawn Код:
forward Time();
public Time()
{
    new Year,Month,Day,Hour,Minute,Second;
    getdate(Day,Month,Year);
    gettime(Hour,Minute,Second);
    format(String,sizeof(String),"%i/%i/%i ; %i:%i:%i",Day,Month,Year,Hour,Minute,Second);
    TextDrawSetString(Textdraw1, String);
    return 1;
}
you can do the same for the GP textdraw
:* ty ty ty
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)