What's the Problem | Textdraw Update |
#1

Hello, Guys I wanna know that whats the problem with this code?

Код:
 
forward Updatetime(playerid);
public Updatetimer(playerid){
new targetid;
 if(Time[targetid]==0){
  KillTimer(tme[targetid]);
        TextDrawHideForPlayer(targetid, Textdraw0);
        TextDrawHideForPlayer(targetid, Textdraw1);
        TextDrawHideForPlayer(targetid, Textdraw2);
        TextDrawHideForPlayer(targetid, Textdraw3);
        TextDrawHideForPlayer(targetid, Textdraw4);
        TextDrawHideForPlayer(targetid, Textdraw5);
        TextDrawHideForPlayer(targetid, Textdraw6);
        TextDrawHideForPlayer(targetid, Textdraw7);
        TextDrawHideForPlayer(targetid, Textdraw8);
        TextDrawHideForPlayer(targetid, Textdraw9);
        TextDrawHideForPlayer(targetid, Textdraw10);
        TextDrawHideForPlayer(targetid, Textdraw11);
        TogglePlayerControllable(playerid,1);
       freeze[targetid]=0;
 }
 new Str[80];
 Time[targetid]--;
 format(Str, sizeof(Str), "%i", Time[targetid]);
 TextDrawSetString(Textdraw7, Str);
 
 
}
Someone said that textdraws will mess up if ore than two players join server because Sscript is using only one textdraw for update..

If True.. than What to do?

Should I use Enums instead of Varialbe(Time[MAX_PLAYERS])?
Reply
#2

Use player textdraws: https://sampwiki.blast.hk/wiki/CreatePlayerTextDraw

You should really do a search(******, forums..) before posting in this section, you could get your answer easily and faster than waiting here for peoples' response.
Reply
#3

and what About Time[MAX_PLAYERS]; Is that fine? like will it cause any problems when more players join server? However, I think no.. but Still I'll ask
Reply
#4

No, your Time is fine. That wouldn't mess up anything.
Reply
#5

uhmm.. I'm very confused with PlayerTextdrawCreate and all.. Where to put it on FilterscriptInt or under onPlayerConnect?

also is here any problem as compiler is giving me errors that undefined playerid

Here I make variables for them
Код:
new PlayerText:Textdraw0[MAX_PLAYERS];
new PlayerText:Textdraw1[MAX_PLAYERS];
new PlayerText:Textdraw2[MAX_PLAYERS];
new PlayerText:Textdraw3[MAX_PLAYERS];
new PlayerText:Textdraw4[MAX_PLAYERS];
new PlayerText:Textdraw5[MAX_PLAYERS];
new PlayerText:Textdraw6[MAX_PLAYERS];
new PlayerText:Textdraw7[MAX_PLAYERS];
new PlayerText:Textdraw8[MAX_PLAYERS];
new PlayerText:Textdraw9[MAX_PLAYERS];
new PlayerText:Textdraw10[MAX_PLAYERS];
new PlayerText:Textdraw11[MAX_PLAYERS];
Here's the main code
Код:
Textdraw0[playerid] = CreatePlayerTextDraw(playerid,388.998535, 310.666687, "usebox");
PlayerTextDrawLetterSize(playerid,Textdraw0[playerid], 0.000000, 10.766667);
PlayerTextDrawTextSize(playerid,Textdraw0[playerid], 246.316253, 0.000000);
PlayerTextDrawAlignment(playerid,Textdraw0[playerid], 1);
PlayerTextDrawColor(playerid,Textdraw0[playerid], 0);
PlayerTextDrawUseBox(playerid,Textdraw0[playerid], true);
PlayerTextDrawBoxColor(playerid,Textdraw0[playerid], 102);
PlayerTextDrawSetShadow(playerid,Textdraw0[playerid], 0);
PlayerTextDrawSetOutline(playerid,Textdraw0[playerid], 0);
PlayerTextDrawFont(playerid,Textdraw0[playerid], 0);

