[Ajuda] DOF2 nгo estб salvando
#1

bom pessoal estou fazendo uma filterscript pro meu sv pq n tenho a pwn dele entгo eu resolvi criar aqui pra salvar o level adm do player e o clan dele porem nгo estб salvando na pasta Contas em scriptfiles eu jб criei a pasta jб puis printf pra indentificar se tem algo de errado mas n tem nada de errado so nгo estб salvando oque eu faзo

codigo

PHP Code:
// NEW.PWN BY: $C0pAs
//===========================INCLUDES===================================//
#include <a_samp>
#include <ZCMD>
#include <sscanf>
#include <DOF2>
//===========================DEFINES==========================//
#define    CONTASS    "Contas/%s.ini"
//===========================ENUMS==========================//
enum pSupremo
{
    
Supremo,
     
Clan
};
new 
pSuper[MAX_PLAYERS][pSupremo];
//===========================NADA======================================//
main()
{
}
//===========================PUBLICS====================================//
public OnGameModeInit()
{
    
printf(" eu me abri o init adm");
    return 
1;
}
public 
OnGameModeExit()
{
    for(new 
0MAX_PLAYERSi++)
    {
        
SalvarPlayer(i);
    }
    
DOF2_Exit();
    
    return 
1;
}
public 
OnPlayerConnect(playerid)
{
    new 
ip[16],name[20],string[150];
    
GetPlayerIp(playeridipsizeof(ip));
    
GetPlayerName(playerid,name,sizeof(name));
    
format(string150"[LOGIN] Player %s has Connected with ip: %s."nameip);
    for(new 
i=0;i<MAX_PLAYERS;i++)
    {
      if(
pSuper[playerid][Supremo] >= 1)
     {
    
SendClientMessage(i, -1string);
     }
    }
    return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    
SalvarPlayer(playerid);
    
//==========================================================
    
new file[155], aname[MAX_PLAYER_NAME];
     
GetPlayerName(playeridanamesizeof(aname));
    
format(filesizeof(file), "Contas/%s.ini"aname);
       
DOF2_SetInt(file"vSupremo"pSuper[playerid][Clan]);
    
DOF2_SetInt(file"vClan"pSuper[playerid][Clan]);
    
printf(" eu me salvei tudo");
    
    return 
1;
}
public 
OnPlayerSpawn(playerid)
{
    
CarregarPlayer(playerid);
    return 
1;
}
public 
OnPlayerDeath(playeridkilleridreason)
{
    return 
1;
}
//===========================CMDS=====================================//
CMD:setsupremo(playeridparams[])
{
    new 
Levelidplayeraname[MAX_PLAYER_NAME], pname[MAX_PLAYER_NAME], file[155];
    if(!
IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1"[ ERRO ] {FF0000}Vocк nгo tem acesso a este comando!");
    if(
sscanf(params"dd"idplayerLevel)) return SendClientMessage(playerid, -1"[ ERRO] {FF0000}use: /setsupremo [playerid] [level 0-1]");
    if(
Level || Level 1) return SendClientMessage(playerid, -1"[ ERRO] {FF0000}Level invalido tente novamente (0-1)");
    
GetPlayerName(playeridanamesizeof(aname));
    
GetPlayerName(idplayerpnamesizeof(pname));
    
format(filesizeof(file), CONTASSpname);
    
DOF2_SetInt(file"Supremo"Level);
    
pSuper[idplayer][Supremo] = Level;
    
SalvarPlayer(idplayer);
    
printf(" eu me setei adm");
    return 
1;
}
CMD:myskin(playeridparams[])
{
    new 
id;
    if(
pSuper[playerid][Supremo] >= 1) return SendClientMessage(playerid,-1"{FFFFFF} Vocк nгo tem permissгo!");
    if(
sscanf(params"d"id)) return SendClientMessage(playerid, -"/myskin id");
    
SetPlayerSkin(playerid,id);
    
SendClientMessage(id, -1" skin id %d");
    return 
1;
}
CMD:ss(playeridparams[])
{
    
SalvarPlayer(playerid);
    
CarregarPlayer(playerid);
    
printf(" eu salvei tudo");
    return 
1;
}
//===========================STOCKS===================================//
stock PegarNome(playerid)
{
    new 
Name[MAX_PLAYER_NAME];
    
GetPlayerName(playeridNameMAX_PLAYER_NAME);
    return 
Name;
}
stock SalvarPlayer(playerid)
{
    new 
pArquivos[50];
    
format(pArquivossizeof(pArquivos), CONTASSPegarNome(playerid));
    if(
DOF2_FileExists(pArquivos))
    {
        
DOF2_SetInt(pArquivos"vClan"pSuper[playerid][Clan]);
        
DOF2_SetInt(pArquivos"vSupremo"pSuper[playerid][Supremo]);
        
DOF2_SaveFile();
    }
    return 
1;
}
stock CarregarPlayer(playerid)
{
    new 
pArquivos[50];
    
format(pArquivossizeof(pArquivos), CONTASSPegarNome(playerid));
    if(
DOF2_FileExists(pArquivos))
    {
        
pSuper[playerid][Clan] = DOF2_GetInt(pArquivos"vClan");
        
pSuper[playerid][Supremo] = DOF2_GetInt(pArquivos"vSupremo");
    }
    return 
1;

Reply


Messages In This Thread
DOF2 nгo estб salvando - by zPawnu - 11.11.2015, 22:35
Re: DOF2 nгo estб salvando - by willttoonn - 11.11.2015, 23:47
Re: DOF2 nгo estб salvando - by Thider - 11.11.2015, 23:54
Re: DOF2 nгo estб salvando - by zPawnu - 11.11.2015, 23:55
Re: DOF2 nгo estб salvando - by willttoonn - 12.11.2015, 00:05
Re: DOF2 nгo estб salvando - by zPawnu - 12.11.2015, 00:20

Forum Jump:


Users browsing this thread: 1 Guest(s)