/daradmin e /limparadmin bugado! '-' -
JohnScript - 19.11.2012
Oi estou aqui com um erro tipo quando eu vou /daradmin(eu meti para nivel 0 civil poder dar para eu dar pq nao grava nas scriptfiles)o sistema diz ``Nгo hб mais vagas use /limparadmґґ ae eu limpo uma vaga ate ja limpei todas(15) e n deu na mesma? Alguem me ajuda?
Code /daradmin aqui:
Код:
if(strcmp(cmd, "/daradmin", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] < 0 && ServerOwner[playerid] != 1)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo tem autorizaзгo para usar esse comando.");
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));
format(string, sizeof(string), " Vocк foi promovido para level %d de Admin - Por %s", level, sendername);
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), " Vocк promoveu o(a) %s Para o level %d de Admin.", giveplayer,level);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
if(ServerOwner[para1] == 1)
{
strmid(AdmInfo[0][gMembro], PlayerName(para1), 0, strlen(PlayerName(para1)), 255);
PlayerInfo[para1][pAdmin] = level;
AdmInfo[0][AdminAtivo] = 1;
//SaveAdm();
return 1;
}
for(new i = 0; i < sizeof(AdmInfo); i++)
{
if(PlayerInfo[para1][pAdmin] > 0 && strcmp(AdmInfo[i][gMembro],PlayerName(playerid),true) == 0)
{
if(level == 0)
{
Code /limparadmin:
Код:
if(strcmp(cmd, "/limparadmin", true) == 0 || strcmp(cmd, "/limparadm", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] < 0)
{
SendClientMessage(playerid, COLOR_GRAD2, "Vocк nгo estб autorizado a usar este comando!");
return 1;
}
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /limparadm [ Vaga ]");
return 1;
}
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: /limparadmin [ID da Vaga] [Motivo]");
return 1;
}
new Vagao = strval(tmp), idpl, str[64];
if(Vagao < 1 || Vagao > 15) { SendClientMessage(playerid, COLOR_GREY, "Vaga mнnima 1 mбximo 15!"); return 1; }
if(IsPlayerOnline(AdmInfo[Vagao][gMembro]))
{
idpl=GetPlayerID(AdmInfo[Vagao][gMembro]);
admtrampando[idpl] = 0;
KillTimer(TempoAdministrador);
SetPlayerToTeamColor(idpl);
ResetPlayerWeapons(idpl);
SetPlayerHealth(idpl,100);
PhoneOnline[idpl] = 0;
SendClientMessage(idpl, 0x808080AA, "Vocк Saiu de modo Trabalho, e seu celular foi Ligado Automaticamente!");
ContarAdmin --;
PlayerInfo[idpl][pAdmin] = 0;
format(string, sizeof(string), "[BWG SERVER]:{FF0000} Vocк Foi Retirado da Staff Motivo: %s",result);
SendClientMessage(idpl, 0x0000FFAA, string);
}
else
{
format(str, sizeof(str), "Agendados/ADM%s.ini",AdmInfo[Vagao][gMembro]);
dini_Create(str);
dini_Set(str,"Nome",PlayerName(playerid));
dini_Set(str,"Motivo",result);
}
strmid(AdmInfo[Vagao][gMembro], "Vazio", 0, strlen("Vazio"), 255);
AdmInfo[Vagao][AdminAtivo] = 0;
//SaveAdm();
format(string, sizeof(string), "Vocк Limpou A Vaga Nє %d, Motivo: %s ",Vagao,result);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
return 1;
}
Re: /daradmin e /limparadmin bugado! '-' -
duuuwh - 19.11.2012
Tenta limpar pela scriptfiles.
@Edit.
Nem vi que nгo dб pra gravar no seu scriptfiles, mau.. anula minha resposta! (;
Re: /daradmin e /limparadmin bugado! '-' -
JohnScript - 19.11.2012
Oi afinal deu para gravar era um bug que era da ScriptFiles!
Mas e se eu quiser /daradmin in game nao consigo sу pela ScriptFiles