SA-MP Forums Archive
[ajuda] infoorg - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [ajuda] infoorg (/showthread.php?tid=345093)



[ajuda] infoorg - tonisantolia - 23.05.2012

Galera estou montando um gm do zero..
Estou na parte das organizaзхes ai tipo..
eu botei pra carregar o infoorg mas o samserver trava..
PQP?

OnGameModeInit:
PHP код:
CarregarOrgs(); 
Stock CarregarOrgs():
PHP код:
stock CarregarOrgs()
{
    new 
arquivo[256];
    new 
idx 1;
    while (
idx sizeof(InfoOrg))
    {
        
format(arquivosizeof(arquivo), "Membros Orgs/%d.cfg",idx);
        
strmid(InfoOrg[idx][Lider], DOF2_GetString(arquivo,"Lider"), 0strlen(DOF2_GetString(arquivo,"Lider")), 255);
        
strmid(InfoOrg[idx][SubLider555], DOF2_GetString(arquivo,"SubLider555"), 0strlen(DOF2_GetString(arquivo,"SubLider555")), 255);
        
strmid(InfoOrg[idx][SubLider444], DOF2_GetString(arquivo,"SubLider444"), 0strlen(DOF2_GetString(arquivo,"SubLider444")), 255);
        
strmid(InfoOrg[idx][Vaga1], DOF2_GetString(arquivo,"Vaga1"), 0strlen(DOF2_GetString(arquivo,"Vaga1")), 255);
        
strmid(InfoOrg[idx][Vaga2], DOF2_GetString(arquivo,"Vaga2"), 0strlen(DOF2_GetString(arquivo,"Vaga2")), 255);
        
strmid(InfoOrg[idx][Vaga3], DOF2_GetString(arquivo,"Vaga3"), 0strlen(DOF2_GetString(arquivo,"Vaga3")), 255);
        
strmid(InfoOrg[idx][Vaga4], DOF2_GetString(arquivo,"Vaga4"), 0strlen(DOF2_GetString(arquivo,"Vaga4")), 255);
        
strmid(InfoOrg[idx][Vaga5], DOF2_GetString(arquivo,"Vaga5"), 0strlen(DOF2_GetString(arquivo,"Vaga5")), 255);
        
strmid(InfoOrg[idx][Vaga6], DOF2_GetString(arquivo,"Vaga6"), 0strlen(DOF2_GetString(arquivo,"Vaga6")), 255);
        
strmid(InfoOrg[idx][Vaga7], DOF2_GetString(arquivo,"Vaga7"), 0strlen(DOF2_GetString(arquivo,"Vaga7")), 255);
    }
    
printf("[BMW] Organizaзхes Carregadas");
    return 
1;




Re: [ajuda] infoorg - BreakDriFT - 23.05.2012

Posta ae Server_log.txt Trava o samp-server.exe ?


Re: [ajuda] infoorg - tonisantolia - 23.05.2012

PHP код:


----------
Loaded log file"server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3e, (C)2005-2012 SA-MP Team

[16:35:17filterscripts ""  (string)
[
16:35:17
[
16:35:17Server Plugins
[16:35:17] --------------
[
16:35:17]  Loaded 0 plugins.

[
16:35:17
[
16:35:17Filterscripts
[16:35:17] ---------------
[
16:35:17]   Loaded 0 filterscripts



Re: [ajuda] infoorg - Mandrakke - 23.05.2012

Mas й lуgico que vai dar merda, tu fez um loop infinito aн. Faltou dar um incremento no idx.

troca por isso;

pawn Код:
stock CarregarOrgs()
{
    new arquivo[256];
    new idx = 1;
    while (idx < sizeof(InfoOrg))
    {
        format(arquivo, sizeof(arquivo), "Membros Orgs/%d.cfg",idx);
        strmid(InfoOrg[idx][Lider], DOF2_GetString(arquivo,"Lider"), 0, strlen(DOF2_GetString(arquivo,"Lider")), 255);
        strmid(InfoOrg[idx][SubLider555], DOF2_GetString(arquivo,"SubLider555"), 0, strlen(DOF2_GetString(arquivo,"SubLider555")), 255);
        strmid(InfoOrg[idx][SubLider444], DOF2_GetString(arquivo,"SubLider444"), 0, strlen(DOF2_GetString(arquivo,"SubLider444")), 255);
        strmid(InfoOrg[idx][Vaga1], DOF2_GetString(arquivo,"Vaga1"), 0, strlen(DOF2_GetString(arquivo,"Vaga1")), 255);
        strmid(InfoOrg[idx][Vaga2], DOF2_GetString(arquivo,"Vaga2"), 0, strlen(DOF2_GetString(arquivo,"Vaga2")), 255);
        strmid(InfoOrg[idx][Vaga3], DOF2_GetString(arquivo,"Vaga3"), 0, strlen(DOF2_GetString(arquivo,"Vaga3")), 255);
        strmid(InfoOrg[idx][Vaga4], DOF2_GetString(arquivo,"Vaga4"), 0, strlen(DOF2_GetString(arquivo,"Vaga4")), 255);
        strmid(InfoOrg[idx][Vaga5], DOF2_GetString(arquivo,"Vaga5"), 0, strlen(DOF2_GetString(arquivo,"Vaga5")), 255);
        strmid(InfoOrg[idx][Vaga6], DOF2_GetString(arquivo,"Vaga6"), 0, strlen(DOF2_GetString(arquivo,"Vaga6")), 255);
        strmid(InfoOrg[idx][Vaga7], DOF2_GetString(arquivo,"Vaga7"), 0, strlen(DOF2_GetString(arquivo,"Vaga7")), 255);
        ++idx;
    }
    printf("[BMW] Organizaзхes Carregadas");
    return 1;
}