SA-MP Forums Archive
How to store names and put them into 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: How to store names and put them into a Textdraw (/showthread.php?tid=162536)



How to store names and put them into a Textdraw - Nonameman - 23.07.2010

Hey Guys!

I wanna make a /onlineadmins command which loops through the players, checks if a player is admin, and puts it into a string, and the string into a textdraw.

Could anyone help me how to do it?

Nonameman


Re: How to store names and put them into a Textdraw - Mr187 - 23.07.2010

Why would you want it to loop threw all players? and check them all thats just plain stupid if somebody spammed that command your server will lag shitless.

Just make a simple command where if somebody is example pAdmin auto puts them into the list, Checking all players is just nuts..


Re: How to store names and put them into a Textdraw - Nonameman - 23.07.2010

Quote:
Originally Posted by Mr187
Посмотреть сообщение
Why would you want it to loop threw all players? and check them all thats just plain stupid if somebody spammed that command your server will lag shitless.

Just make a simple command where if somebody is example pAdmin auto puts them into the list, Checking all players is just nuts..
You are right, and it's easier to make, but I want to learn how can I make something like I wrote.
And I have an anti spam function, so nobody can spam this


Re: How to store names and put them into a Textdraw - Blt950 - 24.07.2010

Here we go. This is what I use.

pawn Код:
if (strcmp(cmd, "/admins", true) == 0)
{
    if(IsPlayerConnected(playerid))
    {
        SendClientMessage(playerid, COLOR_WHITE, "__________Admins Online__________");
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                new count;
                if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 1338)
                {
                    GetPlayerName(i, sendername, sizeof(sendername));
                    format(string, 256, "(%d)%s, Admin Level: %d", i, sendername, PlayerInfo[i][pAdmin]);
                    SendClientMessage(playerid, COLOR_GREY, string);
                    count++;
                }
                if(count==0)
                {
                    SendClientMessage(playerid,COLOR_WHITE,"No admins online at the moment, sorry!");
                }
            }
        }
    }
    return 1;
}
PS: My script is made from scratch and inspired by GF systems, it's why I use e.g. PlayerInfo and pAdmin and stuff (Just for people that thought they can judge me that it's a GF copy, which it's not)


Re: How to store names and put them into a Textdraw - Nonameman - 24.07.2010

Thanks.


Re: How to store names and put them into a Textdraw - Blt950 - 24.07.2010

Ah btw, this doesnt store it into some kind of textdraw, you've to do it your self :P

But it prints in chat


Re: How to store names and put them into a Textdraw - Bcklup - 24.07.2010

just make a textdraw and use "TextDrawSetString" The End..