05.10.2013, 08:13
Hello again,
In my previous topic, i didn't check the code correctly that's why it's not working.
But now, I check it first before getting help in Scripting Help.
But it still don't save.
LastOn and LastTime in the database doesn't save. It always saves as null causing the server to crash everytime the server tries to display a dialog with the LastOn, LastTime (Causes the crash) and loads the GameTime (loads correctly).
Also i've question, How do i check how many registered users are in the server? For example a registered users register.
It will show something like this
"Jake_Hero(0) has registered the server making the server to have 2 registered players"
This is how i count the userid (automatically no var)
And about the LastOn and LastTime null problem. Here's the code
In my previous topic, i didn't check the code correctly that's why it's not working.
But now, I check it first before getting help in Scripting Help.
But it still don't save.
LastOn and LastTime in the database doesn't save. It always saves as null causing the server to crash everytime the server tries to display a dialog with the LastOn, LastTime (Causes the crash) and loads the GameTime (loads correctly).
Also i've question, How do i check how many registered users are in the server? For example a registered users register.
It will show something like this
"Jake_Hero(0) has registered the server making the server to have 2 registered players"
This is how i count the userid (automatically no var)
Код:
`userid` INTEGER PRIMARY KEY AUTOINCREMENT
pawn Код:
new y, m, d;
new hs, ms, ss;
gettime(hs, ms, ss);
getdate(y, m, d);
new str[35],
str2[35]
;
format(str, sizeof str, "%d-%d-%d", m, d, y);
format(str2, sizeof str2, "%d:%d:%d", hs, ms, ss);
format(Query, sizeof(Query),
"UPDATE `users` \
SET `admin` = '%d', \
`vip` = '%d', \
`LastOn` = '%s', \
`LastTime` = '%s', \
`speedboost` = '%d', \
`score` = '%d', \
`money` = '%d', \
`hours` = '%d', \
`minutes` = '%d', \
`seconds` = '%d', \
`mb` = '%d', \
`SaveSkin` = '%d' \
`UseSkin` = '%d'\
`kills` = '%d', \
`deaths` = '%d', \
`cookies` = '%d' \
WHERE `username` = '%s'",
User[playerid][Admin],
User[playerid][VIP],
DB_Escape(str),
DB_Escape(str2),
User[playerid][SBoost],
GetPlayerScore(playerid),
LastMoney[playerid],
User[playerid][Hours],
User[playerid][Minutes],
User[playerid][Seconds],
User[playerid][MB],
User[playerid][SSkin],
User[playerid][USkin],
User[playerid][Kills],
User[playerid][Deaths],
User[playerid][Cookies],
DB_Escape(GetName(playerid))
);
db_query(Database, Query);