• 05 Juillet 2025, 15:01:58


Auteur Sujet: compte a rebour  (Lu 2895 fois)

0 Membres et 1 Invité sur ce sujet

Hors ligne smackou77

  • *
  • Criminel
  • Messages: 38
    • Voir le profil
compte a rebour
« le: 30 Mai 2007, 19:56:48 »
Bonjour à tous!
Alor voilà je cherche temps bien que mal le script pour samp qui est un compte à rebour qui freeze pour pouvoir faire des courses merci de me le passer si vous l'avez sa serait super sympas et a bientot dans samp!

Hors ligne spykerc8

  • *
  • 'The GTAOnline.fr GodFather'
  • Messages: 3821
    • Voir le profil
    • http://www.gtaonline.fr
Re : compte a rebour
« Réponse #1 le: 30 Mai 2007, 23:22:34 »
Tu peux chercher sur les forums sa:mp pour un compte à rebour...il y en a de très bien.
Pour le freeze utilise la fonction TogglePlayerControllable : http://wiki.sa-mp.com/wiki/Scripting_Functions#TogglePlayerControllable

Cya


~ Leader honoraire de la FsK Team ~ -
~ Membre honoraire de la PCP Team ~

Co-fondateur de GTAO - Retraité de la communauté

"Nous ne sommes rien, soyons tout !"


Hors ligne smackou77

  • *
  • Criminel
  • Messages: 38
    • Voir le profil
Re : compte a rebour
« Réponse #2 le: 31 Mai 2007, 17:34:28 »
Avant main();
new countdown=0;
new COUNTDOWN_TIMER;
new test;
 
N'import où

public COUNTDOWN()
{
   countdown++; // add one
   if (countdown >= 4)
   {
      countdown = 0;
      SendClientMessageToAll(COLOR_WHITE, "GO!!!!");
      KillTimer(COUNTDOWN_TIMER);
   } else {
      format(test, sizeof(test), "%i...", countdown);
      SendClientMessageToAll(COLOR_WHITE, test);
   }
}

Dans OnPlayerCommandText :

if(strcmp(cmd, "/countdown", true) == 0)
{
   countdown = 0; // reset
   COUNTDOWN_TIMER = SetTimer("COUNTDOWN", 500, true);
   return 1;
}
Mais TogglePlayerControllable(playerid, 0); je le mes où? mercii

Hors ligne spykerc8

  • *
  • 'The GTAOnline.fr GodFather'
  • Messages: 3821
    • Voir le profil
    • http://www.gtaonline.fr
Re : Re : compte a rebour
« Réponse #3 le: 31 Mai 2007, 17:50:45 »
Code: (c++) [Sélectionner]
//Avant main();
new countdown=0;
new COUNTDOWN_TIMER;
new test;
 
//N'import où

public COUNTDOWN()
{
countdown++; // add one
if (countdown >= 4)
{
   countdown = 0;
   SendClientMessageToAll(COLOR_WHITE, "GO!!!!");
   KillTimer(COUNTDOWN_TIMER);
} else {
format(test, sizeof(test), "%i...", countdown);
SendClientMessageToAll(COLOR_WHITE, test);
               TogglePlayerControllable(playerid, 0);
}
}

//Dans OnPlayerCommandText :

if(strcmp(cmd, "/countdown", true) == 0)
{
countdown = 0; // reset
COUNTDOWN_TIMER = SetTimer("COUNTDOWN", 500, true);
return 1;
}



~ Leader honoraire de la FsK Team ~ -
~ Membre honoraire de la PCP Team ~

Co-fondateur de GTAO - Retraité de la communauté

"Nous ne sommes rien, soyons tout !"


Hors ligne smackou77

  • *
  • Criminel
  • Messages: 38
    • Voir le profil
Re : compte a rebour
« Réponse #4 le: 31 Mai 2007, 18:10:26 »
trop bien merci

Hors ligne smackou77

  • *
  • Criminel
  • Messages: 38
    • Voir le profil
Re : compte a rebour
« Réponse #5 le: 31 Mai 2007, 19:40:43 »
J'ai tester ce que tu m'avait dit alors j'ai mis :

OnPlayerCommandText()
if(strcmp(cmdtexte, "/countdown", true) == 0)
{
    countdown = 0;// reset
   COUNTDOWN_TIMER = SetTimer("COUNTDOWN", 500, true);
      return 1;
   }


public COUNTDOWN()
{
           countdown++; // add one
           if (countdown >= 4)
            {
              countdown = 0;
              SendClientMessageToAll(COLOR_BLUE, "GO!!!!");
              KillTimer(COUNTDOWN_TIMER);
      } else {
            format(test, sizeof(test), "%i...", countdown);
              SendClientMessageToAll(COLOR_BLUE, test);
         TogglePlayerControllable(playerid, 0);
         }
}

Tout a la fin en mettant avant main()
new countdown=0;
new COUNTDOWN_TIMER;
new test;

Et il m'indique 4erreur pourrait tu m'aider uen fois de plus?
mes erreurs:
C:\PROGRA~1\ROCKST~1\GTASAN~1\samp\GAMEMO~1\src\benj.pwn(532) : error 035: argument type mismatch (argument 1)
C:\PROGRA~1\ROCKST~1\GTASAN~1\samp\GAMEMO~1\src\benj.pwn(532) : error 035: argument type mismatch (argument 1)
C:\PROGRA~1\ROCKST~1\GTASAN~1\samp\GAMEMO~1\src\benj.pwn(533) : error 035: argument type mismatch (argument 2)
C:\PROGRA~1\ROCKST~1\GTASAN~1\samp\GAMEMO~1\src\benj.pwn(534) : error 017: undefined symbol "playerid"
C:\PROGRA~1\ROCKST~1\GTASAN~1\samp\GAMEMO~1\src\benj.pwn(537) : warning 203: symbol is never used: "OnPlayerCommandText"
C:\PROGRA~1\ROCKST~1\GTASAN~1\samp\GAMEMO~1\src\benj.pwn(537) : warning 203: symbol is never used: "test"
Pawn compiler 3.0.3367         Copyright (c) 1997-2005, ITB CompuPhase


4 Errors.