Online Status - 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: Online Status (
/showthread.php?tid=663678)
Online Status -
ApoziX - 08.02.2019
I got an rp script and I want to create online status, I got the mysql row "Online"
But I dont know how to put it In script
I want it to update the row "Online" onplayerconnect to 1 And onplayerdisconnect to 0
How can I do it?
Re: Online Status -
Banditul18 - 08.02.2019
SQL update query
Re: Online Status -
ApoziX - 08.02.2019
Quote:
Originally Posted by Banditul18
SQL update query
|
PHP код:
OnPlayerConnect
new query[250];
mysql_format(MysqlCon, query, sizeof(query), "UPDATE `users` SET `Online`=1 WHERE `uid`=%s",
PlayerName(playerid));
mysql_tquery(MysqlCon, query, "", "");
Like That?
Re: Online Status -
Calisthenics - 08.02.2019
When the player connects, you only know their name. Let them login and on success, update `Online` column.
Also string specifier requires apostrophes '%s' or when escaping input '%e'
Re: Online Status -
ApoziX - 09.02.2019
Quote:
Originally Posted by Calisthenics
When the player connects, you only know their name. Let them login and on success, update `Online` column.
Also string specifier requires apostrophes '%s' or when escaping input '%e'
|
Thank you for the advice