Starting work at nearest checkpoint
#1

The autowork option in my gamemode is bugged at the moment and doesn't actually work. Instead i'm trying to set it up so when you type /w (work) to start a mission, it will start at the NEAREST checkpoint. Right now it is set to random. Below is the code, anybody know how to fix this? Thanks

Код:
else if(TypeFlight[playerid] == 4) // dodo
	{
	    StartedMission[playerid] = 1;
	    new rand = random(sizeof(DSLocations));
		new string2[65], message[128];
		SetPlayerFlightCheckpoint(playerid, DSLocations[rand][LocX],DSLocations[rand][LocY],DSLocations[rand][LocZ], 15.0);
		format(string2, sizeof(string2), "%s", DSLocations[rand][LocationName]); //PASSWORD
		strmid(FirstAPName[playerid], string2, 0, strlen(string2), 128); //PASSWORD
		//FirstAPName[playerid] = ALocations[rand][LocationName];
		//FirstAPName[playerid] = AndroDName;
		format(message,sizeof(message), "Head to {1B8AE4}%s {FFFFFF}and pick up the passenger.", DSLocations[rand][LocationName]);
		SendClientMessage(playerid, COLOR_WHITE, message);
		MissionStage[playerid] = 1;
		WantsRecording[playerid] = 1;
		Pos1[playerid] = DSLocations[rand][LocX];
		Pos2[playerid] = DSLocations[rand][LocY];
		Pos3[playerid] = DSLocations[rand][LocZ];
	}
Reply
#2

yea, i'm having the same problem but nobody ever replies to any serious questions. they're too busy responding to moronic insignificant posts!
Reply
#3

you can use GetPlayerDistanceFromPoint to get the nearest point.
Reply
#4

maybe replace [rand] with [playerid]
Reply
#5

Quote:
Originally Posted by dominik523
Посмотреть сообщение
you can use GetPlayerDistanceFromPoint to get the nearest point.
This didnt work.. thanks though
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)