Salut a tous :lmao
Je suis actuellement entrain de crée un [Fs]Race mon soucis c'est que je ne c'est absolument pas comment utiliser les donner enregistrer dans mon fichier pour mes checkpoint
Exemple je tape ma commande qui save Position X Y Z
est je voudrais que cette position ce load sur cette fonction
SetPlayerRaceCheckpoint(playerid,2, ici X, ici Y, ici Z, x+5, y+5, z, 5);
Merci d'avance a tous de m'aider a trouver la fonction adéquate
quelque bout de code pour voir ce que j'ai commencer
{
{
new string[128];
new Float:X, Float:Z, Float:Y, Float:Rotation; // Floats to save the pos in
if (strcmp(cmdtext, "/test", true)==0)
{
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, Rotation);
new File:pos=fopen("positions.txt", io_append);
format(string, 256, "X = %f\r\nY = %f\r\nZ = %f\r\n", X, Y, Z);
fwrite(pos, string);
fclose(pos);
return 1;
}
}
if (strcmp(cmdtext, "/te", true)==0)
{
new string[128]; // Create the string to store the read text in
new File:example = fopen("positions.txt", io_read); // Open the file
fread(example, string);
fclose(example);
//SetPlayerRaceCheckpoint(playerid,2, %s, %s, %s, x+5, y+5, z, 5);
printf("%s",string); // Print what was read
return 1;
}
return 0;
}
A bientôt ! :cheers