Quote:
Originally Posted by .FuneraL.
Faзa varios Saves, й o modo mais facil para ter coordenada
|
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.
@edit
Vou tentar usar isto.
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;
}
Crйditos: BJIADOKC