All ID's in a Textdraw
#1

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!
Reply
#2

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);
Reply
#3

Didn't work, anyone else got a solution?
Reply
#4

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


Forum Jump:


Users browsing this thread: 1 Guest(s)