• 06 Juin 2026, 18:45:05


Auteur Sujet: Crée un DM stats  (Lu 5145 fois)

0 Membres et 1 Invité sur ce sujet

Hors ligne cristab

  • *
  • Messages: 8379
    • Voir le profil
Re : Crée un DM stats
« Réponse #45 le: 17 Octobre 2009, 20:33:22 »
je voit que tu galere pas mal je vient de faire ceci tester ect est tout est ok

new Deaths[MAX_PLAYERS];
new Kills[MAX_PLAYERS];
new string[60];

public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID)
{
Kills[killerid] += 1;
Deaths[playerid] += 1;
}
else
{
Deaths[playerid] += 1;
}
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/mystats",cmdtext,true)==0)
{

    format(string,256, "Tuer: [%d] Mort: [%d] Argent: [%d] ",Kills[playerid],Deaths[playerid],GetPlayerMoney(playerid));
    SendClientMessage(playerid,0xFFFFFFAA,string);
    return 1;
}

return 0;
}
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 BuBuNo

  • Radio Guingamp - Bien plus qu'une radio !
  • *
  • Grand Banditisme
  • La radio bien plus qu'une passion !
  • Messages: 840
    • Voir le profil
    • Radio Guingamp - Bien plus qu'une radio !
Re : Crée un DM stats
« Réponse #46 le: 17 Octobre 2009, 21:28:05 »
Heu je croit que tu as fait une erreur ou sinon je ne comprend aps :
Citer
public OnPlayerDeath(playerid, killerid, reason)
{
    if(killerid != INVALID_PLAYER_ID)
   {
      Kills[killerid] += 1;
      Deaths[playerid] += 1;
   }
   else
   {
      Deaths[playerid] += 1;
   }
   return 1;
}

Car je l'ai tester telquelle et j'ai encor le meme probleme:


Double post
Ah c'est bon j'ai reussi sa marche enfaite c'est que je fesait /loadfs Stats et donc sa ne marchait pas comme il falait mais apres je les mis dasn le server.cfg .
Mais bon je en sait pas comment mi prendre pour crée un fichier et sauvegarder tout les kill et death des autres j'ai beau lire le tuto de syg je ne sait pas comment faire :(

Merci d'avance de votre aide ;)
« Modifié: 18 Octobre 2009, 14:11:47 par master-bru »
ıllıllı вυвυησ ıllıllı


Hors ligne cristab

  • *
  • Messages: 8379
    • Voir le profil
Re : Crée un DM stats
« Réponse #47 le: 18 Octobre 2009, 17:14:17 »
c'est a dire un nombre totalde kill sur le serveur ?? ou sur chaque save des joueurs chacucn sont score?
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 BuBuNo

  • Radio Guingamp - Bien plus qu'une radio !
  • *
  • Grand Banditisme
  • La radio bien plus qu'une passion !
  • Messages: 840
    • Voir le profil
    • Radio Guingamp - Bien plus qu'une radio !
Re : Crée un DM stats
« Réponse #48 le: 18 Octobre 2009, 17:20:31 »
Bonjour a tous,
Alors voila j'aimerai cree un DM stats qui prend les 5 meilleur joueurs qui resemble un peu a sa :

...:::: DeathMatch Stats ::::....
[XST]BuBuNo : 27 kill 19 Death
igfigf : 12 kill 20 Death
ituehj : 12 kill 21 Death
ihodn : 1 kill 59 Death
fire : 1 kill 29 Death



Et j'aimerai que sa l'es enregistre dans un fichier.

Merci d'avance de votre aide.

Bas comme j'avait dit au début.

EDIT :
Bon au moin j'ai essayer xD
VOila j'ai essayer de le faire mais bon sans succes :

public OnPlayerDeath(playerid, killerid, reason)
{
new templine[512];
new tmp[128];
    if(killerid != INVALID_PLAYER_ID)
{
Kills[killerid] ++;
Deaths[playerid] ++;
}
else
{
Deaths[playerid] += 1;
}
GetPlayerName(playerid, tmp, MAX_PLAYER_NAME);
new f;
f = fopen("dmstats.txt", io_readwrite);
format(tmp,sizeof(tmp),"Dm Stats\n");
fwrite(f,tmp);
format(tmp,sizeof(tmp),"%s death : %d kill %d\n"Kills[playerid],Deaths[playerid]);
fwrite(f,tmp);
return 1;
}

et voile les erreurs MDR :
C:\Documents and Settings\BrunoLB\Bureau\Ultimate_Stunter\filterscripts\Stats.pwn(47) : warning 213: tag mismatch
C:\Documents and Settings\BrunoLB\Bureau\Ultimate_Stunter\filterscripts\Stats.pwn(49) : warning 213: tag mismatch
C:\Documents and Settings\BrunoLB\Bureau\Ultimate_Stunter\filterscripts\Stats.pwn(50) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Documents and Settings\BrunoLB\Bureau\Ultimate_Stunter\filterscripts\Stats.pwn(50) : warning 215: expression has no effect
C:\Documents and Settings\BrunoLB\Bureau\Ultimate_Stunter\filterscripts\Stats.pwn(50) : warning 215: expression has no effect
C:\Documents and Settings\BrunoLB\Bureau\Ultimate_Stunter\filterscripts\Stats.pwn(50) : error 001: expected token: ";", but found ")"
C:\Documents and Settings\BrunoLB\Bureau\Ultimate_Stunter\filterscripts\Stats.pwn(50) : error 029: invalid expression, assumed zero
C:\Documents and Settings\BrunoLB\Bureau\Ultimate_Stunter\filterscripts\Stats.pwn(50) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.

Merci d'avance de votre aide ;)
« Modifié: 18 Octobre 2009, 19:19:16 par master-bru »
ıllıllı вυвυησ ıllıllı


Hors ligne BuBuNo

  • Radio Guingamp - Bien plus qu'une radio !
  • *
  • Grand Banditisme
  • La radio bien plus qu'une passion !
  • Messages: 840
    • Voir le profil
    • Radio Guingamp - Bien plus qu'une radio !
Re : Crée un DM stats
« Réponse #49 le: 19 Octobre 2009, 19:35:06 »
Up  :-\ .
Quelqu'un peu m'aider ??
ıllıllı вυвυησ ıllıllı