SA-MP Forums Archive
Looping with mysql - 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: Looping with mysql (/showthread.php?tid=396368)



Looping with mysql - MadafakaPro - 30.11.2012

Well my question is how to loop thought players accounts and display the OFFLINe group members?


Re: Looping with mysql - MadafakaPro - 12.12.2012

BUMB!


Re: Looping with mysql - InfiniTy. - 12.12.2012

Do you have a field that tells you if he's online or not ?


AW: Looping with mysql - Kevin54321 - 12.12.2012

Which MySQL-Plugin do you use? (e.g. BlueG`s R7)
Do you have a table where you can see who is online, eg. called "online". (same questian as Adytza.)


Re: Looping with mysql - MadafakaPro - 15.12.2012

Well i have a /gon command which shows online members but i dont know how to make it for online any suggestions?
pawn Код:
CMD:gon(playerid, params[]) {
    if(playerVariables[playerid][pGroup] >= 1 && playerVariables[playerid][pGroupRank] >= 4) {
        SendClientMessage(playerid, COLOR_TEAL, "------------------[GROUP ONLINE MEMBERS]------------------------");

        foreach(Player, i) {
            if(IsPlayerConnectedEx(i) && playerVariables[i][pGroup] == playerVariables[playerid][pGroup] && playerVariables[i][pAdminDuty] < 1) {

                switch(playerVariables[i][pGroupRank]) {
                    case 1: format(szMessage, sizeof(szMessage), "* (%d) %s %s", playerVariables[i][pGroupRank], playerVariables[playerid][pCustomRank], playerVariables[i][pNormalName]);
                    case 2: format(szMessage, sizeof(szMessage), "* (%d) %s %s", playerVariables[i][pGroupRank], playerVariables[playerid][pCustomRank], playerVariables[i][pNormalName]);
                    case 3: format(szMessage, sizeof(szMessage), "* (%d) %s %s", playerVariables[i][pGroupRank], playerVariables[playerid][pCustomRank], playerVariables[i][pNormalName]);
                    case 4: format(szMessage, sizeof(szMessage), "* (%d) %s %s", playerVariables[i][pGroupRank], playerVariables[playerid][pCustomRank], playerVariables[i][pNormalName]);
                    case 5: format(szMessage, sizeof(szMessage), "* (%d) %s %s", playerVariables[i][pGroupRank], playerVariables[playerid][pCustomRank], playerVariables[i][pNormalName]);
                    case 6: format(szMessage, sizeof(szMessage), "* (%d) %s %s", playerVariables[i][pGroupRank], playerVariables[playerid][pCustomRank], playerVariables[i][pNormalName]);

                }
                SendClientMessage(playerid, COLOR_WHITE, szMessage);
            }
        }
        SendClientMessage(playerid, COLOR_TEAL, "----------------------------------------------------------------");
    }
    return 1;
}



Re: Looping with mysql - MadafakaPro - 19.12.2012

BUMP!!


Re: Looping with mysql - ikey07 - 19.12.2012

SELECT `user_name` FROM `users` WHERE `GroupID` = 'id' AND `Online` = '0'


Then print result in a loop