21.06.2016, 13:30
Quote:
I will perform this function, it recognizes the name on the account number in the database. (encoding declared at the beginning of fashion after the database connection)
stock GetAccountName(account) { new name[MAX_PLAYER_NAME]; if(SQL::RowExists("accounts", "ID", account)) { new handle = SQL::Open(SQL::READ, "accounts", "ID", account); SQL::ReadString(handle, "Name", name, MAX_PLAYER_NAME); SQL::Close(handle); } return name; } The result of "return" is recognized in the "??" |
Code:
stock GetAccountName(account) { new name[MAX_PLAYER_NAME]; if(SQL::RowExists("accounts", "ID", account)) { SQL::GetStringEntry("accounts", "Name", "ID", account, name, MAX_PLAYER_NAME); return name; } return 0; }