count - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: count (
/showthread.php?tid=111103)
count -
radi - 29.11.2009
how can i make a join count and register count
like i type /info
it wil show
players joined : %d
Acount Registered : %d
Re: count -
LarzI - 29.11.2009
ontop
onplayerconnect
inside your register command
Remember that you might wanna save to a file (?)
if you want all-time registered players, not only since last restart
Re: count -
radi - 29.11.2009
i want that it stay's
Re: count -
LarzI - 29.11.2009
Use any file function system (original File Functions, dINI etc)
I recommend dINI
Example code:
pawn Код:
//bottom of onplayerconnect:
if(!dini_Exists("playercount.ini"))
{
dini_Create("playercount.ini");
dini_IntSet("playercount.ini", "pCount", 0);
dini_IntSet("playercount.ini", "aCount", 0);
}
dini_IntSet("playercount.ini", "pCount", dini_Int("playercount.ini", pCount)+pCount);
dini_IntSet("playercount.ini", "aCount", dini_Int("playercount.ini", aCount)+aCount);
Re: count -
radi - 29.11.2009
how ?
Re: count -
LarzI - 29.11.2009
check my post,I've edited
Re: count -
radi - 29.11.2009
2 errors
C:\DOCUME~1\Tim\BUREAU~1\pawno\GAMEMO~1\****.pwn(2 572) : error 035: argument type mismatch (argument 2)
C:\DOCUME~1\Tim\BUREAU~1\pawno\GAMEMO~1\****.pwn(2 573) : error 035: argument type mismatch (argument 2)
line 2572 en 2573 are the last 2 lines of that dini shit
pawn Код:
if(!dini_Exists("playercount.ini"))
{
dini_Create("playercount.ini");
dini_IntSet("playercount.ini", "PlayersOnline", 0);
dini_IntSet("playercount.ini", "PlayersRegisterd", 0);
}
dini_IntSet("playercount.ini", "PlayersOnline", dini_Int("playercount.ini", PlayersOnline)+PlayersOnline);
dini_IntSet("playercount.ini", "PlayersRegisterd", dini_Int("playercount.ini", PlayersRegisterd)+PlayersRegisterd);
Re: count -
LarzI - 29.11.2009
pawn Код:
if(!dini_Exists("playercount.ini"))
{
dini_Create("playercount.ini");
dini_IntSet("playercount.ini", "pCount", 0);
dini_IntSet("playercount.ini", "aCount", 0);
}
dini_IntSet("playercount.ini", "pCount", dini_Int("playercount.ini", "pCount")+pCount);
dini_IntSet("playercount.ini", "aCount", dini_Int("playercount.ini", "aCount")+aCount);
there