Textdraw1[playerid] = CreatePlayerTextDraw(playerid,248.316253, 308.000000, "LD_SPAC:white");
PlayerTextDrawLetterSize(playerid,Textdraw1[playerid], 0.000000, 0.000000);
PlayerTextDrawTextSize(playerid,Textdraw1[playerid], 139.150787, 13.416687);
PlayerTextDrawAlignment(playerid,Textdraw1[playerid], 1);
PlayerTextDrawColor(playerid,Textdraw1[playerid], -2147483393);
PlayerTextDrawSetShadow(playerid,Textdraw1[playerid], 0);
PlayerTextDrawSetOutline(playerid,Textdraw1[playerid], 0);
PlayerTextDrawFont(playerid,Textdraw1[playerid], 4);

Textdraw2[playerid] = CreatePlayerTextDraw(playerid,248.316253, 320.833312, "LD_SPAC:white");
PlayerTextDrawLetterSize(playerid,Textdraw2[playerid], 0.000000, 0.000000);
PlayerTextDrawTextSize(playerid,Textdraw2[playerid], 139.150787, 3.500000);
PlayerTextDrawAlignment(playerid,Textdraw2[playerid], 1);
PlayerTextDrawColor(playerid,Textdraw2[playerid], 255);
PlayerTextDrawSetShadow(playerid,Textdraw2[playerid], 0);
PlayerTextDrawSetOutline(playerid,Textdraw2[playerid], 0);
PlayerTextDrawFont(playerid,Textdraw2[playerid], 4);

Textdraw3[playerid] = CreatePlayerTextDraw(playerid,248.316253, 402.500000, "LD_SPAC:white");
TextDrawLetterSize(playerid,Textdraw3[playerid], 0.000000, 0.000000);
TextDrawTextSize(playerid,Textdraw3[playerid], 139.150787, 7.583312);
TextDrawAlignment(playerid,Textdraw3[playerid], 1);
TextDrawColor(playerid,Textdraw3[playerid], 255);
TextDrawSetShadow(playerid,Textdraw3[playerid], 0);
TextDrawSetOutline(playerid,Textdraw3[playerid], 0);
TextDrawFont(playerid,Textdraw3[playerid], 4);

Textdraw4[playerid] = CreatePlayerTextDraw(playerid,388.998535, 337.500000, "usebox");
PlayerTextDrawLetterSize(playerid,Textdraw4[playerid], 0.000000, 5.451854);
PlayerTextDrawTextSize(playerid,Textdraw4[playerid], 246.316253, 0.000000);
PlayerTextDrawAlignment(playerid,Textdraw4[playerid], 1);
PlayerTextDrawColor(playerid,Textdraw4[playerid], 0);
PlayerTextDrawUseBox(playerid,Textdraw4[playerid], true);
PlayerTextDrawBoxColor(playerid,Textdraw4[playerid], 102);
PlayerTextDrawSetShadow(playerid,Textdraw4[playerid], 0);
PlayerTextDrawSetOutline(playerid,Textdraw4[playerid], 0);
PlayerTextDrawFont(playerid,Textdraw4[playerid], 0);

Textdraw5[playerid] = CreatePlayerTextDraw(playerid,283.798156, 307.416748, "Freeze Timer");
PlayerTextDrawLetterSize(playerid,Textdraw5[playerid], 0.256969, 1.343333);
PlayerTextDrawAlignment(playerid,Textdraw5[playerid], 1);
PlayerTextDrawColor(playerid,Textdraw5[playerid], -1);
PlayerTextDrawSetShadow(playerid,Textdraw5[playerid], 0);
PlayerTextDrawSetOutline(playerid,Textdraw5[playerid], 1);
PlayerTextDrawBackgroundColor(playerid,Textdraw5[playerid], 51);
PlayerTextDrawFont(playerid,Textdraw5[playerid], 2);
PlayerTextDrawSetProportional(playerid,Textdraw5[playerid], 1);

Textdraw6[playerid] = CreatePlayerTextDraw(playerid,253.001510, 324.333435, "Time left");
PlayerTextDrawLetterSize(playerid,Textdraw6[playerid], 0.234948, 1.016666);
PlayerTextDrawAlignment(playerid,Textdraw6[playerid], 1);
PlayerTextDrawColor(playerid,Textdraw6[playerid], -1);
PlayerTextDrawSetShadow(playerid,Textdraw6[playerid], 0);
PlayerTextDrawSetOutline(playerid,Textdraw6[playerid], 1);
PlayerTextDrawBackgroundColor(playerid,Textdraw6[playerid], 51);
PlayerTextDrawFont(playerid,Textdraw6[playerid], 1);
PlayerTextDrawSetProportional(playerid,Textdraw6[playerid], 1);

