09.02.2015, 18:18
This isn't working as I'd like it too.
I have a master account system, where you need to register your master account and then create a character, so the function will check if the character name already exists in the database, but it doesn't work properly.
pawn Код:
stock AccountExists(playerid, name[]) {
new Query[128];
format(Query, sizeof Query, "SELECT `Name` FROM `accounts` WHERE `Name` = '%s'", name);
mysql_tquery(dbHandle, Query, "AccountReturn", "i", playerid);
return 1;
}
forward AccountReturn(playerid);
public AccountReturn(playerid) {
new rows, fields;
cache_get_data(rows, fields, dbHandle);
if(rows) {
return 1;
}
return 0;
}