Jump to content
  • 0

Problema MySQL/incarcare skinuri


Question

Posted

Salut! Am o problema de care nu m-am mai lovit pana acum, una care ma face foarte confuz. Am incercat sa fac un dynamic system pentru skinuri custom. Am facut o comanda prin care adaug skinurile si o functie care incarca skinurile la OnGameModeInit. Dupa efectuarea comenzii, skinurile sunt urcate fara probleme in baza de date, insa atunci cand dau restart la server, imi citeste prima litera din numele skinului de doua ori, ceea ce duce la eroarea urmatoare in consola:

Quote

[artwork:crc] bballas3.txd CRC = 0x0
[artwork:error] Bad file: bballas3.txd
1 custom skins loaded from database.

^^ DESI in baza de date, dff-ul si txd-ul se numesc ballas3.dff si ballas3.txd, nu bballas3.dff si bballas3.txd

Prin asta incarc skinurile pe server la OnGameModeInit:

forward LoadCustomSkins();
public LoadCustomSkins()
{
	static
	    rows,
	    fields,
	    count;

	cache_get_data(rows, fields, SQL);

	if(rows)
	{
		for (new idx = 0; idx < rows; idx ++)
		{
			SkinInfo[idx][skinID] = cache_get_field_content_int(idx, "ID");
		    SkinInfo[idx][skinBaseID] = cache_get_field_content_int(idx, "BaseID");
		    SkinInfo[idx][skinSkinID] = cache_get_field_content_int(idx, "SkinID");
			cache_get_field_content(idx, "DFF", SkinInfo[idx][skinDFF], SQL, 64); 
			cache_get_field_content(idx, "TXD", SkinInfo[idx][skinTXD], SQL, 64);

			AddCharModel(SkinInfo[idx][skinBaseID], SkinInfo[idx][skinSkinID], SkinInfo[idx][skinDFF], SkinInfo[idx][skinTXD]);
			count++;
		}
		printf("%d custom skins loaded from database.", count);
	}
    return 1;
}

 

2 answers to this question

Recommended Posts

  • 0
Posted

Salut, incearca asa:

forward LoadCustomSkins();
public LoadCustomSkins()
{
	if(cache_num_rows())
	{
		static count;
		for (new idx; idx < cache_num_rows(); idx ++)
		{
			SkinInfo[idx][skinID] = cache_get_field_content_int(idx, "ID");
		    SkinInfo[idx][skinBaseID] = cache_get_field_content_int(idx, "BaseID");
		    SkinInfo[idx][skinSkinID] = cache_get_field_content_int(idx, "SkinID");
			cache_get_field_content(idx, "DFF", SkinInfo[idx][skinDFF]); 
			cache_get_field_content(idx, "TXD", SkinInfo[idx][skinTXD]);

			AddCharModel(SkinInfo[idx][skinBaseID], SkinInfo[idx][skinSkinID], SkinInfo[idx][skinDFF], SkinInfo[idx][skinTXD]);
			count++;
		}
		printf("%d custom skins loaded from database.", count);
	}
    return 1;
}

 

  • Like 1
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.