GTAOnline.net
San Andreas Multiplayer (sa:mp) => Scripting SA-MP [Pawn center] => Discussion démarrée par: BuBuNo le 19 Septembre 2009, 01:13:45
-
Bonjour a tous,
Alors voila j'aimerai modifier un FS de course YRace pour avoir ce que je veut :
-Que quand on face /join on arrive devant le cheakpoint de départ et que les voiture sont aligner comme sur une grille de F1
-Que seul l'admin puisse lancer la course
J'ai essayer de modifier le FS mais je ne comprend rien il y a même pas de commande /ready
Donc voila merci d'avance de votre aide
-
Le script C30_gp fait dejà sa je pense ...
++
FS'
-
oui mais le probleme il n'as pas de recort dessus
EDIT : ou si quelqu'un connai la commande /bestrace qui peut aller sur C30_gp sa serai super CooL
Double post
HELP PLEAZE
EDIT 2 : ALors voila Sim ma dit de copier le code de Yrace et de mofier la premiere ligne donc voila ce que sa donne :
if (strcmp("/bestrace",playerid,cmdtext[9])
{
new tmp[64], idx;
tmp = strtok(cmdtext[9], idx);
if(LoadTimes(playerid,0,tmp)) return 1;
if(TopRacerTimes[0] == 0)
{
SendClientMessage(playerid,COLOR_YELLOW,"No hay resultados.");
return 1;
}
format(ystring,sizeof(ystring),"%s por %s - Mejores tiempos:",CRaceName,CBuilder);
SendClientMessage(playerid,COLOR_GREEN,ystring);
for(new i;i<5;i++)
{
if(TopRacerTimes[i] == 0)
{
format(ystring,sizeof(ystring),"%d. Aun no",i+1);
i=6;
}
else
{
format(ystring,sizeof(ystring),"%d. %s - %s",i+1,BeHuman(TopRacerTimes[i]),TopRacers[i]);
}
SendClientMessage(playerid,COLOR_GREEN,ystring);
}
return 1;
}Bon je sait j'ai du faire des erreurs mais j'arrive pas a mettre la main dessus donc voila quand je compile :
C:\DOCUME~1\BrunoLB\Bureau\C30_gp.pwn(607) : error 035: argument type mismatch (argument 2)
C:\DOCUME~1\BrunoLB\Bureau\C30_gp.pwn(611) : error 004: function "LoadTimes" is not implemented
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
2 Errors.
Donc voila merci d'avance de votre aide.
-
tu ne pourais fait une commande comme celle-si car il te faudrai /bestrace >n°de course < >type de course moto bateaux .....<
et donc modifier totalement ta fonction "LoadTimes" qui n'est pas présente ici
++
-
Bas voila la fonction LoadTimes : forward LoadTimes(playerid,timemode,tmp[]); // bestlap and bestrace-parameter race loader
Je l'ai mis entres les autre Forward mais sa ne change rien
-
Salut,
un forward n'est PAS une fonction, ce n'est pas la fonction, mais sa déclaration
bref, on annonce au compilateur que le script devrait contenir cette fonction (nécessaire pour les fonctions public)
++Sim++
-
cherche public LoadTimes mais sa ne seras pas magique il va falloir l'adapter
-
:D oué désolé sim mais je pense que tout le monde a compris :P
j'esayerais de fair sa se soir
++
-
cherche public LoadTimes mais sa ne seras pas magique il va falloir l'adapter
Bas je l'ai bien trouver dans YRAce mais pas dans C30_gp
Voila dans YRAce :
public LoadTimes(playerid,timemode,tmp[])
{
new temprace[67], idx;
format(temprace,sizeof(temprace),"%s.yr",tmp);
if(strlen(tmp))
{
if(!fexist(temprace))
{
format(ystring,sizeof(ystring),"Race \'%s\' doesn't exist!",tmp);
SendClientMessage(playerid,COLOR_YELLOW,ystring);
return 1;
}
else
{
new File:f, templine[256], TBuilder[MAX_PLAYER_NAME], TempLapper[MAX_PLAYER_NAME], TempLap;
idx=0;
f = fopen(temprace, io_read);
fread(f,templine,sizeof(templine)); // Read header-line
if(templine[0] == 'Y') //Checking if the racefile is v0.2+
{
new fileversion;
strtok(templine,idx); // read off YRACE
fileversion = strval(strtok(templine,idx)); // read off the file version
if(fileversion > RACEFILE_VERSION) // Check if the race is made with a newer version of the racefile format
{
format(ystring,sizeof(ystring),"Race \'%s\' is created with a newer version of YRACE, unable to load.",tmp);
SendClientMessage(playerid,COLOR_RED,ystring);
return 1;
}
TBuilder=strtok(templine,idx); // read off RACEBUILDER
fread(f,templine,sizeof(templine)); // read off best race times
if(timemode ==1) fread(f,templine,sizeof(templine)); // read off best lap times
idx=0;
if(timemode == 0) format(ystring,sizeof(ystring),"%s by %s - Best race times:",tmp,TBuilder);
else if(timemode == 1) format(ystring,sizeof(ystring),"%s by %s - Best laps:",tmp,TBuilder);
else return 1;
SendClientMessage(playerid,COLOR_GREEN,ystring);
for(new i=0;i<5;i++)
{
TempLapper=strtok(templine,idx);
TempLap=strval(strtok(templine,idx));
if(TempLap == 0)
{
format(ystring,sizeof(ystring),"%d. None yet",i+1);
i=6;
}
else format(ystring,sizeof(ystring),"%d. %s - %s",i+1,BeHuman(TempLap),TempLapper);
SendClientMessage(playerid,COLOR_GREEN,ystring);
}
return 1;
}
else
{
format(ystring,sizeof(ystring),"Race \'%s\' doesn't contain any time data.",tmp);
SendClientMessage(playerid,COLOR_GREEN,ystring);
return 1;
}
}
}
return 0;
}