10.01.2016, 15:20
idk if you're stupid ors, but what the hell are you scripting.
PHP код:
enum groupData
{
gID,
gName[30],
gType,
gRank1[30],
gRank2[30],
gRank3[30],
gRank4[30],
gRank5[30],
gRank6[30],
gRank7[30],
gSlots
}
new gInfo[MAX_FACTIONS][groupData];
public OnGameModeInit(){
mysql_tquery(mysql,"SELECT * FROM groups","LoadGroups","");
return 1;
}
forward LoadGroups();
public LoadGroups(){
new rows=cache_num_rows();
if(!rows)return print("No groups added!");
for(new i; i < rows; i++){ //uses this 'cache_get_field_content' for strings and this 'cache_get_field_content_int' for numbers
gInfo[i][gID] = cache_get_field_content_int(i, "ID");
cache_get_field_content(i,"groupName",gInfo[i][gName],mysql,30);
gInfo[i][gType] = cache_get_field_content_int(i, "groupType");
gInfo[i][gSlots] = cache_get_field_content_int(i, "groupSlots");
cache_get_field_content(i,"groupRank1",gInfo[i][gRank1],mysql,30);
cache_get_field_content(i,"groupRank2",gInfo[i][gRank2],mysql,30);
cache_get_field_content(i,"groupRank3",gInfo[i][gRank3],mysql,30);
cache_get_field_content(i,"groupRank4",gInfo[i][gRank4],mysql,30);
cache_get_field_content(i,"groupRank5",gInfo[i][gRank5],mysql,30);
cache_get_field_content(i,"groupRank6",gInfo[i][gRank6],mysql,30);
cache_get_field_content(i,"groupRank7",gInfo[i][gRank7],mysql,30);
}
printf("%d groups loaded.",rows);
return 1;
}