SA-MP Forums Archive
[Ajuda] "/inativos" - 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] "/inativos" (/showthread.php?tid=410869)



"/inativos" - Cristhian - 27.01.2013

pawn Code:
if(strcmp(cmdtext, "/inativos", true) == 0)
    {
        if(PlayerInfo[playerid][pAdmin] < 1340) return SendClientMessage(playerid, COLOR_GRAD2, "Vocк nгo estб autorizado a usar este comando");
        for(new i = 0; i < 24; i++)
        {
            new string2[80], val[100], msg[100];
            format(string2, sizeof(string2), "Contas/%s.ini", InfoOrg[i][Lider]);
            new File: UserFile = fopen(string2, io_read);
           
            format(msg, sizeof(msg), "Ъltimo login de %s, foi: %s", InfoOrg[i][Lider], val);
            SendClientMessage(playerid, COLOR_YELLOW, msg);
            fclose(UserFile);
        }
        return 1;
    }
Alguйm sabe como eu pego a data na parte: "LU='24/44/1541/12/54/15'" (exemplo) do arquivo da conta?


Re: "/inativos" - ForT - 27.01.2013

O melhor que vocк faz, й salvar o ultimo login do lider no prуprio infoorg..


Re: "/inativos" - Cristhian - 27.01.2013

pawn Code:
if( strcmp( key , "LU" , true ) == 0 )
                    {
                        val = ini_GetValue( Data );
                        strmid(PlayerInfo[playerid][pLastLogin], val, 0, strlen(val)-1, 255);
                        new arquivo[128];
                        format(arquivo, sizeof(arquivo), "ORG Arquivos/Org%d.cfg",GetPlayerOrg(playerid));
                        for(new i = 0; i < 24; i++)
                        {
                            if(InfoOrg[i][Lider] == PlayerName(playerid)) //line 14670
                            {
                                InfoOrg[i][LastLogin] = PlayerInfo[playerid][pLastLogin];
                                dini_Set(arquivo, "LastLogin", InfoOrg[i][LastLogin]);
                            }
                        }
                    }
Code:
C:\Documents and Settings\Cristhian\Desktop\Server Samp\Server Samp\gamemodes\Final.pwn(14670) : error 033: array must be indexed (variable "PlayerName")
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Como resolvo isso?


Re: "/inativos" - BreakDriFT - 27.01.2013

Manda este Playername ai.


Re: "/inativos" - Cristhian - 27.01.2013

Nгo й o PlayerName nгo, por que eu tentei colocar:
pawn Code:
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name))
e apareceu:
Code:
C:\Documents and Settings\Cristhian\Desktop\Server Samp\Server Samp\gamemodes\Final.pwn(14670) : error 033: array must be indexed (variable "name")



Re: "/inativos" - Cristhian - 28.01.2013

Alguйm ?


Re: "/inativos" - XStylerX - 28.01.2013

pawn Code:
new alguem[MAX_PLAYER_NAME+1];
GetPlayerName(playerid, alguem, sizeof(alguem));



Re: "/inativos" - Cristhian - 28.01.2013

Nгo й isso... vocк leu o tуpico todo ?


Re: "/inativos" - XStylerX - 28.01.2013

pawn Code:
new nome[25];
GetPlayerName(playerid,nome,25);
impossivel n dar certo


Re: "/inativos" - ForT - 28.01.2013

lol..

pawn Code:
if( strcmp( key , "LU" , true ) == 0 )
                    {
                        val = ini_GetValue( Data );
                        strmid(PlayerInfo[playerid][pLastLogin], val, 0, strlen(val)-1, 255);
                        new arquivo[128];
                        format(arquivo, sizeof(arquivo), "ORG Arquivos/Org%d.cfg",GetPlayerOrg(playerid));
                        for(new i = 0; i < 24; i++)
                        {
                            if(strcmp(InfoOrg[i][Lider], PlayerName(playerid), true) ==0) //line 14670
                            {
                                InfoOrg[i][LastLogin] = PlayerInfo[playerid][pLastLogin];
                                dini_Set(arquivo, "LastLogin", InfoOrg[i][LastLogin]);
                            }
                        }
                    }



Re: "/inativos" - Cristhian - 28.01.2013

eita, eu jб tinha tentado isso e nгo deu, agora eu fiz e deu :S
valeu ae, +REP

@Edit
apareceu que jб dei reputation...