SA-MP Forums Archive
Players names - 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)
+--- Thread: Players names (/showthread.php?tid=281882)



Players names - lukas567 - 08.09.2011

Hello!

Is this possible to get player names from Host who aren't online but are having Officer=1 and post it in command /workers without MySQL?

Thanks!


Re: Players names - Pinguinn - 08.09.2011

Try this, you have to replace a few things
pawn Код:
if(strcmp(cmdtext, "/isofficer"))
{
    new idx, tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) return SendClientMessage(playerid, 0xFFFFFF, "[ERROR] Wrong format! /isofficer [name]");
    format(string, sizeof string, "%s.(type)", name);
    new File:officer_check = fopen(string, io_read)
    {
        if(file_exists(officer_check))
        {
            if(PlayerInfo[playerid][pOfficer] == 1)
            {
                format(string, sizeof string, "Player %s is an officer", name);
                SendClientMessage(playerid, 0xFFFFFF, string);
            }
            else
            {
                format(string, sizeof string, "Player %s is {FF0000} not {FFFFFF} an officer", name);
                SendClientMessage(playerid, 0xFFFFFF, string);
            }
        }
        else return format(string, sizeof string, "[ERROR] Player %s does not exist!"); SendClientMessage(playerid, 0xFFFFFF, string);
    }
    return 1;
}



Re: Players names - lukas567 - 08.09.2011

And what do i need to change if two people saves in Scriptfiles/saves/user has officer=1 and when i will type command it will show me their names?

Saves are:
Danny_Dickson.ini
Holy_Shit.ini

And they aren't online


Re: Players names - Pinguinn - 08.09.2011

You have to check it from the file itself but I think the player has to be connected
(Not sure)