[Ajuda] | ERRO | poha do admin nгo salva :(
#1

eu di inicio em um gm do 0, fiz registro e tava fasendo um sistema de admin + nгo salva alguem ae sabe por que?

pawn Code:
new EAdmin[MAX_PLAYERS]; // Dando inicio ao sistema de admin
pawn Code:
public OnPlayerDisconnect(playerid, reason)
{

    new aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
    format(file, sizeof(file), P_CONTAS, aname);
    dini_IntSet(file, "AdminLevel", EAdmin[playerid]);
    return 1;
}
pawn Code:
public OnPlayerSpawn(playerid)
{
    new aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
    format(file, sizeof(file), P_CONTAS, aname);
   
    dini_IntSet(file, "AdminLevel", EAdmin[playerid]);
    return 1;
}
aqui fiz uns comando pra testar pra ve se realmente salva
pawn Code:
public OnPlayerCommandText(playerid, cmdtext[])
{

if (strcmp("/JetPack", cmdtext, true, 10) == 0)
{
    new aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
    format(file, sizeof(file), P_CONTAS, aname);
   
    if(EAdmin[playerid] < 1) return SendClientMessage(playerid, Vermelho,"| ERRO | Vocк nгo tem permissгo.");
    {
    SetPlayerSpecialAction(playerid, 2);
    return 1;
    }
}
   
    if (strcmp("/admin", cmdtext, true, 10) == 0)
    {
    new aname[MAX_PLAYER_NAME];
    GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
    format(file, sizeof(file), P_CONTAS, aname);
    EAdmin[playerid] = 5;
    return 1;
    }
   
    return 0;
}
mais quando Reloga nгo fica com o admin alguem ajuda ae VLW
Reply
#2

Nгo precisa criar o arquivo antes ? '-'
Reply
#3

como assim ? que arquivo
Reply
#4

cara desiste de strcmp e dini, use zcmd+foreach com dof2 mais faceis...
Reply
#5

alguem ae
Reply
#6

Cara , antes de setar algo em um arquivo , vocк deves cria-lo primeiro , pensa comigo.
Reply
#7

, sу me diz o arquivo que devo criar mano
Reply
#8

PORR# .

Nгo uso dini , mais deve ser isso :

Quote:

new pname[MAX_PLAYER_NAME],new str[100];
GetPlayerName(playerid,pname,sizeof(pname));
format(str,sizeof(str),P_CONTAS,pname);
dini_CreateFile(str);

Reply
#9

nem precisava disso

RESOLVIDO
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)