Jump to content
  • 0

pomoc Obnovující Se Textdraw


TheKid

Dotaz

Čau mam odpočet , který je dělaný přes GameText ale já bych ho chtěl udělat přes textdraw , jenže nevim jak protože když to tam mam ta se mi ten odpočet sekne ale jen v texdrawu takže musim udělat aby se každou sekundu objevoval a skrýval ale nevim jak na to :(

 

public TimerMinus()
{
new minuty = floatround(cas / 60);
new sekundy = floatround(cas % 60);
new fullcas[250];
format(fullcas,sizeof(fullcas),"%i:%i",minuty,sekundy);
print(fullcas);
GameTextForAll(fullcas, 1000, 1);
if (!cas) cas = 300;
else cas--;
return 1;
}

 

Díky

Link to comment
Share on other sites

11 odpovědí na tuto otázku

Recommended Posts

  • 0

Takže ak to chceš mať cez textdraw musíš ho ukázať nanovo po každom aktualizovaní času. Taktiež musíš aktualizovať textdraw.

Mimochodom premena fullcas[250] 250 je moc velké na to že je tam pár čísel

Link to comment
Share on other sites

  • 0

Takže ak to chceš mať cez textdraw musíš ho ukázať nanovo po každom aktualizovaní času. Taktiež musíš aktualizovať textdraw.

Mimochodom premena fullcas[250] 250 je moc velké na to že je tam pár čísel

já vim že ho musim aktualizovat ale nevim jak

Link to comment
Share on other sites

  • 0

Popozeraj si toto: http://wiki.sa-mp.co...xtDrawSetString

na "aktualizovanie" TextDrawu sa používa funkcia:

TextDrawSetString(nazovTD,"Text ktorý sa ma zobraziť v aktualizácii");

v tvojom prípade:

TextDrawSetString(nazovTD,fullcas);

 

Sice to odpočítává ale ty cisla se prepisujou takze jako dyby se ten textdraw delal furt znova

Link to comment
Share on other sites

  • 0

Když tam mam funkci Textdraw Create tak se mi děje že se tvoří furt nový ale ti starý nezanikají . Pokud tam nemam funkci createtd.. tak se mi žádný nevytvoří

 

KOD:

 

new Text:timetext;
//ingamemodeinit
TextDrawShowForAll(timetext);
   TextDrawColor(timetext, 0x008000AA);
   TextDrawTextSize(timetext, 4, 7);
   TextDrawSetShadow(timetext,0);
//public
public TimerMinus()
{
new minuty = floatround(cas / 60);
new sekundy = floatround(cas % 60);
new fullcas[250];
format(fullcas,sizeof(fullcas),"%i:%i",minuty,sekundy);
print(fullcas);
//GameTextForAll(fullcas, 1000, 1);

 TextDrawSetString(timetext,fullcas);

if (!cas) cas = 300;
else cas--;
return 1;
}

Link to comment
Share on other sites

  • 0

skus takto:

new Text:timetext;
// OnGameModeInit
timetext = TextDrawCreate(240.0,580.0,"_");
TextDrawColor(timetext, 0x008000AA);
TextDrawTextSize(timetext, 4, 7);
TextDrawSetShadow(timetext,0);
// potom niekde kde vyvolávaš ten public musíš dať TextDrawShowForAll alebo TextDrawShowForPlayer
public TimerMinus(){
new minuty = floatround(cas / 60);
new sekundy = floatround(cas % 60);
new fullcas[250];
format(fullcas,sizeof(fullcas),"%i:%i",minuty,sekundy);
print(fullcas);
TextDrawSetString(timetext,fullcas);
if (!cas) cas = 300;
else cas--;
return 1;
}

Link to comment
Share on other sites

  • 0

skus takto:

new Text:timetext;
// OnGameModeInit
timetext = TextDrawCreate(240.0,580.0,"_");
TextDrawColor(timetext, 0x008000AA);
TextDrawTextSize(timetext, 4, 7);
TextDrawSetShadow(timetext,0);
// potom niekde kde vyvolávaš ten public musíš dať TextDrawShowForAll alebo TextDrawShowForPlayer
public TimerMinus(){
new minuty = floatround(cas / 60);
new sekundy = floatround(cas % 60);
new fullcas[250];
format(fullcas,sizeof(fullcas),"%i:%i",minuty,sekundy);
print(fullcas);
TextDrawSetString(timetext,fullcas);
if (!cas) cas = 300;
else cas--;
return 1;
}

 

Vůbec se nezobrazí :( (a to tam mam Show) poslal bych ti ten gamemod na skype ... rekni mi tvoje skype nebo si pridej me ===> superman111118

Link to comment
Share on other sites

  • 0

Vsak v tom scriptu neni nic o TextDrawShow takze pokud nevis kde ho zobrazit tak to dej rovnou do timeru

 


TextDrawHideForPlayer(playerid,timetext);
TextDrawSetString(timetext,fullcas);
TextDrawShowForPlayer(playerid,timetext);

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...