• 05 Juin 2026, 09:08:26


Auteur Sujet: [Aide]le dernier CP race ne s'affiche pas  (Lu 985 fois)

0 Membres et 1 Invité sur ce sujet

Hors ligne cristab

  • *
  • Messages: 8379
    • Voir le profil
[Aide]le dernier CP race ne s'affiche pas
« le: 26 Décembre 2010, 15:25:52 »
Bonjour a tous je reprend petit a petit le script je fait un systeme de race qui permetras de gagner des points pour un TDM mais il y a une chose que je ne comprend pas apparement tout les CP de se mettent pas en jeux

Voici le log avec mes test

Citer
[15:05:25] CP 0 :-2003.019897 | -2431.226562 | 30.344200| type 0=normal 1=finish 0
[15:05:28] CP 1 :-1800.651489 | -2321.197753 | 39.959400| type 0=normal 1=finish 0
[15:05:37] CP 2 :-1686.802612 | -2247.027343 | 38.141300| type 0=normal 1=finish 0
[15:05:41] CP 3 :-1506.287719 | -2153.354736 | 2.394999| type 0=normal 1=finish 0
[15:05:58] CP 4 :-1322.198364 | -2184.623535 | 21.800899| type 0=normal 1=finish 0
[15:06:03] CP 5 :-1138.402709 | -2372.062988 | 27.723800| type 0=normal 1=finish 0
[15:06:10] CP 6 :-1000.233398 | -2370.887695 | 64.393501| type 0=normal 1=finish 0
[15:06:15] CP 7 :-934.641723 | -2369.842773 | 58.486698| type 0=normal 1=finish 0
[15:06:18] CP 8 :-795.934082 | -2462.212646 | 76.264801| type 0=normal 1=finish 0
[15:06:23] CP 9 :-704.235412 | -2354.390136 | 40.645999| type 0=normal 1=finish 0
[15:06:29] CP 10 :-512.505187 | -2287.524658 | 32.943599| type 0=normal 1=finish 0
[15:06:35] CP 11 :-285.537200 | -2150.860839 | 28.268299| type 0=normal 1=finish 0
[15:06:46] CP 12 :-259.795104 | -2180.193847 | 28.734199| type 0=normal 1=finish 0
[15:06:50] CP 13 :-348.353302 | -2252.634765 | 41.209499| type 0=normal 1=finish 0
[15:07:04] CP 14 :-661.382812 | -2479.819335 | 34.514900| type 0=normal 1=finish 0
[15:07:16] CP 15 :-743.366821 | -2659.609375 | 84.067298| type 0=normal 1=finish 0
[15:07:21] CP 16 :-993.934814 | -2680.763427 | 58.437198| type 0=normal 1=finish 0
[15:07:30] CP 17 :-1181.124389 | -2639.473876 | 11.477700| type 0=normal 1=finish 0
[15:07:46] CP 18 :-1356.644653 | -2630.627441 | 23.312400| type 0=normal 1=finish 0
[15:07:55] CP 19 :-1808.692993 | -2392.504150 | 26.218200| type 0=normal 1=finish 0
[15:08:20] CP 20 :-1934.752807 | -2131.661865 | 74.675498| type 0=normal 1=finish 0
[15:08:35] CP 21 :-1810.193481 | -1907.126831 | 88.848701| type 0=normal 1=finish 0
[15:08:44] CP 22 :-1545.136840 | -1891.458496 | 78.997703| type 0=normal 1=finish 0
[15:08:52] CP 23 :-1437.880004 | -1851.226074 | 39.457801| type 0=normal 1=finish 0
[15:09:03] CP 24 :-1433.928588 | -1966.716674 | 19.059700| type 0=normal 1=finish 0
[15:09:09] CP 25 :-1411.151977 | -2034.167114 | 0.813799| type 0=normal 1=finish 0
[15:09:10] CP 26 :-1274.705688 | -2276.604980 | 24.763799| type 0=normal 1=finish 0
[15:09:35] CP 27 :-1212.868896 | -2340.814697 | 17.079500| type 0=normal 1=finish 0
[15:09:38] CP 28 :-999.274780 | -2370.469726 | 64.460998| type 0=normal 1=finish 0
[15:09:45] CP 29 :-758.139526 | -2491.770751 | 77.562599| type 0=normal 1=finish 0
[15:09:55] CP 30 :-700.784973 | -2588.259033 | 64.606796| type 0=normal 1=finish 0
[15:10:06] CP 31 :-779.631286 | -2760.464355 | 75.604202| type 0=normal 1=finish 0
[15:10:14] CP 32 :-182.144805 | -2713.271484 | 35.477001| type 0=normal 1=finish 0
[15:12:03] CP 33 :-161.729400 | -2462.132568 | 30.849599| type 0=normal 1=finish 0

