09.04.2017, 00:00
isso ae й o codigo do gps a mostrar a distancia em metros e aparece a seta em cima do carro qual quer seja a localizaзгo definida
Code :
#if defined FGPSUser
if(GetPVarInt(playerid, "YEAH") == 1 && IsPlayerInAnyVehicle(playerid))
{
new Float:VPos[3], Float:Rotation, TDString[128];
GetVehiclePos(GetPlayerVehicleID(playerid), VPos[0], VPos[1], VPos[2]);
Rotation = PointAngle(playerid, VPos[0], VPos[1], GetPVarFloat(playerid, "Spongebob"), GetPVarFloat(playerid, "Mario"));
AttachDynamicObjectToVehicle(PlayerInfo[playerid][FGPSObject], GetPlayerVehicleID(playerid), 0.0, 0.0, 1.5, 0.0, 90.0, Rotation);
#if defined UseTd
if(PlayerInfo[playerid][F_GPSTD] != PlayerText:INVALID_TEXT_DRAW)
{
format(TDString, sizeof(TDString), "Distancia: %.1f Metros", GetDistanceBetweenPoints(VPos[0], VPos[1], VPos[2], GetPVarFloat(playerid, "Spongebob"), GetPVarFloat(playerid, "Mario"), GetPVarFloat(playerid, "SpiderPig")));
PlayerTextDrawSetString(playerid, PlayerInfo[playerid][F_GPSTD], TDString);
}
#endif
}
#endif
Code :
#if defined FGPSUser
if(GetPVarInt(playerid, "YEAH") == 1 && IsPlayerInAnyVehicle(playerid))
{
new Float:VPos[3], Float:Rotation, TDString[128];
GetVehiclePos(GetPlayerVehicleID(playerid), VPos[0], VPos[1], VPos[2]);
Rotation = PointAngle(playerid, VPos[0], VPos[1], GetPVarFloat(playerid, "Spongebob"), GetPVarFloat(playerid, "Mario"));
AttachDynamicObjectToVehicle(PlayerInfo[playerid][FGPSObject], GetPlayerVehicleID(playerid), 0.0, 0.0, 1.5, 0.0, 90.0, Rotation);
#if defined UseTd
if(PlayerInfo[playerid][F_GPSTD] != PlayerText:INVALID_TEXT_DRAW)
{
format(TDString, sizeof(TDString), "Distancia: %.1f Metros", GetDistanceBetweenPoints(VPos[0], VPos[1], VPos[2], GetPVarFloat(playerid, "Spongebob"), GetPVarFloat(playerid, "Mario"), GetPVarFloat(playerid, "SpiderPig")));
PlayerTextDrawSetString(playerid, PlayerInfo[playerid][F_GPSTD], TDString);
}
#endif
}
#endif