SA-MP Forums Archive
All ID's in a Textdraw - 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: All ID's in a Textdraw (/showthread.php?tid=72587)



All ID's in a Textdraw - Robbin237 - 09.04.2009

Hi guys, im trying to make a command that displays a textdraw with all ID's online in it.
Now my problem is , how can i do this?
Im trying it with TextDrawSetString, and a loop. Could somebody help me and correct this code to get all ID's from who are online and put them in the textdraw ?

This is my code:

pawn Код:
dcmd_info(playerid, params[])
{
    Textdraw1 = TextDrawCreate(475.000000, 291.000000, " ~n~");


    for (new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            TextDrawSetString(Textdraw1, TextDraw1 & i);
        }
    }
    return 1;
}
Thnx!


Re: All ID's in a Textdraw - OmeRinG - 09.04.2009

i'm guessing:
does TextDraw1 returns a string?
I don't think so..
try making a string in top of the script that will be used as the textdraw's string...
EX:
on top of script:
new idstdstring[MAX_STRING];

idstdstring = idstdstring + i;
TextDrawSetString(Textdraw1, idstdstring);


Re: All ID's in a Textdraw - Robbin237 - 09.04.2009

Didn't work, anyone else got a solution?


Re: All ID's in a Textdraw - 90NINE - 09.04.2009

This should work: http://pastebin.com/mded9f1f