SA-MP Forums Archive
Textdraw score - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Textdraw score (/showthread.php?tid=147198)



Textdraw score - Jay. - 10.05.2010

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.


Re: Textdraw score - [HiC]TheKiller - 10.05.2010

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));
  }
}



Re: Textdraw score - Jay. - 10.05.2010

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.?


Re: Textdraw score - nejc001 - 10.10.2010

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



Re: Textdraw score - WillyP - 10.10.2010

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


Re: Textdraw score - LarzI - 10.10.2010

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);



Re: Textdraw score - Jeffry - 10.10.2010

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