• 04 Juin 2026, 20:16:29


Auteur Sujet: Question ???  (Lu 3555 fois)

0 Membres et 1 Invité sur ce sujet

Hors ligne ghm94

  • *
  • Grand Banditisme
  • Messages: 886
    • Voir le profil
Re : Question ???
« Réponse #30 le: 10 Octobre 2009, 11:29:50 »
Alors en haut de ton script tu met sa :
forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
Ensuite un peu plus bas ou tous en bas :

public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
{
    if(IsPlayerConnected(playerid))
{
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);
//printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
{
return 1;
}
}
return 0;
}

Hors ligne S!m

  • *
  • Messages: 2341
    • Voir le profil
Re : Question ???
« Réponse #31 le: 10 Octobre 2009, 17:30:51 »
Salut,

si tu utilise un checkpoint, tu devrais utiliser la fonction PlayerToPoint dans la callback OnPlayerEnterCheckpoint/OnPlayerEnterRaceCheckpoint et à ce moment faire le moveobject permettant de monter la barrière (ps. ne pas oublier de lancer le timer afin de rabaisser la barrière par la suite)

++Sim++