• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] Sending message to all owner of key (from SQL)
#1
Hi,



How do I make something like sending message to all key's holder from sql function?



example like :



PHP Code:
mysql_format(sqldatapQuerysizeof pQuery"SELECT doorkey FROM `bizkeys` WHERE bizid = %d;"bizid);

new 
Cache:result mysql_query(sqldatapQuery);



then?



sendclientmsg to all holder of "doorkey" from bizid = %d



or something.
  Reply
#2
Code:
mysql_format(sqldata, pQuery, sizeof pQuery, "SELECT holdername, doorkey FROM `bizkeys` WHERE bizid = %d;", bizid);
new Cache:result = mysql_query(sqldata, pQuery);
new rows = cache_num_rows();
if (rows) {
? ? new name[24];
? ? for (new i; i < rows; i) {
? ? ? ? cache_get_value_name(i, "holdername", name);
? ? ? ? foreach(new p : Player) if (!strcmp(GetName(p), name, true)) {
? ? ? ? ? ? SendClientMessage(p, ...);
? ? ? ? ? ? break;
? ? ? ? }
? ? }
    cache_delete(result);
}
You have to save the player name in the holdername field.
  Reply


Forum Jump: