22.12.2018, 01:10
Entгo meus amigos, o meu sistema de info й o seguinte vocк clica no nick da pessoa na tabela pra mostra players й mostra uma dialog com a info ai tipo quando estou setado de pm nгo da pra abrir a info nem pelo /info olhem os cmd.
PHP код:
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
{
if(!Player[clickedplayerid][pLogged])
return 0;
return showPlayerInfo(playerid, clickedplayerid);
}
static stock showPlayerInfo(playerid, target)
{
new org[30];
if(Player[playerid][BOPE] >= 1) { org = "BOPE"; }
if(Player[playerid][PMRJ] >= 1) { org = "PMRJ"; }
if(Player[playerid][Cargo] >= 0) { org = "Nenhuma"; }
Dialog[0] = EOS;
format(String, sizeof(String), ""#COLORT_WHITE"NICK: "#COLORT_GREY"%s\n\n", GetName(playerid));
strcat(Dialog, String);
format(String, sizeof(String), ""#COLORT_WHITE"Level: "#COLORT_GREY"%d\n", GetPlayerScore(target));
strcat(Dialog, String);
format(String, sizeof(String), ""#COLORT_WHITE"VIP: "#COLORT_GREY"%s\n", (Player[target][Vip] ? ("Sim") : ("Nгo")));
strcat(Dialog, String);
format(String, sizeof(String), ""#COLORT_WHITE"Dinheiro: "#COLORT_GREEN"%d\n", GetPlayerMoney(target));
strcat(Dialog, String);
format(String, sizeof(String), ""#COLORT_WHITE"Matou: "#COLORT_GREY"%d\n", Player[playerid][Killed]);
strcat(Dialog, String);
format(String, sizeof(String), ""#COLORT_WHITE"Morreu: "#COLORT_GREY"%d\n", Player[playerid][Died]);
strcat(Dialog, String);
format(String, sizeof(String), ""#COLORT_WHITE"Coins: "#COLORT_YELLOW"c%d\n", Player[target][Coins]);
strcat(Dialog, String);
format(String, sizeof(String), ""#COLORT_WHITE"Logou: "#COLORT_GREY"%d\n", Player[playerid][VezesLogadas]);
strcat(Dialog, String);
format(String, sizeof(String), ""#COLORT_WHITE"Venceu X1: "#COLORT_GREY"%d vezes\n", Player[target][XOneWin]);
strcat(Dialog, String);
format(String, sizeof(String), ""#COLORT_WHITE"Maconha: "#COLORT_GREY"%d\n", Player[playerid][Maconha]);
strcat(Dialog, String);
format(String, sizeof(String), ""#COLORT_WHITE"Cocaina: "#COLORT_GREY"%d\n", Player[playerid][Cocaina]);
strcat(Dialog, String);
format(String, sizeof(String), ""#COLORT_WHITE"Pertece а {%06x}%s\n", GetPlayerColor(target) >>> 8, GetNameFaccoes[Player[target][Faccoes]]);
strcat(Dialog, String);
format(String, sizeof(String), ""#COLORT_WHITE"Cargo: "#COLORT_GREY"%s\n", CargoFac(target));
strcat(Dialog, String);
format(String, sizeof(String), ""#COLORT_WHITE"Helper: "#COLORT_GREY"%s\n", (Player[target][Helper] ? ("Sim") : ("Nгo")));
strcat(Dialog, String);
format(String, sizeof(String), ""#COLORT_WHITE"Repуrter: "#COLORT_GREY"%s\n", (Player[target][Reporter] ? ("Sim") : ("Nгo")));
strcat(Dialog, String);
format(String, sizeof(String), ""#COLORT_WHITE"Admin: "#COLORT_GREY"%s\n", CargoAdmin_Info(target));
strcat(Dialog, String);
format(String, sizeof(String), ""#COLORT_WHITE"Organizaзгo: "#COLORT_GREY"%s", org);
strcat(Dialog, String);
return ShowPlayerDialog(playerid, DIALOG_MESSAGE, DIALOG_STYLE_MSGBOX, ""#COLOR_TITLE_DIALOG"Informaзхes da Conta", Dialog, "Fechar", "");
}
PHP код:
CMD:setpm(playerid,params[])
{
new
id,
level,
string[128]
;
if(Player[playerid][pLogged] == false) return SCM(playerid, COLOR_ORANGE, ""TAG_ERRO" Vocк nгo estб Logado para usar este comando!");
if(Player[playerid][Admin]>=4 || Player[playerid][PMRJ]>=5)
{
new cargotext[50];
if(Player[playerid][PMRJ] == 5) { cargotext = "Coronel"; }
if(Player[playerid][PMRJ] == 4) { cargotext = "Capitгo"; }
if(Player[playerid][PMRJ] == 3) { cargotext = "Sargento"; }
if(Player[playerid][PMRJ] == 2) { cargotext = "Soldado"; }
if(Player[playerid][PMRJ] == 1) { cargotext = "Recruta"; }
if(Player[playerid][Admin] == 5) { cargotext = "Game Master"; }
if(Player[playerid][Admin] == 4) { cargotext = "Sub Game Master"; }
if(sscanf(params,"ud",id,level)) return SCM(playerid, COLOR_GREY, ""TAG_USOCORRETO" /setpm <playerid> <level>");
if(level > 5) return SCM(playerid, COLOR_ORANGE, ""TAG_ERRO" Mбximo de Level a ser setado й 5.");
if(Player[playerid][pLogged] == false) return SCM(playerid, COLOR_ORANGE, ""TAG_ERRO" Este jogador nгo estб Logado.");
if(!(IsPlayerConnected(id))) return SCM(playerid, COLOR_ORANGE, ""TAG_ERRO" Este jogador nгo estб online.");
format(string,sizeof(string),"[System PMRJ]: O %s %s te setou de Level %d da Policia Militar.", cargotext, GetName(playerid), level);
SCM(id, COLOR_PMRJ,string);
format(string,sizeof(string),"[System PMRJ]: Vocк setou %s de Level %d da PMRJ.", GetName(id),level);
SCM(playerid, COLOR_PMRJ,string);
Player[id][PMRJ]=level;
Player[id][Faccoes]=13;
format(string, sizeof(string),"[System PMRJ]: O %s %s setou %s de Level %d da PMRJ.", cargotext, GetName(playerid), GetName(id), level);
MensagemAdmin(string);
format(string, 128,"[System PMRJ]: O %s %s setou %s de Level %d da PMRJ.", cargotext, GetName(playerid), GetName(id), level);
MensagemPmrj(string);
format(string, sizeof(string), "[System PMRJ]: O %s %s setou %s de Level %d da PMRJ.",cargotext, GetName(playerid), GetName(id), level);
Salvar_Conta(id);
printf("[System PMRJ]: O %s %s setou %s de Level %d da PMRJ.", cargotext, GetName(playerid), GetName(id), level);
}
else
{
SCM(playerid, COLOR_ORANGE, ""TAG_ERRO" Vocк nгo tem permissгo para usar este comando!");
}
return 1;
}