20.07.2018, 20:34
PHP код:
cmd:puxarveh(playerid, params[]) {
new target;
if(sscanf(params, "d", target)) return SendClientMessage(playerid,-1,"/puxarveh <vehicleid>");
new Float:x, Float:y, Float:z;
GetXYInFrontOfPlayer(playerid, x, y, z, 3);
SetVehiclePos(target, x, y, z);
return 1;
}
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));
}