Vc С Esta... -
felipe_mr - 11.11.2012
Gente estou com um poblema no /daradmin se eu digito vai tudo normal funciona mais aparece a mensagem BPL: Voce nгo esta autorizado a usar este comando! mesmo eu podendo. Mas o ADM entra normal sу quero arrumar o BUG da mensagem:
PHP код:
if(strcmp(cmd, "/daradmin", true) ==0 )
{
GetPlayerName(playerid, sendername, 256);
if(strcmp(sendername,"felipe_mr",true)==0 || strcmp(sendername,"123454645616131",true)==0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "BPL: /daraadmin [ id ] [Level 0 б 1342]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
GetPlayerName(playerid, sendername, 256);
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pAdmin] = level;
printf("ADMIN CMD: %s has promoted %s to a level %d admin.", sendername, giveplayer, level);
format(string, sizeof(string), " Voce foi promovido para level %d de Admin - Por %s", level, sendername);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), " Voce promoveu o(a) %s Para o level %d de Admin.", giveplayer,level);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "%s Promoveu %s a adm level %d ",sendername,giveplayer,level);
}
}
SendClientMessage(playerid, COLOR_LIGHTGREEN, "BPL: Voce nгo esta autorizado a usar este comando!");
}
}
return 1;
}
Re: Vc С Esta... -
BielCOP - 11.11.2012
vou FazeR um cmd novo paRa vc e colocaR no PASTEBIN.
Daqui a pouco eu ediTo.
@EDIT:
CLICK
GosTou ? nao pRecisa daR mais REP n kk, so queRo aJudaR mesmo.
OBS: Cmd sem BUGs.
Re: Vc С Esta... -
felipe_mr - 11.11.2012
Mais tambem vai dar para usar nesses 2 CMDS ?
PHP код:
if (strcmp("/limparadm", cmdtext, true, 10) == 0 || strcmp("/limparadmin", cmdtext, true, 10) == 0)
{
if(PlayerInfo[playerid][pAdmin] < 1342)
{
MSGPLAYER(playerid, COLOR_GRAD2, "Vocк nгo estб autorizado a usar este comando!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
MSGPLAYER(playerid, COLOR_GRAD2, "USE: /limparadm [ Vaga ]");
return 1;
}
new Vagao = strval(tmp);
if(Vagao < 1 || Vagao > 30) { MSGPLAYER(playerid, COLOR_GREY, "Vaga mнnima 1 mбximo 30!"); return 1; }
getdate(year, month, day);
gettime(hour,minute,second);
format(string, sizeof(string), "%s apagou a vaga %d de %s [%d/%d/%d] бs [%d:%d:%d].", PlayerName(playerid), Vagao, AdmInfo[Vagao][gMembro], day,
month, year, hour, minute, second);
PAdminsLog(string);
strmid(AdmInfo[Vagao][gMembro], "Vazio", 0, strlen("Vazio"), 255);
AdmInfo[Vagao][AdminVaga] = 0;
SaveAdm();
format(string, sizeof(string), "Vocк Limpou A Vaga Nє %d",Vagao);
MSGPLAYER(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
if (strcmp("/admins_2", cmdtext, true, 10) == 0)
{
new lol = 0;
new arquivo[128];
MSGPLAYER(playerid, COLOR_GRAD2, "(=-=-=-=-=-=-=-=-=-=({FFD700}Admins do Server{BFC0C2})=-=-=-=-=-=-=-=-=-=)");
while (lol < sizeof(AdmInfo))
{
if(lol == 0)
{
format(string, sizeof(string), "Fundador/Scripter: %s", AdmInfo[0][gMembro]);
MSGPLAYER(playerid, 0xFA500AA, string);
}
Re: Vc С Esta... -
BielCOP - 11.11.2012
vai sim. queR mais uma amosTRa dos dois ?
Caso de alGum BUG й sу me chamaR no SKP ou MSN.
Re: Vc С Esta... -
felipe_mr - 11.11.2012
PF posta aki como php pq o codigo tem muito espaco quando vai colocar no GM buga tudo
@EDIT
E tambem salva na script files para quando for limpar o Adm ??
Re: Vc С Esta... -
BielCOP - 11.11.2012
Bom, se o Gm EsTiveR paRa salvaR, salva.
aGoRa o codiGo q eu coloquei nao salva, pq й uma cуpia do seu codiGo, que nao salvava.
PaRa salvaR, vc deve colocaR = SaveAdm();
Re: Vc С Esta... -
felipe_mr - 11.11.2012
PHP код:
enum Admin
{
gMembro[MAX_PLAYER_NAME],
AdminVaga,
};
new AdmInfo[31][Admin];
forward AdmCheck(playerid);
forward AdmsVaga();
public AdmCheck(playerid)
{
new idx = 0;
while(idx < sizeof(AdmInfo))
{
if(strcmp(AdmInfo[idx][gMembro],PlayerName(playerid), true ) == 0 )
{
return 1;
}
idx++;
}
return 0;
}
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 LoadAdm();
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;
}
public LoadAdm()
{
new arrCoords[2][64];
new strFromFile2[256];
new File: file = fopen("Configs/Admins.cfg", io_read);
if (file)
{
new idx = 0;
while(idx < sizeof(AdmInfo))
{
fread(file, strFromFile2);
split(strFromFile2, arrCoords, ',');
strmid(AdmInfo[idx][gMembro], arrCoords[0], 0, strlen(arrCoords[0]), 255);
AdmInfo[idx][AdminVaga] = strval(arrCoords[1]);
idx++;
}
}
fclose(file);
return 1;
}
Re: Vc С Esta... -
Zona_Sky - 11.11.2012
hг, logo na rcon?
(ser simplesmente so for a menssagem esso troca ela).
ser foi o que eu entendi.