Make right mysql LOAD
#1

Someone can help me to make this load system right on mysql?

It's just server info... owner's zones / admin's list

I try do it learn a tutorial, but it's not a player, dont have a ID, it's just a server info

Srry to my english

Код:
CarregarServer() {
	new query[50]; // Nгo precisa ser enorme como vocк tinha colocado; Precisa apenas caber sua query dentro dela
	mysql_format(ConnectMYSQL, query, sizeof(query), "SELECT * FROM server");
	mysql_function_query(ConnectMYSQL, query, true, "Carregar_Server","i");
}

Carregar_Server();
Carregar_Server() {
	new int_dest[6];
	int_dest[0] = cache_get_field_content_int(0, "donoDende");               				donoDende = int_dest[0];
	int_dest[1] = cache_get_field_content_int(0, "donoComplexo");               			donoComplexo = int_dest[1];
	int_dest[2] = cache_get_field_content_int(0, "donoUrubu");               				donoUrubu = int_dest[2];
	int_dest[3] = cache_get_field_content_int(0, "donoMangueira");               			donoMangueira = int_dest[3];
	int_dest[4] = cache_get_field_content_int(0, "donoRocinha");               				donoRocinha = int_dest[4];
	int_dest[5] = cache_get_field_content_int(0, "donoTitanic");               				donoTitanic = int_dest[5];

	cache_get_field_content(0, "god", admlist[god],1,30);
	cache_get_field_content(0, "cm1", admlist[cm1],1,30);
	cache_get_field_content(0, "cm2", admlist[cm2],1,30);
	cache_get_field_content(0, "gm1", admlist[gm1],1,30);
	cache_get_field_content(0, "gm2", admlist[gm2],1,30);
	cache_get_field_content(0, "gm3", admlist[gm3],1,30);
	cache_get_field_content(0, "gm4", admlist[gm4],1,30);
	cache_get_field_content(0, "sa1", admlist[sa1],1,30);
	cache_get_field_content(0, "sa2", admlist[sa2],1,30);
	cache_get_field_content(0, "sa3", admlist[sa3],1,30);
	cache_get_field_content(0, "sa4", admlist[sa4],1,30);
	cache_get_field_content(0, "adm1", admlist[adm1],1,30);
	cache_get_field_content(0, "adm2", admlist[adm2],1,30);
	cache_get_field_content(0, "adm3", admlist[adm3],1,30);
	cache_get_field_content(0, "adm4", admlist[adm4],1,30);
	cache_get_field_content(0, "mod1", admlist[mod1],1,30);
	cache_get_field_content(0, "mod2", admlist[mod2],1,30);
	cache_get_field_content(0, "mod3", admlist[mod3],1,30);
	cache_get_field_content(0, "mod4", admlist[mod4],1,30);
	cache_get_field_content(0, "mod5", admlist[mod5],1,30);
	cache_get_field_content(0, "mod6", admlist[mod6],1,30);
	cache_get_field_content(0, "mod7", admlist[mod7],1,30);
	cache_get_field_content(0, "mod8", admlist[mod8],1,30);
	cache_get_field_content(0, "tutor1", admlist[tutor1],1,30);
	cache_get_field_content(0, "tutor2", admlist[tutor2],1,30);
	cache_get_field_content(0, "tutor3", admlist[tutor3],1,30);
	cache_get_field_content(0, "tutor4", admlist[tutor4],1,30);
	cache_get_field_content(0, "tutor5", admlist[tutor5],1,30);
	cache_get_field_content(0, "tutor6", admlist[tutor6],1,30);
	cache_get_field_content(0, "tutor7", admlist[tutor7],1,30);
	cache_get_field_content(0, "tutor8", admlist[tutor8],1,30);
}



http://i.imgur.com/yl0MuuI.png

http://i.imgur.com/hqJEj9h.png


Warning on compile
Код:
warning 203: symbol is never used: "Carregar_Server"
Reply
#2

Define Carregar_Server


Define it or use it as a new
Reply
#3

But i wanna load it
I tryed it too:
Код:
CarregarServer() {
	mysql_tquery(ConnectMYSQL, "SELECT * FROM `server`", "Carregar_Server", "");
}

