24.03.2011, 11:44
Код:
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; }