SQL Lite loading weapons on OnPlayerSpawn with loop crashes server. -
Hello, I was trying to make that it loads weapons when player spawns but it's crashing server..
pawn Код:
format(Query, sizeof(Query), "SELECT * FROM `WEAPONS` WHERE `NAME` = '%s' COLLATE NOCASE ", DB_Escape(name));
new DBResult:Result,Field[20];
Result = db_query(Database, Query);
new weapons[13][2];
new soltstring[20] = "";
new slotdatastring[20] = "";
for (new i = 0; i < 13; i++)
{
format(soltstring, sizeof(soltstring), "SLOT%i",i);
print(soltstring);
format(slotdatastring, sizeof(slotdatastring), "SLOT%iDATA",i);
print(slotdatastring);
db_get_field_assoc(Result, soltstring, Field, 30);
weapons[i][0] = strval(Field);
db_get_field_assoc(Result, slotdatastring, Field, 30);
weapons[i][1] = strval(Field);
if(weapons[i][1] != 0) GivePlayerWeapon(playerid,weapons[i][0],weapons[i][1]);
}
It seems that it stops at SLOT3 and crashes... Any ideas? Thanks...