/daradmin -
MarianaTorres - 18.04.2015
Olб pessoal blz?
Bom to com um bug aqui no meu /daradmin,й o seguinte,quando dou /daradmin [id] [level] ele dб admin para o player,porйm nгo salva o nick dele na pasta config/admins.cfg,ai quando eu vou dar /infoadmin para ver quem sгo os admins registrados nгo aparece,to tentando arduamente resolver mas nгo consigo,alguem pode me ajuda?
/daradmin
PHP код:
if(strcmp(cmd, "/daradmin", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] < 1340)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo pode usar esse comando.");
return 1;
}
VagaAdmins();
if(VagasLivresAdm == 0)
{
SendClientMessage(playerid, COLOR_GRAD1, "Nгo hб mais vagas na lista use /limparadmin primeiro.");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /daradmin [id] [Nivel]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /daradmin [id] [Nivel]");
return 1;
}
level = strval(tmp);
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[para1][pAdmin] == 1342)
{
return 1;
}
PlayerInfo[para1][pAdmin] = level;
format(string, sizeof(string), "Parabйns vocк acaba de receber level %d de Admin pelo %s", level, PlayerName(playerid));
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "Vocк promoveu %s para o level %d de Admin.", giveplayer,level);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
getdate(year, month, day);
gettime(hour,minute,second);
format(string, sizeof(string), "%s deu admin nivel %d para %s [%d/%d/%d] бs [%d:%d:%d].", sendername, level, giveplayer, day,month, year, hour, minute, second);
PAdminsLog(string);
new adminid = 0;
for(new i = 0; i < sizeof(AdmInfo); i++)
{
if(strcmp(giveplayer,AdmInfo[i][AdminNome],true)==0)
{
AdmInfo[i][AdminNivel] = level;
adminid = 1;
SalvarAdmins();
return 1;
}
}
if(adminid == 0)
{
for(new i = 0; i < sizeof(AdmInfo); i++)
{
if(strcmp("Ninguem",AdmInfo[i][AdminNome],true)==0)
{
strmid(AdmInfo[i][AdminNome], giveplayer, 0, strlen(giveplayer), 255);
AdmInfo[i][AdminNivel] = level;
SalvarAdmins();
return 1;
}
}
}
return 1;
}
}
}
}
return 1;
}
/infoadmin
PHP код:
if(strcmp("/infoadm", cmdtext, true, 10) == 0 || strcmp("/infoadmin", cmdtext, true, 10) == 0 || strcmp("/infoadmins", cmdtext, true, 10) == 0)
{
if(PlayerInfo[playerid][pAdmin] < 1)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo pode usar esse comando.");
return 1;
}
new lol = 0;
new arquivo[128];
SendClientMessage(playerid, COLOR_VERDE, "Administradores do BJA:");
while(lol < sizeof(AdmInfo))
{
if(lol == 0)
{
if(strcmp(AdmInfo[lol][AdminNome],"Ninguem",true) != 0)
{
format(arquivo, sizeof(arquivo), "Players/%s.ini",AdmInfo[lol][AdminNome]);
format(string, sizeof(string), "%s | Nivel: [Dono-Scripter] | Vaga:[%d]", AdmInfo[0][AdminNome], lol);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
}
else if(lol == 1)
{
if(strcmp(AdmInfo[lol][AdminNome],"Ninguem",true) != 0)
{
format(arquivo, sizeof(arquivo), "Players/%s.ini",AdmInfo[lol][AdminNome]);
format(string, sizeof(string), "%s | Nivel: [Dono] | Vaga:[%d]", AdmInfo[1][AdminNome], lol);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
}
else if(lol == 2)
{
if(strcmp(AdmInfo[lol][AdminNome],"Ninguem",true) != 0)
{
format(arquivo, sizeof(arquivo), "Players/%s.ini",AdmInfo[lol][AdminNome]);
format(string, sizeof(string), "%s | Nivel: [Sub-Dono] | Vaga:[%d]", AdmInfo[2][AdminNome], lol);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
}
else if(lol == 3)
{
if(strcmp(AdmInfo[lol][AdminNome],"Ninguem",true) != 0)
{
format(arquivo, sizeof(arquivo), "Players/%s.ini",AdmInfo[lol][AdminNome]);
format(string, sizeof(string), "%s | Nivel: [Ajudante Sub-Dono] | Vaga:[%d]", AdmInfo[3][AdminNome], lol);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
}
else if(lol == 4)
{
if(strcmp(AdmInfo[lol][AdminNome],"Ninguem",true) != 0)
{
format(arquivo, sizeof(arquivo), "Players/%s.ini",AdmInfo[lol][AdminNome]);
format(string, sizeof(string), "%s | Nivel: [Ajudante Sub-Dono] | Vaga:[%d]", AdmInfo[4][AdminNome], lol);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
}
else
{
if(strcmp(AdmInfo[lol][AdminNome],"Ninguem",true) != 0)
{
format(arquivo, sizeof(arquivo), "Players/%s.ini",AdmInfo[lol][AdminNome]);
format(string, sizeof(string), "%s | Nivel: [%d] | Vaga:[%d]", AdmInfo[lol][AdminNome],AdmInfo[lol][AdminNivel], lol);
SendClientMessage(playerid, COLOR_GRAD2, string);
}
}
lol++;
}
return 1;
}
Obrigadaa
Re: /daradmin -
ZeZin - 18.04.2015
Mande a funзгo
Re: /daradmin -
ipsLuan - 18.04.2015
Os GameModes denominados
BPC edit/GF edit tem este erro.
Aconselho que faзa um GameMode do 0 ou entгo re-faзa o sistema por completo.
Re: /daradmin -
MarianaTorres - 18.04.2015
Quote:
Originally Posted by ZeZin
|
PHP код:
public SalvarAdmins()
{
new idx;
new File: file2;
while (idx < sizeof(AdmInfo))
{
new coordsstring[256];
format(coordsstring, sizeof(coordsstring), "%s,%d|\n",AdmInfo[idx][AdminNome],AdmInfo[idx][AdminNivel]);
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;
}
Re: /daradmin -
Vegassilva - 18.04.2015
User DOF2 para salvar suas Contas de Admin ...
https://sampforum.blast.hk/showthread.php?tid=422519
Re: /daradmin -
MarianaTorres - 18.04.2015
Nгo ajudo em nd
Re: /daradmin -
Cleyson - 19.04.2015
Qual include de salvamento vocк usa ?
Re: /daradmin -
MarianaTorres - 19.04.2015
Dini
Re: /daradmin -
ipsLuan - 19.04.2015
Re-faz o sistema, acho bem mais viбvel.
Re: /daradmin -
MarianaTorres - 19.04.2015
Quote:
Originally Posted by Luan Argolo
Re-faz o sistema, acho bem mais viбvel.
|
Mas preciso achar o erro,qual erro estб?