[Ajuda] kills/deaths nao salvam
#9

Quote:
Originally Posted by XandyMello
Посмотреть сообщение
@PedroH, nossa em.. De onde vc tirou essa lуgica ? '-'
PHP код:
if( DOF2_FileExistsGetPlayerArquivoplayerid ) ) )
{
DOF2_CreateFile(GetPlayerArquivo(playerid));

O correto й usar assim:
PHP код:
if(!DOF2_FileExists( ..) ) DOF2_CreateFile(..); //Se nгo existir, criar! 
isso faz parte do sistema de salvamento que eu uso!
devo colocar isso nas callbacks?

coloquei assim e nao foi, tenho uma leve impressao de que tem algo faltando kk

Quote:

OnPlayerDisconnect..

new String[50], Nome[MAX_PLAYER_NAME];
GetPlayerName(playerid, Nome, sizeof Nome);
format(String, sizeof String, "Pasta2/%s.ini", Nome);
DOF2_SetInt(String, "Morreu", pInfo2[playerid][Morreu]);
DOF2_SetInt(String, "Matou", pInfo2[playerid][Matou]);

OnPlayerSpawn...

new String[50], Nome[MAX_PLAYER_NAME];
GetPlayerName(playerid, Nome, sizeof Nome);
format(String, sizeof String, "Pasta/%s.ini", Nome);
DOF2_SetInt(String, "Morreu", pInfo2[playerid][Morreu]);
DOF2_SetInt(String, "Matou", pInfo2[playerid][Matou]);
SetTextPlayer(playerid);

eu tambem tentei adpatar esse que era um sistema de salvar score tentei fazer com o matou/morreu e deu nisso:

erro:
Quote:

C:\Users\Pedro W7\Desktop\matoumorreu.pwn(47) : error 035: argument type mismatch (argument 3)
C:\Users\Pedro W7\Desktop\matoumorreu.pwn(4 : error 035: argument type mismatch (argument 3)
C:\Users\Pedro W7\Desktop\matoumorreu.pwn(54) : error 035: argument type mismatch (argument 3)
C:\Users\Pedro W7\Desktop\matoumorreu.pwn(55) : error 035: argument type mismatch (argument 3)
C:\Users\Pedro W7\Desktop\matoumorreu.pwn(6 : error 033: array must be indexed (variable "Nome")
C:\Users\Pedro W7\Desktop\matoumorreu.pwn(69) : error 033: array must be indexed (variable "Nome")
C:\Users\Pedro W7\Desktop\matoumorreu.pwn(72) : error 010: invalid function or declaration
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

Sistema:

Quote:

#define FILTERSCRIPT

#include <a_samp>
#include DOF2

enum Playerinfos
{
Matou,
Morreu
};

new pInfo2[MAX_PLAYERS][Playerinfos];

public OnFilterScriptInit()
{
printf("Sistema de salvamento de Score carregado!");
return 1;
}

public OnFilterScriptExit()
{
DOF2_Exit();
printf("Sistema de salvamento de Score descarregado!");
return 1;
}


public OnPlayerDeath(playerid, killerid, reason)
{
pInfo2[killerid][Matou]++;
pInfo2[playerid][Morreu]++;
return 1;
}

public OnPlayerConnect(playerid)
{
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
new String[50], Nome[MAX_PLAYER_NAME];
GetPlayerName(playerid, Nome, sizeof Nome);
format(String, sizeof String, "Pasta2/%s.ini", Nome);
if(DOF2_FileExists(String))
{
DOF2_SetInt(String, "Morreu", Nome);
DOF2_SetInt(String, "Matou", Nome);
DOF2_SaveFile();
}
else
{
DOF2_CreateFile(String);
DOF2_SetInt(String, "Morreu", Nome);
DOF2_SetInt(String, "Matou", Nome);
DOF2_SaveFile();
}
return 1;
}

public OnPlayerSpawn(playerid)
{
new String[50], Nome[MAX_PLAYER_NAME];
GetPlayerName(playerid, Nome, sizeof Nome);
format(String, sizeof (String), "Pasta2/%s.ini", Nome);
if(DOF2_FileExists(String))
{
Nome = DOF2_GetInt(String, "Matou");
Nome = DOF2_GetInt(String, "Morreu");
}
}
return 1;
}

Reply


Messages In This Thread
kills/deaths nao salvam - by PedroH - 16.07.2017, 02:40
Nгo esqueзa da ";" - by DogMal - 16.07.2017, 02:49
Re: kills/deaths nao salvam - by PedroH - 16.07.2017, 02:59
Re: kills/deaths nao salvam - by DogMal - 16.07.2017, 03:03
Re: kills/deaths nao salvam - by PedroH - 16.07.2017, 03:25
Re: kills/deaths nao salvam - by Jonorusc - 16.07.2017, 14:30
Re: kills/deaths nao salvam - by PedroH - 16.07.2017, 16:56
Re: kills/deaths nao salvam - by XandyMello - 16.07.2017, 17:23
Re: kills/deaths nao salvam - by PedroH - 16.07.2017, 18:27
Re: kills/deaths nao salvam - by XandyMello - 16.07.2017, 20:55

Forum Jump:


Users browsing this thread: 2 Guest(s)