Voila mon enumerateur

new Float:CheckPoints[MAX_CP][3] ={
{-2003.0199,-2431.2266,30.3442},// premier CP
{-1800.6515,-2321.1978,39.9594},
{-1686.8026,-2247.0273,38.1413},
{-1506.2877,-2153.3547,2.3950},
{-1322.1984,-2184.6235,21.8009},
{-1138.4027,-2372.0630,27.7238},
{-1000.2334,-2370.8877,64.3935},
{-934.6417,-2369.8428,58.4867},
{-795.9341,-2462.2126,76.2648},
{-704.2354,-2354.3901,40.6460},
{-512.5052,-2287.5247,32.9436},
{-285.5372,-2150.8608,28.2683},
{-259.7951,-2180.1938,28.7342},
{-348.3533,-2252.6348,41.2095},
{-661.3828,-2479.8193,34.5149},
{-743.3668,-2659.6094,84.0673},
{-993.9348,-2680.7634,58.4372},
{-1181.1244,-2639.4739,11.4777},
{-1356.6447,-2630.6274,23.3124},
{-1808.6930,-2392.5042,26.2182},
{-1934.7528,-2131.6619,74.6755},
{-1810.1935,-1907.1268,88.8487},
{-1545.1368,-1891.4585,78.9977},
{-1437.8800,-1851.2261,39.4578},
{-1433.9286,-1966.7167,19.0597},
{-1411.1520,-2034.1671,0.8138},
{-1274.7057,-2276.6050,24.7638},
{-1212.8689,-2340.8147,17.0795},
{-999.2748,-2370.4697,64.4610},
{-758.1395,-2491.7708,77.5626},
{-700.7850,-2588.2590,64.6068},
{-779.6313,-2760.4644,75.6042},
{-182.1448,-2713.2715,35.4770},
{-161.7294,-2462.1326,30.8496},
{-341.4674,-1947.4390,25.1575}
};

la define MAX_CP

#define MAX_CP 35
ma fonction pour les CP

stock creatCP(playerid,type,val)
{
  
    if(type == Finish)
    {
        SetPlayerRaceCheckpoint(playerid,type,CheckPoints[val][0],CheckPoints[val][1],CheckPoints[val][2],0.0,0.0,0.0,TAILLE_CP);
    }
    else
    {
     SetPlayerRaceCheckpoint(playerid,type,CheckPoints[val][0],CheckPoints[val][1],CheckPoints[val][2],CheckPoints[val+1][0],CheckPoints[val+1][1],CheckPoints[val+1][2],TAILLE_CP);
    
    }
printf("CP %d :%f | %f | %f| type 0=normal 1=finish %d",val,CheckPoints[val][0],CheckPoints[val][1],CheckPoints[val][2],type);
}

les defines necessaire au reste du code et a la fonction de creation de CP
#define Normal 0
#define Finish 1
#define VOITURE 522
#define TAILLE_CP 5
#define Form(%0,%1) format(string,sizeof(string),%0,%1)
#define NULL -1

et la callback
public OnPlayerEnterRaceCheckpoint(playerid)
{

if(PCP[playerid]!=NULL)
{
   PCP[playerid]++;
   creatCP(playerid,Normal,PCP[playerid]);
   if(PCP[playerid] == MAX_CP-2)
   {
       creatCP(playerid,Finish,PCP[playerid]);
   }
   if(PCP[playerid] == MAX_CP-1)
   {
        DisablePlayerRaceCheckpoint(playerid);
DestroyVehicle(VoitureCreer[playerid]);
VoitureCreer[playerid]=NULL;
   }
}
Form("PCP[playerid] = %d",PCP[playerid]);
SendClientMessage(playerid,0xFF0000FF,string);
return 1;
}

Voila avec tout ceci le dernier CP ne se creer jamais IG :/
« Modifié: 26 Décembre 2010, 15:27:28 par cristab »
pas d'aide en PM, vous êtes sur un forum est il me semble que vous êtes la pour avoir de l'aide donc pourquoi MP une seul personne qui ne vous répondra pas alors qu'il y a plein de membre ici

Hors ligne cristab

  • *
  • Messages: 8379
    • Voir le profil
Re : [Aide]le dernier CP race ne s'affiche pas
« Réponse #1 le: 29 Décembre 2010, 13:25:27 »
desoler de up mais je me bute la dessus groumf
pas d'aide en PM, vous êtes sur un forum est il me semble que vous êtes la pour avoir de l'aide donc pourquoi MP une seul personne qui ne vous répondra pas alors qu'il y a plein de membre ici