Count question. - 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: Count question. (
/showthread.php?tid=598670)
Count question. -
radiobizza - 15.01.2016
How to count how many accounts reggistered I have in my scriptfiles ?
Re: Count question. -
NoDi522 - 15.01.2016
For what do you need that?
I mean if you need count for lets say /statistic command you can do something like:
- When the player registers YourRegisterCounter++;
Re: Count question. -
radiobizza - 15.01.2016
I want to put on my tutorial when a player make an account.
And in the tutorial to say something like this: We have %s accounts recorded
Re: Count question. -
Eth - 15.01.2016
%d not %s :P what is the tutorial saving system, mysql?
Re: Count question. -
radiobizza - 15.01.2016
INI :/ i'm an old school scripter
)
Re: Count question. -
Eth - 15.01.2016
well, I haven't used INI before so I can't tell you how to do the saving system for counting, but I can give you some tips.
1. Make a new variable called RegisteredAccounts and put it in the top of the script (after the includes of course)
now when a player register do:
pawn Код:
RegisteredAccounts ++;
//then tell him We have %d accounts recorded
now ongamemodeinit:
pawn Код:
//here make a check if the file exists or not, if it exists then set RegisteredAccounts = saved else then make a new file
Re: Count question. -
NoDi522 - 15.01.2016
If I understood you,you need something like this:
PHP код:
new RegisterCounter; // on top of your script
// Put this on your finish registration part
RegisterCounter++;
// Part of the tutorial that tells us how many players have registered on the server
new message[128];
format(message,sizeof(message),"INFO: There are %d players registered on our server.",RegisterCounter);
SendClientMessage(playerid,-1,poruka);
Re: Count question. -
radiobizza - 15.01.2016
Quote:
Originally Posted by Eth
well, I haven't used INI before so I can't tell you how to do the saving system for counting, but I can give you some tips.
1. Make a new variable called RegisteredAccounts and put it in the top of the script (after the includes of course)
now when a player register do:
pawn Код:
RegisteredAccounts ++; //then tell him We have %d accounts recorded
now ongamemodeinit:
pawn Код:
//here make a check if the file exists or not, if it exists then set RegisteredAccounts = saved else then make a new file
|
can you make me an example please?
Re: Count question. -
radiobizza - 16.01.2016
Bump