Getting house owner if its right sell it HELP
#2

pawn Код:
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(string, sizeof(string), "SELECT Houseowner FROM Houses WHERE ID = '%d'", i);
mysql_query(string);
mysql_store_result();
new howner[MAX_PLAYER_NAME];
mysql_fetch_field("Houseowner", howner);
if(!strcmp(howner, name, false)) { // If the name in the database matches with your name...
    // If the player is the owner...
}
else {
    // If the player is not the owner...
}
mysql_free_result();
Example code. Btw, you can't select a query like that, do what I did ^^.
Reply


Messages In This Thread
Getting house owner if its right sell it HELP - by thimo - 14.01.2012, 11:37
Re: Getting house owner if its right sell it HELP - by Mean - 14.01.2012, 12:10
Re: Getting house owner if its right sell it HELP - by thimo - 14.01.2012, 13:34
Re: Getting house owner if its right sell it HELP - by Mean - 14.01.2012, 13:54
Re: Getting house owner if its right sell it HELP - by thimo - 14.01.2012, 14:04
Re: Getting house owner if its right sell it HELP - by Mean - 14.01.2012, 14:12
Re: Getting house owner if its right sell it HELP - by thimo - 14.01.2012, 14:21

Forum Jump:


Users browsing this thread: 2 Guest(s)