Salut à tous,
Alors voila pour poursuivre mon DM Stats j'aimerai enfaite que les kill et death des gens soit sauvegarder dans un fichier appeler DmStats.txt.
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 ;)
EDIT : Ah oui pour info le code commence a la ligne 32
EDIT 2 : Pour les erreurs j'ai trouver :))
Mais sa ne marche pas il ne crée pas de fichier voila ce que j'ai mis :
public OnPlayerDeath(playerid, killerid, reason)
{
new tmp[128];
if(killerid != INVALID_PLAYER_ID)
{
Kills[killerid] ++;
Deaths[playerid] ++;
}
else
{
Deaths[playerid] += 1;
}
GetPlayerName(playerid, tmp, MAX_PLAYER_NAME);
new File: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]); //Best complete race times
fwrite(f,tmp);
return 1;
}