14.03.2019, 08:28
This x+2 and y+2 will not work everytime.
That depends on, where you are look and standing.
The correct way, would to use it like this:
Besides, dont use static like that.
You dont need to reserve continous space...
Anyway the veh should sync better, if it touches the ground.
So set the z Axis a bit down, that should work.
But its a sync Problem...
That depends on, where you are look and standing.
The correct way, would to use it like this:
PHP Code:
CMD:getcar(playerid, params[]) {
new vid, Float:x, Float:y, Float:z, Float:a;
if(admin1) return EmTag(playerid, YOU_HAVE_NO_PERMISSION);
if(sscanf(params, "i", vid)) return UsageTag(playerid, "/getcar[ID]");
if(!IsValidVehicle(vid)) return EmTag(playerid, "The specified vehicle ID is invalid!");
GetPlayerPos(playerid, x, y, z), GetPlayerFacingAngle(playerid, a);
x += 2.0 * floatsin(-a + 90.0, degrees);
y += 2.0 * floatcos(-a + 90.0, degrees);
SetVehiclePos(vid, x,y,z-1.0);
return 1;
}
You dont need to reserve continous space...
Anyway the veh should sync better, if it touches the ground.
So set the z Axis a bit down, that should work.
But its a sync Problem...