Textdraw score
#1

Hey guy's, Erm do u no how to show a players score in textdraws for any player. And if it goes up the score goes up, I no this is possible because i've seen

It many times


If u can help please reply, Thanks.
Reply
#2

Make the textdraw then use https://sampwiki.blast.hk/wiki/TextDrawSetString. In example

pawn Код:
public OnGameModeInit()
{
  SetTimer("Update", 5000, true);
  return 1;
}
forward Update();
public Update()
{
  for(new i; i<MAX_PLAYERS; i++)
  {
    if(!IsPlayerConnected(i)) continue;
    TextDrawSetString(/*Your textdraw here*/, GetPlayerScore(i));
  }
}
Reply
#3

Quote:
Originally Posted by [HiC
TheKiller [Stuntp.com] ]
Make the textdraw then use https://sampwiki.blast.hk/wiki/TextDrawSetString. In example

pawn Код:
public OnGameModeInit()
{
  SetTimer("Update", 5000, true);
  return 1;
}
forward Update();
public Update()
{
  for(new i; i<MAX_PLAYERS; i++)
  {
    if(!IsPlayerConnected(i)) continue;
    TextDrawSetString(/*Your textdraw here*/, GetPlayerScore(i));
  }
}
Thanks, So this will show the players score on there screens in textdraws. And when it goes up the score goes up.?
Reply
#4

Uhm, it says error 035: argument type mismatch for
Код:
 GetPlayerScore(i)
Reply
#5

Quote:
Originally Posted by [BADBOY]
Посмотреть сообщение
Thanks, So this will show the players score on there screens in textdraws. And when it goes up the score goes up.?
Yeah, doing that with textdraws will show everyones score on other peoples screens
Reply
#6

Quote:
Originally Posted by nejc001
Посмотреть сообщение
Uhm, it says error 035: argument type mismatch for
Код:
 GetPlayerScore(i)
Notice that the function says 'TextDrawSet[b]String[/u]', while GetPlayerScore returns a integer value.
What you need to do, is formatting a string to output the value of GetPlayerScore:

pawn Код:
new szScore[ 20 ]; //19 decimals is more than enough, probably..
format(szScore, sizeof(szScore), "%i", GetPlayerScore(i)); // %d and %i is the same
TextDrawSetString(/*your textdraw*/, szScore);
Reply
#7

This: http://forum.sa-mp.com/showthread.ph...876#post867876
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)