RoBiK 3 Odesláno: 28. Leden, 2016 Share Odesláno: 28. Leden, 2016 Ahoj, robil som PlayerTextDraw, neviem či bolo všetko správne ale je tu jedna chyba. Nejaký text chcem mať tou farbou a nejaký inou, bohužial mi to ukázalo nejako takto: ?000000?Kills atd... Neviete ako inak ? format(string2,150,"{000000}I Kills: {23E11A}%d {000000}I Deaths: {23E11A}%d {000000}I EoS{23E11A} %d : {FF0000}%d {000000}Away I",kills[playerid],deaths[playerid],body_green,body_away); Link to comment Share on other sites More sharing options...
0 Om3n 78 Odesláno: 28. Leden, 2016 Share Odesláno: 28. Leden, 2016 TD nepodporuje embedded barvy mam dojem. Link to comment Share on other sites More sharing options...
0 Mikoo 8 Odesláno: 28. Leden, 2016 Share Odesláno: 28. Leden, 2016 (upraveno) Zkus ~r~ ~b~ ~y~ všetky farby neviem ale su na wiki edit: https://wiki.sa-mp.com/wiki/GameTextStyle Edited 28. Leden, 2016 by Mikoo Link to comment Share on other sites More sharing options...
0 RoBiK 3 Odesláno: 28. Leden, 2016 Author Share Odesláno: 28. Leden, 2016 aha dik skusim díky ide ! môžte lock Link to comment Share on other sites More sharing options...
0 Mikoo 8 Odesláno: 28. Leden, 2016 Share Odesláno: 28. Leden, 2016 aha dik skusimdíky ide ! môžte lock Link to comment Share on other sites More sharing options...
0 RoBiK 3 Odesláno: 28. Leden, 2016 Author Share Odesláno: 28. Leden, 2016 ok takze ukazuje good ale mam chybu, ID 0 ukazuje vsetko spravne, killy, deaths aj EoS body a Away body. Ale ! dalsim ID sa uz ani neobnovuje ten Textdraw(nezmizne a zase sa objavi) ani sa neukazuju tie čísla, kód: Hore new deaths[MAX_PLAYERS];new kills[MAX_PLAYERS];forward tabulka(playerid);forward tabulka2(playerid); OnPlayerConnect new string2[150]; deaths[playerid]=0; kills[playerid]=0; format(string2,150,"~l~ I Kills: ~y~%d ~l~I Deaths: ~y~}%d ~l~I EoS ~g~%d : ~r~%d ~l~Away I",kills[playerid],deaths[playerid],body_green,body_away); Textdraw0 = CreatePlayerTextDraw(playerid,4.000000, 435.000000,string2); PlayerTextDrawBackgroundColor(playerid,Textdraw0, 255); PlayerTextDrawFont(playerid,Textdraw0, 2); PlayerTextDrawLetterSize(playerid,Textdraw0, 0.500000, 1.000000); PlayerTextDrawColor(playerid,Textdraw0, 255); PlayerTextDrawSetOutline(playerid,Textdraw0, 0); PlayerTextDrawSetProportional(playerid,Textdraw0, 0); PlayerTextDrawSetShadow(playerid,Textdraw0, 1); PlayerTextDrawUseBox(playerid,Textdraw0, 1); PlayerTextDrawBoxColor(playerid,Textdraw0, 16777215); PlayerTextDrawTextSize(playerid,Textdraw0, 636.000000, 419.000000); PlayerTextDrawSetSelectable(playerid,Textdraw0, 0); PlayerTextDrawShow(playerid, Textdraw0); OnPlayerDeath deaths[playerid]++; kills[killerid]++; a potom uz dole public tabulka(playerid) { PlayerTextDrawHide(playerid,Textdraw0); SetTimer("tabulka2",200,false); return 1; } public tabulka2(playerid) { new string2[150]; format(string2,150,"~l~ I Kills: ~y~%d ~l~I Deaths: ~y~}%d ~l~I EoS ~g~%d : ~r~%d ~l~Away I",kills[playerid],deaths[playerid],body_green,body_away); Textdraw0 = CreatePlayerTextDraw(playerid,4.000000, 435.000000,string2); PlayerTextDrawBackgroundColor(playerid,Textdraw0, 255); PlayerTextDrawFont(playerid,Textdraw0, 2); PlayerTextDrawLetterSize(playerid,Textdraw0, 0.500000, 1.000000); PlayerTextDrawColor(playerid,Textdraw0, 255); PlayerTextDrawSetOutline(playerid,Textdraw0, 0); PlayerTextDrawSetProportional(playerid,Textdraw0, 0); PlayerTextDrawSetShadow(playerid,Textdraw0, 1); PlayerTextDrawUseBox(playerid,Textdraw0, 1); PlayerTextDrawBoxColor(playerid,Textdraw0, 16777215); PlayerTextDrawTextSize(playerid,Textdraw0, 636.000000, 419.000000); PlayerTextDrawSetSelectable(playerid,Textdraw0, 0); PlayerTextDrawShow(playerid, Textdraw0); SetTimer("tabulka",3500,false); return 1; } Link to comment Share on other sites More sharing options...
0 Mattsy 29 Odesláno: 28. Leden, 2016 Share Odesláno: 28. Leden, 2016 do publicov cyklus for() bez neho ti to nepôjde pre ďalššie ID a ten parameter playerid vo forwarde a publicu tam máš zbytočne Link to comment Share on other sites More sharing options...
0 RoBiK 3 Odesláno: 28. Leden, 2016 Author Share Odesláno: 28. Leden, 2016 takže som to nejako urobil že hore kde boli tie forwardy som dal preč playerid a tu v tabulka2,tabulka tiež, nevyhadzuje errory ale server sa zapne asi na 5 sec ;( public tabulka() { for(new id; id<MAX_PLAYERS; id++) { PlayerTextDrawHide(id,Textdraw0); SetTimer("tabulka2",200,false); } return 1; } public tabulka2() { for(new id; id<MAX_PLAYERS; id++) { new string2[150]; format(string2,150,"~l~ I Kills: ~y~%d ~l~I Deaths: ~y~}%d ~l~I EoS ~g~%d : ~r~%d ~l~Away I",kills[id],deaths[id],body_green,body_away); Textdraw0 = CreatePlayerTextDraw(id,4.000000, 435.000000,string2); PlayerTextDrawBackgroundColor(id,Textdraw0, 255); PlayerTextDrawFont(id,Textdraw0, 2); PlayerTextDrawLetterSize(id,Textdraw0, 0.500000, 1.000000); PlayerTextDrawColor(id,Textdraw0, 255); PlayerTextDrawSetOutline(id,Textdraw0, 0); PlayerTextDrawSetProportional(id,Textdraw0, 0); PlayerTextDrawSetShadow(id,Textdraw0, 1); PlayerTextDrawUseBox(id,Textdraw0, 1); PlayerTextDrawBoxColor(id,Textdraw0, 16777215); PlayerTextDrawTextSize(id,Textdraw0, 636.000000, 419.000000); PlayerTextDrawSetSelectable(id,Textdraw0, 0); PlayerTextDrawShow(id, Textdraw0); SetTimer("tabulka",3500,false); } return 1; } s for() som nikdy nerobil takže neviem Link to comment Share on other sites More sharing options...
0 Om3n 78 Odesláno: 28. Leden, 2016 Share Odesláno: 28. Leden, 2016 problém bych viděl hlavně v tomhle Textdraw0 = CreatePlayerTextDraw Ukládáš všechny PTD do jedný proměný. Udělej si na to pole. A ten kód co tu máš se nedivim že ti schazuje server. Ty v jednom publicu vytvoříš 500 TDcek, zároveň vytvoříš 500 timerů na 3,5 sekundy, následně 500x spustíš tabulka(), tim schováš hráčům TDčka. A následně ti to vytvoří 250 000 timerů na 200 milisekund aby to 250 000x spustilo tabulka2(). Hoooooooodně sebevražednej script. Link to comment Share on other sites More sharing options...
0 RoBiK 3 Odesláno: 28. Leden, 2016 Author Share Odesláno: 28. Leden, 2016 aha takže tie dva timery (SetTimer("tabulka"... aj tabulka2) mam dat prec z toho for() že ? a nejake pole to nwm nejsom až taky skúseny Link to comment Share on other sites More sharing options...
0 Mattsy 29 Odesláno: 28. Leden, 2016 Share Odesláno: 28. Leden, 2016 PlayerTextDraw sa vytvára v OnPlayerConnect, potom ho už len zobrazuješ/vypínaš a upravuješ string + daj si tam ešte IsPlayerConnected za cyklus Link to comment Share on other sites More sharing options...
0 Om3n 78 Odesláno: 28. Leden, 2016 Share Odesláno: 28. Leden, 2016 (upraveno) Jsou tu na to návody. projdi si návod na Pole, Cyklus a nastuduj si PlayerTextDraw na sa-mp wiki. Uvidíš jak to pak bude snadný. a než se do toho víc pustíš, zkus raději zjistit něco o "foreach" includu. Dost ti to usnadní práci s cykly. Jelikož používat na tyhle věci klasické "for" je dost zpátečnické a neoptimalizované. Edited 28. Leden, 2016 by Om3n Link to comment Share on other sites More sharing options...
0 Globální moderátor HighPrint 177 Odesláno: 28. Leden, 2016 Globální moderátor Share Odesláno: 28. Leden, 2016 Pro update TD používej http://wiki.sa-mp.com/wiki/PlayerTextDrawSetString Link to comment Share on other sites More sharing options...
0 RoBiK 3 Odesláno: 28. Leden, 2016 Author Share Odesláno: 28. Leden, 2016 díky nejako som to opravil, niekedy sa stane ze sa nejaky hrac odpoji a mne sa nastavi vsetko na 0 jak keby, ale ked dam /kill (deaths[playerid]++ tak mam to zase spatky Link to comment Share on other sites More sharing options...
0 ATomas 286 Odesláno: 28. Leden, 2016 Share Odesláno: 28. Leden, 2016 Proste myslenka: textdraw vytvoris na zcatku, potom jak ti poradili pomoci TextDrawSetString mu muzes menit text. Ale priorita je ten textdraw vytvorti jen jednou nazacatku a potom to uz jen updatovat. Link to comment Share on other sites More sharing options...
0 RoBiK 3 Odesláno: 30. Leden, 2016 Author Share Odesláno: 30. Leden, 2016 aha díky už to mam Link to comment Share on other sites More sharing options...
Dotaz
RoBiK 3
Ahoj, robil som PlayerTextDraw, neviem či bolo všetko správne ale je tu jedna chyba. Nejaký text chcem mať tou
farbou a nejaký inou, bohužial mi to ukázalo nejako takto: ?000000?Kills atd...
Neviete ako inak ?
Link to comment
Share on other sites
15 odpovědí na tuto otázku
Recommended Posts