SA-MP Forums Archive
Actor. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Actor. (/showthread.php?tid=665795)



Actor. - Hazon - 16.04.2019

Yo.

I'm making some shit with race so, let's say there are 6 cars for example below like this:

[1] [2]
[3] [4]
[5] [6]

How would I put the actor in the middle for example below (line in the middle).


[1] | [2]
[3] [4]
[5] [6]

Code:
RACE_createVehicle(playerid, RACE_rInfo[RACE_runningID][0][raceVehicleID], X, Y, Z, angle, RACE_rInfo[RACE_runningID][0][raceInterior], RACE_VIRTUALWORLD);

	X = RACE_rInfo[RACE_runningID][0][raceSpawnPositionX] + (distance * 1.5) * floatcos(angle, degrees);
	Y = RACE_rInfo[RACE_runningID][0][raceSpawnPositionY] + (distance * 1.5) * floatsin(angle, degrees);
	SetPlayerCameraLookAt(playerid, X, Y, Z);

	X = (RACE_rInfo[RACE_runningID][0][raceSpawnPositionX] + ((distance * 1.5) * floatcos(angle, degrees)) + (12 * floatsin(- angle, degrees)));
	Y = (RACE_rInfo[RACE_runningID][0][raceSpawnPositionY] + ((distance * 1.5) * floatsin(angle, degrees)) + (12 * floatcos(- angle, degrees)));
?


Re: Actor. - Gforcez - 16.04.2019

Change the spawn positions for option 2,4,6 and place the actor in between the cars?


Re: Actor. - khRamin78 - 17.04.2019

Just get X and Y of [1] and [2] vehicle and save it somewhere then do this>

PHP Code:
X[Actor] = (X[1] + X[2])/2
Y
[Actor] = (Y[1] + Y[2])/