Textdraw?? (GF)
#1

//Ontop
Код:
 new Text:HClock[MAX_PLAYERS];
 new PointUP;
 forward PointUpdate(playerid);
//OnPlayerConnect
Код:
  HClock[playerid] = TextDrawCreate(502.000000,96.000000, "00000000");
  TextDrawAlignment(HClock[playerid],0);
  TextDrawLetterSize(HClock[playerid], 0.5, 1.5);
  TextDrawFont(HClock[playerid], 2);
  TextDrawSetProportional(HClock[playerid],1);
  TextDrawSetShadow(HClock[playerid], 2);
  TextDrawSetOutline(HClock[playerid],2);
  TextDrawShowForPlayer(playerid,HClock[playerid]);
//GameModeExitFunc
Код:
  KillTimer(PointUP);
//OnGameModeInit
Код:
  PointUP = SetTimer("PointUpdate",1000,1);
Код:
  public PointUpdate(playerid)
  {
   new string[256];
   new Point = PlayerInfo[playerid][pPoint];
   format(string,sizeof(string),"%d",Point);
   TextDrawSetString(HClock[playerid],string);
   TextDrawShowForPlayer(playerid,HClock[playerid]);
   return 1;
  }
Why it is the only first player that can be seen on this textdraw? (GF)
Reply
#2

I would guess it is something to do with the way you are using your PointUpdate method. It has the parameter "playerid", but because you are using SetTimer instead of SetTimerEx there is nothing being passed as the playerid. This means that playerid will be seen as 0 everytime PointUpdate is called, hence why only the first player (or id 0) can see it.

I would suggest removing the parameter to make it PointUpdate(), and encase everything within PointUpdate() in a for loop that will loop through all connected players. Don't know if this is the most efficient way but will hopefully get it working.

Good luck, Benjo
Reply
#3

Thank
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)