Textdraw7[playerid] = CreatePlayerTextDraw(playerid,253.938583, 336.000030, "");
TextDrawLetterSize(playerid,Textdraw7[playerid], 0.381595, 2.795834);
TextDrawAlignment(playerid,Textdraw7[playerid], 1);
TextDrawColor(playerid,Textdraw7[playerid], -1);
TextDrawSetShadow(playerid,Textdraw7[playerid], 0);
TextDrawSetOutline(playerid,Textdraw7[playerid], 1);
TextDrawBackgroundColor(playerid,Textdraw7[playerid], 51);
TextDrawFont(playerid,Textdraw7[playerid], 2);
TextDrawSetProportional(playerid,Textdraw7[playerid], 1);

Textdraw8[playerid] = CreatePlayerTextDraw(playerid,256.749450, 362.250000, "seconds");
TextDrawLetterSize(playerid,Textdraw8[playerid], 0.159516, 1.220833);
TextDrawAlignment(playerid,Textdraw8[playerid], 1);
TextDrawColor(playerid,Textdraw8[playerid], -1);
TextDrawSetShadow(playerid,Textdraw8[playerid], 0);
TextDrawSetOutline(playerid,Textdraw8[playerid], 1);
TextDrawBackgroundColor(playerid,Textdraw8[playerid], 51);
TextDrawFont(playerid,Textdraw8[playerid], 1);
TextDrawSetProportional(playerid,Textdraw8[playerid], 1);

Textdraw9[playerid] = CreatePlayerTextDraw(playerid,283.672058, 390.250000, "You have been ~r~ Freezed");
PlayerTextDrawLetterSize(playerid,Textdraw9[playerid], 0.133748, 1.045833);
PlayerTextDrawAlignment(playerid,Textdraw9[playerid], 1);
PlayerTextDrawColor(playerid,Textdraw9[playerid], -1);
PlayerTextDrawSetShadow(playerid,Textdraw9[playerid], 0);
PlayerTextDrawSetOutline(playerid,Textdraw9[playerid], 1);
PlayerTextDrawBackgroundColor(playerid,Textdraw9[playerid], 51);
PlayerTextDrawFont(playerid,Textdraw9[playerid], 2);
PlayerTextDrawSetProportional(playerid,Textdraw9[playerid], 1);

Textdraw10[playerid] = CreatePlayerTextDraw(playerid,325.622161, 342.416687, "Freezed by Admin:");
PlayerTextDrawLetterSize(playerid,Textdraw10[playerid], 0.175915, 1.337500);
PlayerTextDrawAlignment(playerid,Textdraw10[playerid], 1);
PlayerTextDrawColor(playerid,Textdraw10[playerid], -1);
PlayerTextDrawSetShadow(playerid,Textdraw10[playerid], 0);
PlayerTextDrawSetOutline(playerid,Textdraw10[playerid], 1);
PlayerTextDrawBackgroundColor(playerid,Textdraw10[playerid], 51);
PlayerTextDrawFont(playerid,Textdraw10[playerid], 1);
PlayerTextDrawSetProportional(playerid,Textdraw10[playerid], 1);

Textdraw11[playerid] = CreatePlayerTextDraw(playerid,325.342651, 357.000030, "adminname");
PlayerTextDrawLetterSize(playerid,Textdraw11[playerid], 0.215739, 1.308333);
PlayerTextDrawAlignment(playerid,Textdraw11[playerid], 1);
PlayerTextDrawColor(playerid,Textdraw11[playerid], 8388863);
PlayerTextDrawSetShadow(playerid,Textdraw11[playerid], 0);
PlayerTextDrawSetOutline(playerid,Textdraw11[playerid], 1);
PlayerTextDrawBackgroundColor(playerid,Textdraw11[playerid], 51);
PlayerTextDrawFont(playerid,Textdraw11[playerid], 1);
PlayerTextDrawSetProportional(playerid,Textdraw11[playerid], 1);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)