21.05.2014, 19:26
Код:
public OnPlayerConnect(playerid) { ClearVariables(playerid); new ip[15]; TogglePlayerSpectating(playerid, 1); SetPlayerColor(playerid, WHITE); ClearChat(playerid, 50); GetPlayerIp(playerid, ip, sizeof(ip)); format(szQuery, sizeof(szQuery), "SELECT * FROM `accounts` WHERE `username` = '%s'", ReturnPlayerName(playerid)); mysql_function_query(MainPipeline, szQuery, true, "OnQueryFinish", "ii", THREAD_CHECK_ACCOUNT, playerid); format(szQuery, sizeof(szQuery), "INSERT INTO `connections` (`Name`, `IP`, `Date`) VALUES ('%s', '%s', '%s')", ReturnPlayerName(playerid), ip, TimeDate()); mysql_function_query(MainPipeline, szQuery, true, "OnQueryFinish", "ii", THREAD_NO_RESULT, playerid); DeleteObjectsForPlayer(playerid); return 1; }