Help with Dynamic Pickups and OnPlayerPickUpDynamicPickup
#4

Quote:
Originally Posted by dionisak0s
Посмотреть сообщение
So it could be pickupid == DoorInfo[x][dPickup], it worked this way but there's a little problem, when you exit it teleports you back, is there any way to prevent such a thing? I was thinking to add something like +2 to a certain position but that may bug the player in certain places so I would like to avoid that.
Teleports you back? Do you immediately set the player's position once the pickup has been picked up? If so you could try getting XY infront of the pickup (GetXYInfrontOfPlayer while making the pickup) And set the exit position to the position infront of the pickup.

Код:
GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{
	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


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)