15.08.2012, 19:34
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.
Crйditos: BJIADOKC
@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;
}