Looping with mysql
#1

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

BUMB!
Reply
#3

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

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.)
Reply
#5

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;
}
Reply
#6

BUMP!!
Reply
#7

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


Then print result in a loop
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)