E eu quero saber a cordenada do meu lado. Porque estou criando um sistema de race checkpoint e eu quero organizar os veiculos automaticamente б partir de uma cordenada entenderam?
kk. Eu tinha analizados alguns releases de race e vi esse sistema. Mais nгo entendi a lуgica e preferi perguntar para os Brasileiros pois aqueles releases eram muito complicados de entender e acolplar.
pawn Код:
stock GetXYInFrontOfPlayer(playerid,Float:Distance,&Float:X,&Float:Y)
{
new Float:POS[3];
GetPlayerPos(playerid,POS[0],POS[1],POS[2]);
if(!IsPlayerInAnyVehicle(playerid)) GetPlayerFacingAngle(playerid,POS[2]);
else GetVehicleZAngle(GetPlayerVehicleID(playerid),POS[2]);
X += floatmul(Distance,floatsin(-(floatabs(POS[2])),degrees));
Y += floatmul(Distance,floatcos(-(floatabs(POS[2])),degrees));
return 1;
}
stock GetXYInRearOfPlayer(playerid,Float:Distance,&Float:X,&Float:Y)
{
new Float:POS[3];
GetPlayerPos(playerid,POS[0],POS[1],POS[2]);
if(!IsPlayerInAnyVehicle(playerid)) GetPlayerFacingAngle(playerid,POS[2]);
else GetVehicleZAngle(GetPlayerVehicleID(playerid),POS[2]);
X -= floatmul(Distance,floatsin(-(floatabs(POS[2])),degrees));
Y -= floatmul(Distance,floatcos(-(floatabs(POS[2])),degrees));
return 1;
}
stock GetXYInLeftOfPlayer(playerid,Float:Distance,Float:offset,&Float:X,&Float:Y)
{
new Float:POS[3];
GetPlayerPos(playerid,POS[0],POS[1],POS[2]);
if(!IsPlayerInAnyVehicle(playerid)) GetPlayerFacingAngle(playerid,POS[2]);
else GetVehicleZAngle(GetPlayerVehicleID(playerid),POS[2]);
POS[2] -= offset;
X += floatmul(Distance,floatsin(-(floatabs(POS[2])),degrees));
Y += floatmul(Distance,floatcos(-(floatabs(POS[2])),degrees));
return 1;
}
stock GetXYInRightOfPlayer(playerid,Float:Distance,Float:offset,&Float:X,&Float:Y)
{
new Float:POS[3];
GetPlayerPos(playerid,POS[0],POS[1],POS[2]);
if(!IsPlayerInAnyVehicle(playerid)) GetPlayerFacingAngle(playerid,POS[2]);
else GetVehicleZAngle(GetPlayerVehicleID(playerid),POS[2]);
POS[2] -= offset;
X -= floatmul(Distance,floatsin(-(floatabs(POS[2])),degrees));
Y -= floatmul(Distance,floatcos(-(floatabs(POS[2])),degrees));
return 1;
}