Carregar_Server() {

	if(cache_get_row_count() == 0) {
		print("Nada encontrado");
		
	} else {

		new int_dest[6];
		int_dest[0] = cache_get_field_content_int(0, "donoDende");               				donoDende = int_dest[0];
		int_dest[1] = cache_get_field_content_int(0, "donoComplexo");               			donoComplexo = int_dest[1];
		int_dest[2] = cache_get_field_content_int(0, "donoUrubu");               				donoUrubu = int_dest[2];
		int_dest[3] = cache_get_field_content_int(0, "donoMangueira");               			donoMangueira = int_dest[3];
		int_dest[4] = cache_get_field_content_int(0, "donoRocinha");               				donoRocinha = int_dest[4];
		int_dest[5] = cache_get_field_content_int(0, "donoTitanic");               				donoTitanic = int_dest[5];

		cache_get_field_content(0, "god", admlist[god],1,30);
		cache_get_field_content(0, "cm1", admlist[cm1],1,30);
		cache_get_field_content(0, "cm2", admlist[cm2],1,30);
		cache_get_field_content(0, "gm1", admlist[gm1],1,30);
		cache_get_field_content(0, "gm2", admlist[gm2],1,30);
		cache_get_field_content(0, "gm3", admlist[gm3],1,30);
		cache_get_field_content(0, "gm4", admlist[gm4],1,30);
		cache_get_field_content(0, "sa1", admlist[sa1],1,30);
		cache_get_field_content(0, "sa2", admlist[sa2],1,30);
		cache_get_field_content(0, "sa3", admlist[sa3],1,30);
		cache_get_field_content(0, "sa4", admlist[sa4],1,30);
		cache_get_field_content(0, "adm1", admlist[adm1],1,30);
		cache_get_field_content(0, "adm2", admlist[adm2],1,30);
		cache_get_field_content(0, "adm3", admlist[adm3],1,30);
		cache_get_field_content(0, "adm4", admlist[adm4],1,30);
		cache_get_field_content(0, "mod1", admlist[mod1],1,30);
		cache_get_field_content(0, "mod2", admlist[mod2],1,30);
		cache_get_field_content(0, "mod3", admlist[mod3],1,30);
		cache_get_field_content(0, "mod4", admlist[mod4],1,30);
		cache_get_field_content(0, "mod5", admlist[mod5],1,30);
		cache_get_field_content(0, "mod6", admlist[mod6],1,30);
		cache_get_field_content(0, "mod7", admlist[mod7],1,30);
		cache_get_field_content(0, "mod8", admlist[mod8],1,30);
		cache_get_field_content(0, "tutor1", admlist[tutor1],1,30);
		cache_get_field_content(0, "tutor2", admlist[tutor2],1,30);
		cache_get_field_content(0, "tutor3", admlist[tutor3],1,30);
		cache_get_field_content(0, "tutor4", admlist[tutor4],1,30);
		cache_get_field_content(0, "tutor5", admlist[tutor5],1,30);
		cache_get_field_content(0, "tutor6", admlist[tutor6],1,30);
		cache_get_field_content(0, "tutor7", admlist[tutor7],1,30);
		cache_get_field_content(0, "tutor8", admlist[tutor8],1,30);
	}	
}
But:
Код:
warning 203: symbol is never used: "Carregar_Server"
Reply
#4

PHP код:
 #pragma unused Carregar_Server 
Not sure if that what you're looking for
Reply
#5

you need to:
call the Carregar_Server some where like:
PHP код:
CMD:ploto(playerid,params[]) {
       
mysql_tquery(ConnectMYSQL"SELECT * FROM `server`""Carregar_Server""");
       return 
1;

and you need to:

PHP код:
forward Carregar_Server();
public 
Carregar_Server() {
    if(
cache_get_row_count() == 0) {
        print(
"Nada encontrado");
    } else {
        new 
int_dest[6];
        
int_dest[0] = cache_get_field_content_int(0"donoDende");                               donoDende int_dest[0];
        
int_dest[1] = cache_get_field_content_int(0"donoComplexo");                           donoComplexo int_dest[1];
        
int_dest[2] = cache_get_field_content_int(0"donoUrubu");                               donoUrubu int_dest[2];
        
int_dest[3] = cache_get_field_content_int(0"donoMangueira");                           donoMangueira int_dest[3];
        
int_dest[4] = cache_get_field_content_int(0"donoRocinha");                               donoRocinha int_dest[4];
        
int_dest[5] = cache_get_field_content_int(0"donoTitanic");                               donoTitanic int_dest[5];
        
cache_get_field_content(0"god"admlist[god],1,30);
        
cache_get_field_content(0"cm1"admlist[cm1],1,30);
        
cache_get_field_content(0"cm2"admlist[cm2],1,30);
        
cache_get_field_content(0"gm1"admlist[gm1],1,30);
        
cache_get_field_content(0"gm2"admlist[gm2],1,30);
        
cache_get_field_content(0"gm3"admlist[gm3],1,30);
        
cache_get_field_content(0"gm4"admlist[gm4],1,30);
        
cache_get_field_content(0"sa1"admlist[sa1],1,30);
        
cache_get_field_content(0"sa2"admlist[sa2],1,30);
        
cache_get_field_content(0"sa3"admlist[sa3],1,30);
        
cache_get_field_content(0"sa4"admlist[sa4],1,30);
        
cache_get_field_content(0"adm1"admlist[adm1],1,30);
        
cache_get_field_content(0"adm2"admlist[adm2],1,30);
        
cache_get_field_content(0"adm3"admlist[adm3],1,30);
        
cache_get_field_content(0"adm4"admlist[adm4],1,30);
        
cache_get_field_content(0"mod1"admlist[mod1],1,30);
        
cache_get_field_content(0"mod2"admlist[mod2],1,30);
        
cache_get_field_content(0"mod3"admlist[mod3],1,30);
        
cache_get_field_content(0"mod4"admlist[mod4],1,30);
        
cache_get_field_content(0"mod5"admlist[mod5],1,30);
        
cache_get_field_content(0"mod6"admlist[mod6],1,30);
        
cache_get_field_content(0"mod7"admlist[mod7],1,30);
        
cache_get_field_content(0"mod8"admlist[mod8],1,30);
        
cache_get_field_content(0"tutor1"admlist[tutor1],1,30);
        
cache_get_field_content(0"tutor2"admlist[tutor2],1,30);
        
cache_get_field_content(0"tutor3"admlist[tutor3],1,30);
        
cache_get_field_content(0"tutor4"admlist[tutor4],1,30);
        
cache_get_field_content(0"tutor5"admlist[tutor5],1,30);
        
cache_get_field_content(0"tutor6"admlist[tutor6],1,30);
        
cache_get_field_content(0"tutor7"admlist[tutor7],1,30);
        
cache_get_field_content(0"tutor8"admlist[tutor8],1,30);
    }

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)