3D Text Label on top of CP
#1

Ok,so what im trying to do here is to add a 3D Text Label that will appear on every organization checkpoint added.It should load organization name from dir_orgfiles and automatically put on top of every org cp.Take a look.

Part from the code:
Код:
temp1 = dini_Int(AddDirFile(dir_orgfiles, FILE_OSTATS), "max_org");
	temp2 = sizeof(zonenames);
	for (new orgp = 1; orgp <= temp1; orgp++) {
		format(string, 10, "org%d", orgp);
		if (dini_Exists(AddDirFile(dir_orgfiles, string)))
		{
		    new cstr[256], cstr2[256], cstr3[256], cstr4[256];
		    for(new ip = 0; ip<3; ip++)
		    {
				format(cstr, sizeof(cstr), "p%d_model", ip);
				temp3 = dini_Int(AddDirFile(dir_orgfiles, string), cstr);
				if (temp3 != 0)
				{
				    format(cstr, sizeof(cstr), "p%d_x", ip);
				    format(cstr2, sizeof(cstr2), "p%d_y", ip);
				    format(cstr3, sizeof(cstr3), "p%d_z", ip);
				    format(cstr4, sizeof(cstr4), "p%d_w", ip);
					opickup[orgp-1][ip-1] = CreatePickup(temp3, 2, dini_Float(AddDirFile(dir_orgfiles, string), cstr), dini_Float(AddDirFile(dir_orgfiles, string), cstr2), dini_Float(AddDirFile(dir_orgfiles, string), cstr3), dini_Int(AddDirFile(dir_orgfiles, string), cstr4));
				}
			}
			new str[256], ctr[256];
			format(str, sizeof(str), "%s", dini_Int(AddDirFile(dir_orgfiles, string), "name"));
			format(ctr, sizeof(ctr), "0x%sFF", dini_Int(AddDirFile(dir_orgfiles, string), "color"));
   			ocheckp[orgp-1] = CreateDynamicCP(dini_Float(AddDirFile(dir_orgfiles, string), "ocp_x"), dini_Float(AddDirFile(dir_orgfiles, string), "ocp_y"), dini_Float(AddDirFile(dir_orgfiles, string), "ocp_z"), 1.1, dini_Int(AddDirFile(dir_orgfiles, string), "ocp_w"), -1, -1, 50.0);
			olabel[orgp-1] = CreateDynamic3DTextLabel(str, COLOR_RED, dini_Float(AddDirFile(dir_orgfiles, string), "ocp_x"), dini_Float(AddDirFile(dir_orgfiles, string), "ocp_y"), dini_Float(AddDirFile(dir_orgfiles, string), "ocp_z")+5.0, 1.1, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, dini_Int(AddDirFile(dir_orgfiles, string), "ocp_w"), -1, -1, -1, 50.0);
			Create3DTextLabel(str, COLOR_RED, dini_Float(AddDirFile(dir_orgfiles, string), "name"), dini_Float(AddDirFile(dir_orgfiles, string), "name"), dini_Float(AddDirFile(dir_orgfiles, string), "name")+5.0, 1.1, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, dini_Int(AddDirFile(dir_orgfiles, string), "name"), -1, -1, -1, 50.0);
			cptype[ocheckp[orgp-1]][0] = CP_TYPE_ORG;
			cptype[ocheckp[orgp-1]][1] = orgp;
			orgcata[orgp-1] = dini_Int(AddDirFile(dir_orgfiles, string), "catag");
			temp5 = 0;
			for (new u = 0; u < MAX_GANG_TURFS; u++) {
				format(tmp, 12, "zone%d", u+1);
				if (dini_Isset(AddDirFile(dir_orgfiles, string), tmp)) {
					temp3 = dini_Int(AddDirFile(dir_orgfiles, string), tmp);
					for (new h = 0; h < temp2; h++) {
						if (strcmp(zonenames[h][z_name], zonenames[temp3][z_name], true) == 0) {
							temp4 = GangZoneCreate(zonenames[h][z_minx], zonenames[h][z_miny], zonenames[h][z_maxx], zonenames[h][z_maxy]);
							gangzon[temp4] = temp3;
							ozoneids[orgp-1][temp5] = 1;
						}
					}
				}
				temp5 ++;
			}
		}
	}
Reply
#2

Код:
format(str, sizeof(str), "%s", dini_Int(AddDirFile(dir_orgfiles, string), "name"));
You are taking an integer from the file while what you are looking for is dini_Get as it get's the string,
Try changing dini_Int to dini_Get
Reply
#3

Quote:
Originally Posted by Ghost47
Посмотреть сообщение
Код:
format(str, sizeof(str), "%s", dini_Int(AddDirFile(dir_orgfiles, string), "name"));
You are taking an integer from the file while what you are looking for is dini_Get as it get's the string,
Try changing dini_Int to dini_Get
Still the same
Reply
#4

Have you tried it this way ?

Код:
new Float:X = dini_Float(AddDirFile(dir_orgfiles, string), "name");

Others too then

Create3DTextLabel(str, COLOR_RED, X , y ,z etc..)
not sure if that will do or not.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)