Jump to content
  • 0

Problema textdrawuri


InSide*

Question

Problema intalnita (descriere): Cand serverul trece pragul de 80+ jucatorii automat, textdrawurile incep sa dispara, si se vad doar daca in caz pici printre primele id-uri de pe server.
Ero(area / rile) / warning-(ul / urile): -
Liniile de cod / sursa / script-ul(obligatoriu): Nu stiu unde sa verific si ce ar cauza problema.
Imagini / Video (optional): -
Ati incercat sa rezolvati singur?: Intr-un fel mi-am dat straduinta sa gasesc problema, dar fara succes.

Link to comment
Share on other sites

14 answers to this question

Recommended Posts

  • 0

Acestea sunt 2 dintre textdrawuri:

for(new i = 0; i < MAX_PLAYERS; i++)
    {
        logo = TextDrawCreate(540.000000, 428.000000, "/  RPG.T4P.RO");
        TextDrawBackgroundColor(logo, 255);
        TextDrawFont(logo, 2);
        TextDrawLetterSize(logo, 0.240000, 2.100000);
        TextDrawColor(logo, -1);
        TextDrawSetOutline(logo, 1);
        TextDrawSetProportional(logo, 1);
        TextDrawSetSelectable(logo, 0);

          SafeText = TextDrawCreate(60.000000, 426.000000, "SafeZone");
        TextDrawBackgroundColor(SafeText, 255);
        TextDrawFont(SafeText, 3);
        TextDrawLetterSize(SafeText, 0.369999, 1.300000);
        TextDrawColor(SafeText, -1);
        TextDrawSetOutline(SafeText, 1);
        TextDrawSetProportional(SafeText, 1);
        TextDrawUseBox(SafeText, 1);
        TextDrawBoxColor(SafeText, 255);
        TextDrawTextSize(SafeText, 118.000000, 2.000000);

Am vazut ca am un MAX_PLAYERS acolo, iar in gamemode nu gasesc define-ul cu acest MAX_PLAYERS d'aia si spun ca daca serverul atinge un numar mare de jucatori, ele incep si dispar doar la cei cu id-ul ridicat.

Link to comment
Share on other sites

  • 0

Salut, textdrawurile alea nu trebuie create in for, pentru ca nu sunt o matrice

In interiorul forului trebuie create doar textdrawurile de tip Textdraw0 [playerid].

Deci scoatele din for.

Edited by Mister

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

  • 0

Defineste MAX_PLAYERS.

#undef MAX_PLAYERS
#define MAX_PLAYERS 200

 Sau a 2-a optiune ar fi sa schimbi

for(new i = 0; i < MAX_PLAYERS; i++)

cu

new MaxPlayers = GetPlayerPoolSize();
for(new i = 0; i < MaxPlayers; i++)

 

242086.png

Link to comment
Share on other sites

  • 0

Nu neaparat ce a zis @KnowN . @WopsS a explicat intr-un alt topic cu o problema asemanatoare : Functia "TextDrawCreate" este limitata la un numar de playeri, da-ia nu le apare tuturor . Foloseste-te de CreatePlayerTextdraw ca sa-l afiseze fiecarui player in parte .

 

https://wiki.sa-mp.com/wiki/CreatePlayerTextDraw

Edited by NoNamed
Link to comment
Share on other sites

  • 0

Defineste MAX_PLAYERS.

#undef MAX_PLAYERS
#define MAX_PLAYERS 200

 Sau a 2-a optiune ar fi sa schimbi

for(new i = 0; i < MAX_PLAYERS; i++)

cu

new MaxPlayers = GetPlayerPoolSize();
for(new i = 0; i < MaxPlayers; i++)

 

Am incercat fix ce ai spus tu, mi-au disparut toate si mi-a aparut ceasul default de la san andreas.

Nu neaparat ce a zis @KnowN . @WopsS a explicat intr-un alt topic cu o problema asemanatoare : Functia "TextDrawCreate" este limitata la un numar de playeri, da-ia nu le apare tuturor . Foloseste-te de CreatePlayerTextdraw ca sa-l afiseze fiecarui player in parte .

 

https://wiki.sa-mp.com/wiki/CreatePlayerTextDraw

Acolo scrie daca ai spatiu intre ";" automat serverul primeste crash.

Link to comment
Share on other sites

  • 0
  • 0
new MaxPlayers = GetPlayerPoolSize();
for(new i = 0; i < MaxPlayers; i++) chestia astia face doar bug .. poate merge pe servere clasice 

GetPlayerPoolSize() e o functie noua aparuta in 0.3.7 -_-.

242086.png

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.