[Ajuda] Cordenadas
#6

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
Reply


Messages In This Thread
Cordenadas - by Mr.Hardy - 15.08.2012, 19:17
Re: Cordenadas - by paulor - 15.08.2012, 19:26
Respuesta: Cordenadas - by Digao - 15.08.2012, 19:28
Re: Cordenadas - by Mr.Hardy - 15.08.2012, 19:31
Re: Cordenadas - by .FuneraL. - 15.08.2012, 19:32
Re: Cordenadas - by Mr.Hardy - 15.08.2012, 19:34

Forum Jump:


Users browsing this thread: 4 Guest(s)