05.09.2013, 02:09
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?
aqui fiz uns comando pra testar pra ve se realmente salva
mais quando Reloga nгo fica com o admin alguem ajuda ae VLW
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;
}
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;
}