Counting Users
#1

I want to simply know how to count a user from my 'Server/Users'
something like it will print out with the gamemode print

like

Код:
Los Santos Reality Roleplay
Users Files: 10004
if server/users is empty then

Код:
No Users Files .INI found in 'PATH'
Reply
#2

Quote:
Originally Posted by Reklez
Посмотреть сообщение
I want to simply know how to count a user from my 'Server/Users'
something like it will print out with the gamemode print

like

Код:
Los Santos Reality Roleplay
Users Files: 10004
if server/users is empty then

Код:
No Users Files .INI found in 'PATH'
It it a lot more easier to do this if you have a MySQL system running on your game-mode. You can also make User Control Panel with the help of MySQL system.

-FalconX
Reply
#3

Well i ask one of my friends (Ronaldo) i ask him if MYSQL is easy and he say no, so i use y_ini instead of MYSQL
Reply
#4

pawn Код:
new counter, name[128];
while( fmatch(name, "path/*.ini", counter) )
    counter++;
printf("There are %d files with the ending \".ini\" in folder \"path\".", counter);
Maybe this will work.

Edit:
Nope, seems like this function doesn't exists. (well, only defined in the file include...)
Reply
#5

well didn't work.
Reply
#6

Quote:
Originally Posted by ue_falconx
Посмотреть сообщение
It it a lot more easier to do this if you have a MySQL system running on your game-mode. You can also make User Control Panel with the help of MySQL system.

-FalconX
Irrelevant to this thread and not the slightest bit informative.
Quote:
Originally Posted by Pain123
Посмотреть сообщение
pawn Код:
new counter, name[128];
while( fmatch(name, "path/*.ini", counter) )
    counter++;
printf("There are %d files with the ending \".ini\" in folder \"path\".", counter);
Maybe this will work.
Combine that with if(!counter) { // No Users Files .INI found in 'PATH' message here} after the while statement to get the desired result.
EDIT:
On second thought I don't think the original code will work.
Reply
#7

If that code doesn't work, you have just 2 options:
1. use a plugin or
2. create a file, where all the user-file-names are saved in (each line one name)
and count the lines. (on every file-creation, for example if somebody registers a new account,
you append the new file-name to the user-file-name-file. You could even just save a number in a
file and increase the number if someone registers)
Reply
#8

i don't want to create another thread so i post here.
why when i rob the LS Bank Central i get this message "$0" instead of the amount of money has been rob

pawn Код:
CMD:robbank(playerid, params[])
{
    new string[128];
    if(IsPlayerInRangeOfPoint(playerid, 1.0, 358.7953,184.0279,1008.3828))
    {
        if(pInfo[playerid][SkillLevel] > 3)
        {
            if(pInfo[playerid][Rob] == 1) return SendClientMessage(playerid, COLOR_GREY, "You can rob this bank again after 5 minutes!");
            new rMoney = random(5);
            switch(rMoney)
            {
                 case 0: GivePlayerMoney(playerid, 500000);
                 case 1: GivePlayerMoney(playerid, 5000000);
                 case 2: GivePlayerMoney(playerid, 1000000);
                 case 3: GivePlayerMoney(playerid, 100000);
                 case 4: GivePlayerMoney(playerid, 90000);
            }
            pInfo[playerid][Rob] = 1;
            pInfo[playerid][SkillLevel]++;
            SetPlayerWantedLevel(playerid, GetPlayerWantedLevel(playerid) + 2);
            format(string, sizeof(string), "NEWS REPORT: "red"LS Bank Central "white"has been rob by "red"%s", GetName(playerid));
            SendClientMessageToAll(COLOR_WHITE, string);
            format(string, sizeof(string), "You rob the Los Santos Bank Central, you got $%i, now run before cop caught you!", rMoney);
            SendClientMessage(playerid, COLOR_RED, string);
            SendClientMessage(playerid, COLOR_GREY, "You can rob this bank after 5 minutes!");
            SetTimer("RobEvaded", 300000, false);
        }
        else return SendClientMessage(playerid, COLOR_GREY, "  You are not at Skill Level 3, so you cannot rob this bank!  ");
    } else {
        SendClientMessage(playerid, COLOR_GREY, "  You are not at LS Bank Central Money Account Service Area!  ");
    }
    return 1;
}
Reply
#9

Replace
pawn Код:
format(string, sizeof(string), "You rob the Los Santos Bank Central, you got $%i, now run before cop caught you!", rMoney);
with

pawn Код:
format(string, sizeof(string), "You rob the Los Santos Bank Central, you got $%d, now run before cop caught you!", rMoney);
Reply
#10

Quote:
Originally Posted by blank.
Посмотреть сообщение
Irrelevant to this thread and not the slightest bit informative.
Alright, though this is not THAT irrelevant to this thread, what I said is an info which might be useful for him as he asked about the counting thingy which is related to MySQL and we can do it even more easier by using it. So, can you make a fastest user control panel with any other file-based saving systems?

You cant just retrieve the files from the script-files as it's not that easy and secondly it make the process slower as there are each FILE for EACH player lol. What I said is true and also it is a lot more easier to use MySQL to count the total number of users unlike the file-base saving systems and those are slower though.



-FalconX
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)