Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public LoadLabels()
- {
- new Query[98], DBResult:Result;
- format(Query, sizeof(Query), "SELECT * FROM `LABELS`");
- Result = db_query(loads, Query);
- if(db_num_rows(Result))
- {
- for(new i=0; i<MAX_LABELS; i++) {
- new text[50], color[24], xposit[24], yposit[24], zposit[24];
- db_get_field_assoc(Result, "TEXT", text, sizeof(text)); format(Labels[i][Text],sizeof Labels[i][Text],"%s",text);
- db_get_field_assoc(Result, "COLOR", color, sizeof(color)); Labels[i][Color] = strval(color);
- db_get_field_assoc(Result, "X", xposit, sizeof(xposit)); Labels[i][POSX] = floatstr(xposit);
- db_get_field_assoc(Result, "Y", yposit, sizeof(yposit)); Labels[i][POSY] = floatstr(yposit);
- db_get_field_assoc(Result, "Z", zposit, sizeof(zposit)); Labels[i][POSZ] = floatstr(zposit);
- labelcount++;
- Labels[i][Label] = CreateDynamic3DTextLabel(Labels[i][Text], Labels[i][Color], Labels[i][POSX], Labels[i][POSY], Labels[i][POSZ]+1.5, 5.0);
- db_next_row(Result);
- }
- db_free_result(Result);
- } else return print("No labels");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement