• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] Help with mysql and data retrieving.
#1
Information 
Hey guys, Im building a gamemode mostly for learning, but i got stuck in faction systems y was following a tutorial but was on an old version and im having struggle getting it done, if someone can explainme what im doing wrong here...



Code:
stock LoadFactions(/* arguments */)

{

new query[400];

for(new i = 0; i < MAX_FACTIONS; i)

{

mysql_tquery(query, "SELECT * FROM Factions WHERE ID = %d", i);

new rows, fields;

cache_get_data(rows, fields);

if(rows)

{

Total_Factions_Created;

cache_get_value_int(0,"id",Factions[i][ID]);

cache_get_value_name(0,"name",Factions[i][Name]);

cache_get_value_name(0,"type",Factions[i][Type]);

cache_get_value_name(0,"Rank1",Factions[i][Rank1]);

cache_get_value_name(0,"Rank2",Factions[i][Rank2]);

cache_get_value_name(0,"Rank3",Factions[i][Rank3]);

cache_get_value_name(0,"Rank1",Factions[i][Rank4]);

}

printf("se cargaron: %d facciones\n", Total_Factions_Created);

}

return 1;

}
  Reply


Messages In This Thread
Help with mysql and data retrieving. - by cronoxliker - 2020-11-02, 09:57 AM

Forum Jump: