Count - 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: Count (
/showthread.php?tid=249049)
Count -
Admigo - 16.04.2011
heey guys
I have made different Dm maps. But how can i make a count how much players are on that map. I want to make it with Textdraw. Pls help
Thanks Admigo
Re: Count - [L3th4l] - 16.04.2011
pawn Код:
new
iPlayersInDM;
// When they enter/join the map:
++ iPlayersInDM;
// When they leave/exit the map:
-- iPlayersInDM;
// When you show the textdraw:
new
iStr[15];
format(iStr, sizeof(iStr), "Players: %i", iPlayersInDM);
TextDrawSetString(TD, iStr);
TextDrawShowForAll(TD, iStr);
If that's not what you mean, please elaborate a little bit more.
Re: Count -
Admigo - 17.04.2011
What i do with TD because i get undifined TD?
Re: Count -
Admigo - 17.04.2011
Can you explain it better because i get error:Undefined TD
Re: Count -
Luis- - 17.04.2011
TD = Your textdraw varible., also remember not to bump your topic until after 12 hours have passed.
Re: Count -
Admigo - 17.04.2011
But why the text dont appear in server?
Код:
new iPlayersInDM;
new Text:TD;
new iStr[15];
format(iStr, sizeof(iStr), "Players: %i", iPlayersInDM);
TextDrawShowForAll(TD);
TD=TextDrawCreate(420,350,iStr);
TextDrawSetString(TD, iStr);
TextDrawShowForAll(TD);
Re: Count -
Admigo - 17.04.2011
Why my text dont appear?This is my code:
Код:
//top of script
new iPlayersInDM;
new Text:TD;
//OnGamemodeInit
new iStr[15];
format(iStr, sizeof(iStr), "Players: %i", iPlayersInDM);
TextDrawShowForAll(TD);
TD=TextDrawCreate(420,350,iStr);
TextDrawSetString(TD, iStr);
TextDrawShowForAll(TD);
//Command
iPlayersInDM ++;
//OnPlayerDead
iPlayersInDM --;
Any help pls"?