newCmd:daradmin(playerid, params[]) //Admin LVL == 1342
{
if(IsPlayerConnected(playerid))
{
new para1, level;
if(PlayerInfo[playerid][pAdmin] < 1342)
return SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo tem autorizaзгo para usar esse comando.");
AdmsVaga();
if(VagaSobrando == 0)
return SendClientMessage(playerid, COLOR_GRAD1, "Nгo hб mais vagas na lista use /limparadm primeiro.");
if(sscanf(params, "ud", para1, level))
return SendClientMessage(playerid, COLOR_GRAD2, "USE: /daradmin [id] [Nivel]");
if(level == 0)
return SendClientMessage(playerid, COLOR_GRAD2, "USE: /limparadmin para limpar uma vaga");
if(!IsPlayerConnected(para1))
return SendClientMessage(playerid, COLOR_GRAD2, "O player nгo esta Online!");
if(para1 != INVALID_PLAYER_ID)
{
if(PlayerInfo[playerid][pAdmin] != 1342 || PlayerInfo[para1][pAdmin] == 1342)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo pode promover um Admin Poderoso/Scripter!");
format(Str, sizeof(Str), "O admin %s tentou te promover a nivel %d", PlayerName(playerid), level);
SendClientMessage(para1, COLOR_AZULBB, Str);
return 1;
}
format(Str, sizeof(Str), "Vocк foi promovido para level %d de Admin - Por %s", level, PlayerName(playerid));
SendClientMessage(para1, COLOR_LIGHTBLUE, Str);
format(Str, sizeof(Str), " Vocк promoveu o(a) %s Para o level %d de Admin.", PlayerName(para1), level);
SendClientMessage(playerid, COLOR_LIGHTBLUE, Str);
getdate(year, month, day);
gettime(hour,minute,second);
format(Str, sizeof(Str), "%s deu Admin nivel %d para %s [%d/%d/%d] бs [%d:%d:%d].", PlayerName(playerid), level, PlayerName(para1), day, month, year, hour, minute, second);
PAdminsLog(Str);
for(new i = 0; i < sizeof(AdmInfo); i++)
{
if(PlayerInfo[para1][pAdmin] > 0)
{
PlayerInfo[para1][pAdmin] = level;
break;
}
else if(AdmInfo[i][AdminVaga] == 0)
{
PlayerInfo[para1][pAdmin] = level;
AdmInfo[i][gMembro] = para1;
AdmInfo[i][AdminVaga] = 1;
SaveAdm();
break;
}
}
}
}
return 1;
}
forward AdmsVaga();
public AdmsVaga()
{
new storedcopname[64];
new File: file = fopen("Configs/Admins.cfg", io_read);
if (file)
{
new valtmp[MAX_PLAYER_NAME];
while (fread(file, valtmp) > 0)
{
strmid(storedcopname, valtmp, 0, strlen("Vazio"), 255);
if ((strcmp(storedcopname, "Vazio", true, strlen("Vazio")) == 0) && (strlen("Vazio") == strlen(storedcopname)))
{
fclose(file);
VagaSobrando = 1;
return 1;
}
}
}
fclose(file);
VagaSobrando = 0;
return 0;
}
forward SaveAdm();
public SaveAdm()
{
new idx;
new File: file2;
while (idx < sizeof(AdmInfo))
{
new coordsstring[256];
format(coordsstring, sizeof(coordsstring), "%s,%d\n",AdmInfo[idx][gMembro],AdmInfo[idx][AdminVaga]);
if(idx == 0)
{
file2 = fopen("Configs/Admins.cfg", io_write);
}
else
{
file2 = fopen("Configs/Admins.cfg", io_append);
}
fwrite(file2, coordsstring);
idx++;
fclose(file2);
}
return 1;
}
azio,1
dini_Exists DOF2_FileExists
dini_Remove DOF2_RemoveFile
dini_Create DOF2_CreateFile
dini_Set DOF2_SetString
dini_Get DOF2_GetString
dini_IntSet DOF2_SetInt
dini_Int DOF2_GetInt
dini_BoolSet DOF2_SetBool
dini_Bool DOF2_GetBool
dini_FloatSet DOF2_SetFloat
dini_Float DOF2_GetFloat
dini_Unset DOF2_Unset
dini_Isset DOF2_IsSet
|
Mano, nгo tenho ideia de como arrumar... e dof2 e melhor.. e e facil voce entender se voce ja conhece um pouco de Dini..
pawn Код:
|
|
Atualmente o melhor й Y_INI, nгo contando com MySQL. Mais nгo seja obcecado por velocidade mais sim por comodidade e facilidade.
Y_Ini, se vocк for novato/iniciante, й muito difнcil para se aprender e para se trabalhar com ele. Eu uso ele e sei disso. DOF2 й bem mais prбtico e tambйm nгo й nada lento, trabalhei muito com ele e nгo tenho oque reclamar. Abraзos. |
|
Atualmente o melhor й Y_INI, nгo contando com MySQL. Mais nгo seja obcecado por velocidade mais sim por comodidade e facilidade.
Y_Ini, se vocк for novato/iniciante, й muito difнcil para se aprender e para se trabalhar com ele. Eu uso ele e sei disso. DOF2 й bem mais prбtico e tambйm nгo й nada lento, trabalhei muito com ele e nгo tenho oque reclamar. Abraзos. |
?