MySQL server info saving?
#6

Quote:
Originally Posted by THE_KNOWN
Посмотреть сообщение
Код:
new tkicks;
new tcons;
new tdiscons;

public OnPlayerConnect(playerid)
{
	tcons++;
	new q[128];
	format(q,128,"UPDATE `setverinfo` SET totalkicks=%d, totalconnects=%d, totaldiscons=%d",tkicks,tcons,tdiscons);
	mysql_query(q);
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	tdiscons++;
	if(reason == 2) tkicks++;
	new q[128];
	format(q,128,"UPDATE `setverinfo` SET totalkicks=%d, totalconnects=%d, totaldiscons=%d",tkicks,tcons,tdiscons);
	mysql_query(q);
	return 1;
}

dcmd_create(playerid, params[])
{
    #pragma unused params
    #pragma unused playerid
    new queue[200];

    format(queue, sizeof(queue), "INSERT INTO `ServerInfo` (TotalKicks, TotalConnects, TotalDisconnects) VALUES (0, 0, 0)");
    mysql_query(queue);
    return 1;
}
proper way todo it
Hmm it dont work :S

and if i get it to work... how to read from it?

Edit: i got it to work.. but how to read from the Database?
pawn Код:
new string[35];
format(string,sizeof(string),"Total connects of this server is %s",TotalConnects);
SendClientMessage(playerid,0xFFFFFAA,string);

//??/??/
Reply


Messages In This Thread
MySQL server info saving? - by Unknown123 - 24.03.2011, 10:38
Re: MySQL server info saving? - by THE_KNOWN - 24.03.2011, 10:41
Re: MySQL server info saving? - by Unknown123 - 24.03.2011, 11:21
Re: MySQL server info saving? - by THE_KNOWN - 24.03.2011, 11:31
Re: MySQL server info saving? - by THE_KNOWN - 24.03.2011, 11:44
Re: MySQL server info saving? - by Unknown123 - 24.03.2011, 12:15

Forum Jump:


Users browsing this thread: 1 Guest(s)