doubt (++rep)
#1

hai all
i have a doubt
i am currently working with a /myhouses command.
it should actually give a dialog showing the houses owned by the player
so how can i do it ?
i am using mysql r39-2
so i have stuck with this
PHP код:
new query[200],cache:houses;
format(query,sizeof(query),select houseid where owner = %s,getplayername(playerid));
houses=....... 
and how to do the remaining like getting the houseid and saving.
can we do with sscanf ?
i am new with mysql r39..

thanks in advance.
Reply
#2

Example:
Код:
new Cache: r, houseid, rows, fields;
mysql_format(handle, query, 200, "SELECT * FROM `houses` WHERE `Owner` = '%s'", getplayername(playerid));
r = mysql_query(handle, query);
cache_get_data(rows, fields, handle);
if(rows == 0) cache_delete®, SendClientMessage(playerid, -1, "You don't have a house."), return 1;
cache_get_row_int(0, "ID", houseid);
cache_delete®;
Reply
#3

Why don't you simply load up the houses owned by player and loop through them looking for playerid's sqlid then format the results into a dialog rather than requesting a result from a database.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)