PDA

View Full Version : [MYSQ] Spamming Invalid HouseSpawn!


kloning1
29/06/2015, 08:17 AM
hi, i have little problem ,
i have house system create by me (n00bz)
this code:

// top
#define MAX_HOUSE 100
public OnGameModeInit()
{
// some function
Loop(i, MAX_HOUSE) // for looping max house
{
new query[100];
mysql_format(mysql, query, sizeof(query), "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1", i);
mysql_tquery(mysql, query, "LoadHouses", "i", i);
}
return 1;
}

but, on debug, make spam, how to stop it, if no house create on database?
this debug:
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '0' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '1' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '2' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '3' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '4' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] CMySQLConnection::Connect - establishing connection to database...
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '5' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '6' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '7' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '8' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '9' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '10' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '11' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '12' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '13' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '14' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '15' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '16' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '17' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '18' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '19' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '20' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '21' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '22' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '23' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '24' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '25' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '26' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '27' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '28' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '29' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] CMySQLConnection::Connect - connection was successful
* FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '30' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[08:48:21] [DEBUG] CMySQLQuery::Execute[LoadHouse] - starting query execution
OM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] CMySQLConnection::Connect - connection was successful
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '31' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] CMySQLQuery::Execute[LoadHouse] - query was successfully executed within 0.463 milliseconds
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '32' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] CMySQLResult::CMySQLResult() - constructor called
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] CMySQLConnection::Connect - connection was successful
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '33' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '34' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '35' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '36' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '37' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '38' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '39' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '40' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '41' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '42' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '43' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '44' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '45' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '46' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '47' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '48' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '49' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '50' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '51' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '52' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] CMySQLQuery::Execute[LoadHouse] - starting query execution
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '53' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] mysql_format - connection: 1, len: 100, format: "SELECT * FROM `house` WHERE `ID` = '%i' LIMIT 1"
[08:48:21] [DEBUG] mysql_tquery - connection: 1, query: "SELECT * FROM `house` WHERE `ID` = '54' LIMIT 1", callback: "LoadHouse", format: "i"
[08:48:21] [DEBUG] CMySQLQuery::Execute[LoadHouse] - query was successfully executed within 0.402 milliseconds
[08:48:21] [DEBUG] CMySQLResult::CMySQLResult() - constructor called

Vince
29/06/2015, 09:37 AM
This is not how you do it. Read: http://forum.sa-mp.com/showthread.php?t=366019
Slightly outdated but logic still applies.

kloning1
29/06/2015, 01:52 PM
oke, thats great, :) i found the logic :) thankyou vince