View Single Post
Old 02-22-2009   #2
RIPpo
Professional Dumbass
 
RIPpo's Avatar
 
Join Date: Aug 2003
Location: Los Angeles
Posts: 6,990
RIPpo is a God.RIPpo is a God.RIPpo is a God.RIPpo is a God.RIPpo is a God.RIPpo is a God.RIPpo is a God.RIPpo is a God.RIPpo is a God.RIPpo is a God.RIPpo is a God.
There seems to be a problem with the GET_BLIP_COORDS function in the script hooks available. I tried making this mod as well, but the messed up function didn't allow me to. Here's the code I used, maybe you can figure something out (it's C++):

this code was used to figure out what all of the blip info ID's were. 8 = waypoint

Code:
void CustomFiberThread::RunScript() {
	while(IsThreadAlive()) {
		if(!firstRun) {
			niko = GetPlayerPed();
			nikoIndex = GetPlayer();
			firstRun = true;
		}

		if((GetAsyncKeyState(VK_F9) && 1) != 0) {
			for(u32 i = 0; i <= 1000; i++) {
				waypoint = GetFirstBlipInfoId(i);
				while(DoesBlipExist(waypoint)) {
					waypointCoords = BlipCoords(waypoint);
					//GetBlipCoords(waypoint, &waypointCoords);
					
					char buffer[1024];
					sprintf_s(buffer, "Info ID (%d) - %s: %f %f %f", i, GetBlipName(waypoint), waypointCoords.X, waypointCoords.Y, waypointCoords.Z);
					LogInfo(buffer);

					SetCharCoordinates(niko, waypointCoords.X, waypointCoords.Y, waypointCoords.Z);
					waypoint = GetNextBlipInfoId(i);
					//break;
				}
			}
		}

		Wait(100);
	}
}

Vector3 CustomFiberThread::BlipCoords(Blip b) {
	f32 x, y, z;
	Vector3 coords;
	Vehicle v;
	Ped p;
	Object o;
	Pickup pi;

	eBlipType blipType = GetBlipInfoIdType(b);
	
	switch(blipType) {
		case BLIP_TYPE_CAR:
			v = GetBlipInfoIdCarIndex(b);
			GetCarCoordinates(v, &x, &y, &z);
		break;

		case BLIP_TYPE_CHAR:
			p = GetBlipInfoIdPedIndex(b);
			GetCharCoordinates(p, &x, &y, &z);
		break;

		case BLIP_TYPE_OBJECT:
			o = GetBlipInfoIdObjectIndex(b);
			GetObjectCoordinates(o, &x, &y, &z);
		break;

		case BLIP_TYPE_PICKUP:
			pi = GetBlipInfoIdPickupIndex(b);
			GetPickupCoordinates(pi, &x, &y, &z);
		break;

		case BLIP_TYPE_COORD:
		default:
			GetBlipCoords(b, &coords);
		break;
	}

	if(coords.X == 0) {
		coords.X = x;
		coords.Y = y;
		coords.Z = z;
	}

	return coords;
}
__________________
RIPpo is offline   Reply With Quote