05.12.2009, 21:30
Something like this: (Copied directly from rAdmin script)
Usage:
pawn Код:
public MySQLCheckUserExistance(playerid)
{
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
format(query, sizeof(query), "SELECT `reg_id` FROM `users` WHERE `name` = '%s'", PlayerName);
samp_mysql_query(query);
samp_mysql_store_result();
if(samp_mysql_num_rows() == 0)
{
return 0;
}
else
{
return 1;
}
}
pawn Код:
if(MySQLCheckUserExistance(playerid))
{
//User is in the database (exists)
}