(/d)epartamento - jnXX - 26/11/2020
Olá, queria saber como que faço pra que apareça a profissão na frente no nick da pessoa no /d (no caso somente para as profissões policiais).
Código PHP: if(strcmp(cmd, "/d", true) == 0) { if(CHATDP[playerid] == true) { strmid(tmp, cmdtext, 2, strlen(cmdtext)); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GREY, ("USE: (/d)epartamento [texto]")); return 1; } else { foreach(Player, i) { if(pInfo[i][Prof] == GUARDA || pInfo[i][Prof] == PMILITAR || pInfo[i][Prof] == PCIVIL || pInfo[i][Prof] == PFEDERAL || pInfo[i][Prof] == DELEGADO || pInfo[i][Prof] == FBI || pInfo[i][Prof] == CIA || pInfo[i][Prof] == NARCOTICOS || pInfo[i][Prof] == SWAT || pInfo[i][Prof] == INTERPOL) { if(pInfo[i][NoTuto] == false) { if(CHATDP[i] == true) { format(gstring, sizeof(gstring), "**| Departamento | %s: %s **", PlayerName(playerid), tmp); SendClientMessage(i, COR_REDCLARO, gstring); }
} } } } } return 1; }
Tentei outras coisas mas resultavam em bastante erro
RE: (/d)epartamento - Kayke - 27/11/2020
tenta ver se funciona:
Código PHP: stock PlayerJob(playerid) { new job[128]; if(pInfo[playerid][Prof] == GUARDA) job = "Guarda"; else if(pInfo[playerid][Prof] == PMILITAR) job = "Polícia Militar"; else if(pInfo[playerid][Prof] == PCIVIL) job = "Polícia Civil"; else if(pInfo[playerid][Prof] == PFEDERAL) job = "Polícia Federal"; else if(pInfo[playerid][Prof] == DELEGADO) job = "Delegado"; else if(pInfo[playerid][Prof] == FBI) job = "FBI"; else if(pInfo[playerid][Prof] == CIA) job = "CIA"; else if(pInfo[playerid][Prof] == NARCOTICOS) job = "Narcótico"; else if(pInfo[playerid][Prof] == SWAT) job = "SWAT"; else if(pInfo[playerid][Prof] == INTERPOL) job = "Interpol"; else job = "Nenhum"; return job; } if(strcmp(cmd, "/d", true) == 0) { if(!CHATDP[playerid]) return SendClientMessage(playerid, COLOR_GREY, "ERRO: Seu chat de departamento está desativado.");
strmid(tmp, cmdtext, 2, strlen(cmdtext)); if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GREY, "USE: (/d)epartamento [texto]");
foreach(Player, i) { if(pInfo[i][Prof] == GUARDA || pInfo[i][Prof] == PMILITAR || pInfo[i][Prof] == PCIVIL || pInfo[i][Prof] == PFEDERAL || pInfo[i][Prof] == DELEGADO || pInfo[i][Prof] == FBI || pInfo[i][Prof] == CIA || pInfo[i][Prof] == NARCOTICOS || pInfo[i][Prof] == SWAT || pInfo[i][Prof] == INTERPOL) { if(!pInfo[i][NoTuto] && CHATDP[i]) { format(gstring, sizeof(gstring), "**| Departamento | %s: %s **", PlayerJob(playerid), PlayerName(playerid), tmp); SendClientMessage(i, COR_REDCLARO, gstring); } } } return 1; }
RE: (/d)epartamento - jnXX - 27/11/2020
(27/11/2020 00:06)Kayke Escreveu: tenta ver se funciona:
Código PHP: stock PlayerJob(playerid) { new job[128]; if(pInfo[playerid][Prof] == GUARDA) job = "Guarda"; else if(pInfo[playerid][Prof] == PMILITAR) job = "Polícia Militar"; else if(pInfo[playerid][Prof] == PCIVIL) job = "Polícia Civil"; else if(pInfo[playerid][Prof] == PFEDERAL) job = "Polícia Federal"; else if(pInfo[playerid][Prof] == DELEGADO) job = "Delegado"; else if(pInfo[playerid][Prof] == FBI) job = "FBI"; else if(pInfo[playerid][Prof] == CIA) job = "CIA"; else if(pInfo[playerid][Prof] == NARCOTICOS) job = "Narcótico"; else if(pInfo[playerid][Prof] == SWAT) job = "SWAT"; else if(pInfo[playerid][Prof] == INTERPOL) job = "Interpol"; else job = "Nenhum"; return job; } if(strcmp(cmd, "/d", true) == 0) { if(!CHATDP[playerid]) return SendClientMessage(playerid, COLOR_GREY, "ERRO: Seu chat de departamento está desativado.");
strmid(tmp, cmdtext, 2, strlen(cmdtext)); if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_GREY, "USE: (/d)epartamento [texto]");
foreach(Player, i) { if(pInfo[i][Prof] == GUARDA || pInfo[i][Prof] == PMILITAR || pInfo[i][Prof] == PCIVIL || pInfo[i][Prof] == PFEDERAL || pInfo[i][Prof] == DELEGADO || pInfo[i][Prof] == FBI || pInfo[i][Prof] == CIA || pInfo[i][Prof] == NARCOTICOS || pInfo[i][Prof] == SWAT || pInfo[i][Prof] == INTERPOL) { if(!pInfo[i][NoTuto] && CHATDP[i]) { format(gstring, sizeof(gstring), "**| Departamento | %s: %s **", PlayerJob(playerid), PlayerName(playerid), tmp); SendClientMessage(i, COR_REDCLARO, gstring); } } } return 1; }
deu certo manin +rep
|