[Problem] OnUnoccupiedVehicleUpdate
#1

This is fixed.
Quote:

Why this callback isn't called, when there's no players around and one player pushes cars? In previous version this worked well, but now it's called when there is some players.
Also when player push car away from car old position, this isn't sent to server and when you get vehicle position server-side, it isn't changed. Look at video below.

Code:
Code:
public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z)
{
	static Float:x, Float:y, Float:z, str[32];
	GetVehiclePos(vehicleid, x, y, z);
	SendClientMessage(playerid, -1, "Veh update");
	if(VectorSize(x-new_x, y-new_y,z-new_z) > 1.0)
	{
	    format(str, 32, "Unocc: veh %d return 0", vehicleid); 
	    SendClientMessage(playerid, -1, str);
		return 0;
	}
	return 1;
}
Video:
http://www.youtube.com/watch?v=4C8trLQXplw
UPDATED
I think this callback isn't woking well, sometimes it's going to update position (checked with getvehiclepos) when it's actually returning 0 in script.
Please, look at video and code:

[ame]http://www.youtube.com/watch?v=xr_PHQN0f9Q[/ame]

CODE:
Code:
public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z)
{
	static Float:x, Float:y, Float:z;
	GetVehiclePos(vehicleid, x, y, z);
	if(VectorSize(x-new_x, y-new_y,z-new_z) > 0.4)
	{
		SetVehicleToRespawn(vehicleid);
		return 0;
	}
	return 1;
}
Vehicle isn't respawned when cheater with CLEO (fck this..) throws it in others cars and veh get stucked.

To dev team - please see also this suggestion (http://forum.sa-mp.com/showpost.php?...postcount=1315)
Reply
#2

There is a bug in the new call back and has officially been acknowledged by dugi with a patch is on the way.
Reply
#3

Update to RC5-2 client.
Reply
#4

Thread updated, please read new issue.
Reply
#5

Why would you use SetVehicleToRespawn with returning 0?

I guess you should return 1 after SetVehicleToRespawn to apply the update + SetVehicleToRespawn
Reply
#6

I don't want to update position when cheater teleport car.
Reply
#7

You see the vehicles, that you have teleportet, but if you go away that the vehicle is streaming out an in. The vehicle is at the old pos, because it is not synced on return 0.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)