Check if player is close to checkpoint, then show it
#1

Hi guys, ive made a checkpoint with SetPlayerCheckpoint. BUT, what i want, is that it only shows if the player is close to it. How can i do so? Like if hes close, THEN it will set the checkpoint (show it actually)

OR

How do i make the checkpoint invisible on the radar? (Not a red triangle/square marker or anything)

Thanks!
Reply
#2

pawn Код:
public OnFilterScriptInit() {
    SetTimer("CheckPlayers", 1000, true);
}

forward CheckPlayers();
public CheckPlayers() {
    for(new i=0; i<MAX_PLAYERS; i++) {
        if(IsPlayerConnected(i)) {
            if(PlayerToPoint(10, cehckpointX, cehckpointY, cehckpointZ) {
                SendClientMessage(playerid, 0xFFFF00AA, "Get into the checkpoint");
            }
        }
    }
}
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
  new Float:oldposx, Float:oldposy, Float:oldposz;
  new Float:tempposx, Float:tempposy, Float:tempposz;
  GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  tempposx = (oldposx -x);
  tempposy = (oldposy -y);
  tempposz = (oldposz -z);
  if(((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  {
    return 1;
  }
  return 0;
}
Reply
#3

Is there also a way to hide it from the radar?
Reply
#4

I think there is no way to do that... just checking positions.
Reply
#5

But i mean remove the red thingy from the radar?
Reply
#6

You can't show or hide a checkpoint and its radar icon separately in SA-MP.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)