PHP код:
tenta esti ai
topo gm
enum Helper
{
hMembro[MAX_PLAYER_NAME],HelperVaga,
};
new HelperInfo[21][Helper];
public HelperCheck(playerid){new idx = 0;while(idx < sizeof(HelperInfo)){if(strcmp(HelperInfo[idx][hMembro],PlayerName(playerid), true ) == 0 ){return true;}idx++;}return 0;}
public HelpersVaga()
{
new storedcopname[64];
new File: file = fopen("Configs/Helpers.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 true;
}
}
}
fclose(file);VagaSobrando = 0;return 0;
}
//---------------------------------------------------------
if(strcmp(cmd, "/darhelper", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] < 5)
{
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: /darhelper [ id ] [Level 0 б 300]");
return true;
}
new para2;
new level2;
para2 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level2 = strval(tmp);
GetPlayerName(playerid, sendername, 256);
{
if(IsPlayerConnected(para2))
{
if(para2 != INVALID_PLAYER_ID)
{
GetPlayerName(para2, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para2][pHelper] = level2;
printf("ADMIN CMD: %s promoveu %s a level %d de helper.", sendername, giveplayer, level2);
// ShowPlayerDialog(playerid, 9680, DIALOG_STYLE_MSGBOX, "{FF34B3}ADM", "Acdasdhauda.", "Avanзar", "Cancelar");
//PlayerInfo[para2][pHelper] = level2;
format(string, sizeof(string), " Voce foi promovido para level %d de Helper - Por %s", level2, PlayerName(playerid));
SendClientMessage(para2, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), " Voce promoveu o(a) %s Para o level %d de Helper.", giveplayer,level2);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "%s Promoveu %s a Helper level %d ",sendername,giveplayer,level2);
SaveHelper();
}
}
SendClientMessage(playerid, COLOR_LIGHTGREEN, "[BLP]: Voce nгo esta autorizado a usar este comando!");
}
}
return true;
}
if (strcmp(cmd, "/helpers", true) == 0)
{
SendClientMessage(playerid, COLOR_WHITE, "|______________ Helpers Online ______________|");
for(new i = 0; i <= MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) == 1 && PlayerInfo[i][pHelper] > 0)
{
if(helperhide[i] == 0)
{
GetPlayerName(i, sendername, sizeof(sendername));
new lolhel[20];
if(PlayerInfo[i][pHelper] >= 1 && PlayerInfo[i][pHelper] <= 60)
{
lolhel = "Novato";
}
if(PlayerInfo[i][pHelper] >= 61 && PlayerInfo[i][pHelper] <= 150)
{
lolhel = "Auxiliar";
}
if(PlayerInfo[i][pHelper] >= 151 && PlayerInfo[i][pHelper] <= 300)
{
lolhel = "Master";
}
if(away[i] == 0)
{
if(helpertrampando[i] == 1)
{
format(string, 128, "{98F5FF}%s {FFFFFF}[%s] {98F5FF}(Trabalhando)", sendername, lolhel);
SendClientMessage(playerid, COLOR_WHITE, string);
}
else
{
format(string, 128, "{9AFF9A}%s {FFFFFF}[%s] {9AFF9A}(Jogando)", sendername, lolhel);
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
else
{
format(string, 128, "{FF4040}%s {FFFFFF}[%s] {FF4040}(Ausente)", sendername, lolhel);
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
}
}
return true;
}
if (strcmp(cmd, "/infohelper", true) == 0 || strcmp(cmd, "/infohelpers", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] < 4)
{
SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo tem autorizaзгo para usar esse comando.");
return true;
}
new lolt = 0;
new arquivo[128];
SendClientMessage(playerid, COLOR_WHITE, "|______________[ Helpers do Server ]______________|");
while (lolt < sizeof(HelperInfo))
{
if(lolt == 0)
{
format(string, sizeof(string), "Master: %s", HelperInfo[0][hMembro]);
SendClientMessage(playerid, COLOR_AZULBB, string);
}
else
{
if(strcmp(HelperInfo[lolt][hMembro],"Vazio",true) != 0)
{
if(PlayerInfo[playerid][pAdmin] == 5)
{
format(arquivo, sizeof(arquivo), "Contas/%s.ini",HelperInfo[lolt][hMembro]);
format(string, sizeof(string), "Vaga %d: %s, Cargo: %d", lolt, HelperInfo[lolt][hMembro],dini_Int(arquivo,"HelperLevel"));
SendClientMessage(playerid, COLOR_AZULBB, string);
}
else
{
format(arquivo, sizeof(arquivo), "Contas/%s.ini",HelperInfo[lolt][hMembro]);
format(string, sizeof(string), "Vaga %d: %s", lolt, HelperInfo[lolt][hMembro]);
SendClientMessage(playerid, COLOR_AZULBB, string);
}
}
}
lolt++;
}
return true;
}
if (strcmp(cmd, "/limparhelper", true) == 0 || strcmp(cmd, "/limparhelpers", true) == 0){if(PlayerInfo[playerid][pAdmin] < 4){SendClientMessage(playerid, COLOR_GRAD2, "Vocк nгo estб autorizado a usar este comando!");return true;}tmp = strtok(cmdtext, idx);if(!strlen(tmp)){SendClientMessage(playerid, COLOR_GRAD2, "USE: /limparhelper [ Vaga ]");return true;}new Vagao = strval(tmp);
if(Vagao < 1 || Vagao > 20) { SendClientMessage(playerid, COLOR_GREY, "Vaga mнnima 1 mбximo 20!"); return true; }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, HelperInfo[Vagao][hMembro], day,
month, year, hour, minute, second);PHelpersLog(string);strmid(HelperInfo[Vagao][hMembro], "Vazio", 0, strlen("Vazio"), 255);HelperInfo[Vagao][HelperVaga] = 0;SaveHelper();format(string, sizeof(string), "Vocк Limpou A Vaga Nє %d",Vagao);SendClientMessage(playerid, COLOR_LIGHTBLUE, string);return true;}
if(strcmp(cmd, "/meavalie", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pHelper] >= 1)
{
tmp = strtok(cmdtext,idx);
giveplayerid = ReturnUser(tmp);
if(Avaliado[playerid] == 1)
{
format(string,sizeof(string),"Vocк tem que esperar 5 minutos para poder enviar um /meavalie de novo.");
SendClientMessage(playerid, COLOR_GRAD1, string);
return true;
}
if(!strlen(tmp))
{
SendClientMessage(playerid,COLOR_GRAD1,"USE: /meavalie [ID/Nome]");
return true;
}
if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GRAD1, "Vocк nгo pode pedir avaliaзгo a si mesmo!"); return true; }
if(IsPlayerConnected(giveplayerid))
{
Avaliado[playerid] = 1;
PedirAvaliar = playerid;
TempoAvaliar[playerid] = SetTimerEx("Avaliar", 120000, 0, "i", playerid);
SendClientMessage(playerid, VERDE2, "Vocк enviou o seu pedido de avaliaзгo, aguarde resposta!");
format(string,sizeof(string)," {00FF00}Helper %s: {FFFFFF}gostou da minha ajuda ?",PlayerName(playerid));
ShowPlayerDialog(giveplayerid, 9282, DIALOG_STYLE_MSGBOX, "Avaliaзгo do Helper", string, "Sim", "Nao");
}
}
}
return true;
}