[Ajuda] DOF2
#1

Olб galera, estou criando um gamemode do 0, atй entгo blz, mais eu recebi recomendaзхes de trocar a Dini por DOF2, estou fazendo um infoorg, sу que nгo conheзo as funзхes da DOF2, agradeзo а quem ajudar!

PHP код:

forward LoadOrgs
();
forward DemitirInfoOrg(nome[]);
public 
LoadOrgs()
{
    new 
arquivo[256];
    new 
idx 1;
    while (
idx sizeof(InfoOrg))
    {
        
format(arquivosizeof(arquivo), "ORG Arquivos/Org%d.cfg",idx);
        
strmid(InfoOrg[idx][Lider], DOF2_SetString(arquivo,"Lider"), 0strlen(DOF2_SetInt(arquivo,"Lider")), 255);
        
strmid(InfoOrg[idx][SubLider], DOF2_SetString(arquivo,"SubLider"), 0strlen(DOF2_SetInt(arquivo,"SubLider")), 255);
        
strmid(InfoOrg[idx][Membro1], DOF2_SetString(arquivo,"Membro1"), 0strlen(DOF2_SetInt(arquivo,"Membro1")), 255);
        
strmid(InfoOrg[idx][Membro2], DOF2_SetString(arquivo,"Membro2"), 0strlen(DOF2_SetInt(arquivo,"Membro2")), 255);
        
strmid(InfoOrg[idx][Membro3], DOF2_SetString(arquivo,"Membro3"), 0strlen(DOF2_SetInt(arquivo,"Membro3")), 255);
        
strmid(InfoOrg[idx][Membro4], DOF2_SetString(arquivo,"Membro4"), 0strlen(DOF2_SetInt(arquivo,"Membro4")), 255);
        
strmid(InfoOrg[idx][Membro5], DOF2_SetString(arquivo,"Membro5"), 0strlen(DOF2_SetInt(arquivo,"Membro5")), 255);
        
strmid(InfoOrg[idx][Membro6], DOF2_SetString(arquivo,"Membro6"), 0strlen(DOF2_SetInt(arquivo,"Membro6")), 255);
        
strmid(InfoOrg[idx][Membro7], DOF2_SetString(arquivo,"Membro7"), 0strlen(DOF2_SetInt(arquivo,"Membro7")), 255);
        
strmid(InfoOrg[idx][Membro8], DOF2_SetString(arquivo,"Membro8"), 0strlen(DOF2_SetInt(arquivo,"Membro8")), 255);
        
strmid(InfoOrg[idx][Membro9], DOF2_SetString(arquivo,"Membro9"), 0strlen(DOF2_SetInt(arquivo,"Membro9")), 255);
        
strmid(InfoOrg[idx][Membro10], DOF2_SetString(arquivo,"Membro10"), 0strlen(DOF2_SetInt(arquivo,"Membro10")), 255);
           
idx ++;
    }
    
printf("[BCL]: %d Organizaзхes carregadas."idx);
    return 
true;
}
public 
DemitirInfoOrg(nome[])
{
    new 
arquivo[256];
    for(new 
1sizeof(InfoOrg); i++)
    {
        
format(arquivosizeof(arquivo), "ORG Arquivos/Org%d.cfg",i);
        if(
strcmp(nome,InfoOrg[i][Lider],true)==0)
        {
            
strmid(InfoOrg[i][Lider], "Ninguem"0strlen("Ninguem"), MAX_PLAYER_NAME);
            
DOF2_SetInt(arquivo,"Lider","Ninguem");
            return 
true;
        }
        if(
strcmp(nome,InfoOrg[i][SubLider],true)==0)
        {
            
strmid(InfoOrg[i][SubLider], "Ninguem"0strlen("Ninguem"), MAX_PLAYER_NAME);
            
DOF2_SetInt(arquivo,"SubLider","Ninguem");
            return 
true;
           }
        if(
strcmp(nome,InfoOrg[i][Membro1],true)==0)
        {
            
strmid(InfoOrg[i][Membro1], "Ninguem"0strlen("Ninguem"), MAX_PLAYER_NAME);
            
DOF2_SetInt(arquivo,"Membro1","Ninguem");
            return 
true;
        }
        if(
strcmp(nome,InfoOrg[i][Membro2],true)==0)
        {
            
strmid(InfoOrg[i][Membro2], "Ninguem"0strlen("Ninguem"), MAX_PLAYER_NAME);
             
DOF2_SetInt(arquivo,"Membro2","Ninguem");
              return 
true;
        }
        if(
strcmp(nome,InfoOrg[i][Membro3],true)==0)
        {
            
strmid(InfoOrg[i][Membro3], "Ninguem"0strlen("Ninguem"), MAX_PLAYER_NAME);
            
DOF2_SetInt(arquivo,"Membro3","Ninguem");
             return 
true;
        }
        if(
strcmp(nome,InfoOrg[i][Membro4],true)==0)
        {
            
strmid(InfoOrg[i][Membro4], "Ninguem"0strlen("Ninguem"), MAX_PLAYER_NAME);
             
DOF2_SetInt(arquivo,"Membro4","Ninguem");
              return 
true;
        }
        if(
strcmp(nome,InfoOrg[i][Membro5],true)==0)
        {
            
strmid(InfoOrg[i][Membro5], "Ninguem"0strlen("Ninguem"), MAX_PLAYER_NAME);
            
DOF2_SetInt(arquivo,"Membro5","Ninguem");
            return 
true;
        }
        if(
strcmp(nome,InfoOrg[i][Membro6],true)==0)
        {
            
strmid(InfoOrg[i][Membro6], "Ninguem"0strlen("Ninguem"), MAX_PLAYER_NAME);
             
DOF2_SetInt(arquivo,"Membro6","Ninguem");
            return 
true;
        }
        if(
strcmp(nome,InfoOrg[i][Membro7],true)==0)
        {
            
strmid(InfoOrg[i][Membro7], "Ninguem"0strlen("Ninguem"), MAX_PLAYER_NAME);
             
DOF2_SetInt(arquivo,"Membro7","Ninguem");
              return 
true;
        }
        if(
strcmp(nome,InfoOrg[i][Membro8],true)==0)
        {
            
strmid(InfoOrg[i][Membro8], "Ninguem"0strlen("Ninguem"), MAX_PLAYER_NAME);
            
DOF2_SetInt(arquivo,"Membro8","Ninguem");
            return 
true;
        }
        if(
strcmp(nome,InfoOrg[i][Membro9],true)==0)
        {
            
strmid(InfoOrg[i][Membro9], "Ninguem"0strlen("Ninguem"), MAX_PLAYER_NAME);
            
DOF2_SetInt(arquivo,"Membro9","Ninguem");
            return 
true;
        }
        if(
strcmp(nome,InfoOrg[i][Membro10],true)==0)
        {
            
strmid(InfoOrg[i][Membro10], "Ninguem"0strlen("Ninguem"), MAX_PLAYER_NAME);
            
DOF2_SetInt(arquivo,"Membro10","Ninguem");
            return 
true;
        }
    }
    return 
0;

Reply
#2

Код:
native DOF2_SetFile(file[]);
native DOF2_LoadFile();
native DOF2_SaveFile();
native DOF2_ParseFile(file[],extraid,bool:callback=true);
native DOF2_ReparseFile(file[],extraid,bool:callback=true);
native DOF2_WriteFile();
native DOF2_PrintFile(comment[]="");
native DOF2_GetString(file[],key[],tag[]="");
native DOF2_GetStringEx(file[],key[],result[],size,tag[]="");
native Float:DOF2_GetFloat(file[],key[]);
native DOF2_GetInt(file[],key[],tag[]="");
native DOF2_GetHex(file[],key[],tag[]="");
native DOF2_GetBin(file[],key[],tag[]="");
native bool:DOF2_GetBool(file[],key[],tag[]="");
native DOF2_SetString(file[],key[],value[],tag[]="");
native DOF2_SetFloat(file[],key[],Float:value);
native DOF2_SetInt(file[],key[],value,tag[]="");
native DOF2_SetHex(file[],key[],value,tag[]="");
native DOF2_SetBin(file[],key[],value,tag[]="");
native DOF2_SetBool(file[],key[],bool:value,tag[]="");
native DOF2_IsSet(file[],key[],tag[]="");
native DOF2_Unset(file[],key[],tag[]="");
native DOF2_FileExists(file[]);
native DOF2_RemoveFile(file[]);
native DOF2_CreateFile(file[],password[]="");
native DOF2_RenameFile(oldfile[],newfile[]);
native DOF2_RenameKey(file[],oldkey[],newkey[],tag[]="");
native DOF2_CopyFile(filetocopy[],newfile[]);
native DOF2_CheckLogin(file[],password[]);
native DOF2_File(user[]);
native DOF2_ParseInt();
native DOF2_ParseFloat();
native DOF2_ParseBool();
native DOF2_ParseBin();
native DOF2_ParseHex();
native DOF2_SetUTF8(bool:set);
native bool:DOF2_GetUTF8();
native DOF2_GetFile();
native DOF2_MakeBackup(file[]);
native DOF2_RemoveTag (file [], tag []);
Reply
#3

DOF2_SetString tem 3 parametros, vocк sу colocou dois.
O mesmo valo para DOF2_SetInt

Ex:

pawn Код:
DOF2_SetInt("Arquivo.ini","Quantidade",2);
Reply
#4

obrigado ae galera, mais tipo, estava como Dini_Get eu troquei por esses, qual funзгo devo usar no lugar do Dini_Get ?
Reply
#5

Код:
DOF2_GetInt(file[],key[],tag[]="");
Reply
#6

C:\Documents and Settings\GreeN\Desktop\Projeto\gamemodes\BCL.pwn(4 830) : error 035: argument type mismatch (argument 2)
C:\Documents and Settings\GreeN\Desktop\Projeto\gamemodes\BCL.pwn(4 831) : error 035: argument type mismatch (argument 2)

OS ERROS QUE APARECERAM.
Reply
#7

pawn Код:
Dini_Get - DOF2_GetString(arquivo,"SubLider");
Reply
#8

ae vini, a primeira public resolveu, agora os erros sгo na
public DemitirInfoOrg(nome[]) Para baixo:

Tipo, aqui era dini_Set troco por q?
Reply
#9

pawn Код:
DOF2_SetString
Reply
#10

Problemas resolvidos, Vini e Jeff, muito obrigado mesmo, com essa ajudinha de vocкs, irei aprender mais sobre a DOF2, vlw ai galera!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)