GetRearOfVehicle
#1

Hey, i can't find this function anywhere. Maybe someone has it?
Reply
#2

Ive never heard of it... - What is it supposed to do??
Reply
#3

Well, i know that it's isn't exists, i don't know what is such a function name, but this one, i guess is explaining self by the name.
Reply
#4

I want to get rear of the vehicle to attach 3D text label to a number plate position.
Reply
#5

You see, not all cars are the same of their lenghts, so, offset's needs to be difference. I didn't ask you to give me a function, which gets X,Y,Z of plate, i JUST need to get rear of vehicle, and that's all. Once time i have already found that, but now didn't remember.
Reply
#6

Can't you just use GetVehiclePos?
Reply
#7

Quote:
Originally Posted by funky1234
Посмотреть сообщение
Can't you just use GetVehiclePos?
Then i get center of vehicle.
Reply
#8

Quote:
Originally Posted by cepiokas
Посмотреть сообщение
Then i get center of vehicle.
then you can experiment with it and then get the rear
Reply
#9

God damn, guys, i have asked you a function, why i need now to test, spend hours to get right function, wouldn't be easier to post a function, of course, if you have it, you will save me from a stupid work. Is it so hard?
Reply
#10

Yes it is so hard, because we dont have it and probably dont want it. + If you want help, dont come on thinking everyone will help you, because they wont if you talk like that to them.

Just get an average from vehicle legnths and use that? Is that so hard?
Reply
#11

for me personally, it would take less than 10 mins to make the function with experimenting with attachobjecttovehicle function! or you're lazy or you don't know how to script?

Код:
CMD:attachtovehicle(playerid, params[])
{
	new modelID, Float:offset[3], Float:rot[3];
	if(sscanf(params, "dF(0)F(0)F(0)F(0)F(0)F(0)", modelID, offset[0], offset[1], offset[2], rot[0], rot[1], rot[2]))
		return SendClientMessage(playerid, COLOR_GREY, "{FF0000}ERROR: {C1BEC0}Bad parameters!");
	
	if(GetPVarType(playerid, "playerVehicleAttachObject") == PLAYER_VARTYPE_INT)
	{
		DestroyObject(GetPVarInt(playerid, "playerVehicleAttachObject"));
	}
	new objectID = CreateObject(modelID, 0, 0, 0, 0, 0, 0);
	SetPVarInt(playerid, "playerVehicleAttachObject", objectID);
	AttachObjectToVehicle(objectID, GetPlayerVehicleID(playerid), offset[0], offset[1], offset[2], rot[0], rot[1], rot[2]);
	return true;
}
credits to andre
Reply
#12

You need to get the vehicleid of the vehicle, then use this code.
Код:
new Float:x, Float:y, Float:z, Float:a, Float:x2, Float:y2;
GetVehiclePos(vehicleid, x, y, z);
GetVehicleZAngle(vehicleid, a);
x2 = x + (-6 * floatsin(-a, degrees));
y2 = y + (-6 * floatcos(-a, degrees));
SetPlayerCheckpoint(playerid, x2, y2, z, 1.5);
Clear to understand, this will place a checkpoint at the back of the vehicle.

I think the floatsin and floatcos part of the code is by Y-Less.
Reply
#13

Alright, thank you all.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)