Coords infront of a player
#1

I've looked, so don't say "USE THE SEARCH FUNCTION", what I've found is stuff which isn't explained enough. If someone can explain how I can get the coords INFRONT of a player?
Reply
#2

Код:
stock GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
	// Created by ******

	new Float:a;

	GetPlayerPos(playerid, x, y, a);
	GetPlayerFacingAngle(playerid, a);

	if (GetPlayerVehicleID(playerid)) {
	    GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
	}

	x += (distance * floatsin(-a, degrees));
	y += (distance * floatcos(-a, degrees));
}
Reply
#3

CreateVehicle(vID,x + 2*floatcos(90+a, degrees), y+ 2*floatsin(90-a, degrees), z, col1, col2, 0);

number of arguments does not match definition, what am I missing? Can't seem to find it.
Reply
#4

https://sampwiki.blast.hk/wiki/CreateVehicle

Youre missing the angle.
Reply
#5

add 2 to x, if its wrong say me, but I did it this way.
Reply
#6

Stupid me. Thanks fellers.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)