16.01.2013, 14:10
PHP код:
public OnPlayerConnect(playerid)
{
new string[128],account[MAX_PLAYER_NAME];
GetPlayerName(playerid,account,sizeof(account));
format(string, sizeof(string), "SELECT * FROM `users` WHERE `Name` = '%s' LIMIT 1", account);
mysql_function_query(mCon, string, true, "CheckAccount", "i",playerid);
return 1;
}
forward CheckAccount(playerid);
public CheckAccount(playerid)
{
new rows, fields;
cache_get_data(rows, fields);
if(rows) // Login code here
{
}
else // Register code here
{
}
return 1;
}