[Ajuda] O que tem de errado nesses comandos? -
WiliHacking - 29.12.2016
Esses dois comandos nгo estгo funcionando, eu digito "/h Teste" e nгo aparece nada, o mesmo ocorre com /ah, agradeзo a quem ajuda.
PHP код:
CMD:h(playerid, result[])
{
GetPlayerName(playerid, sendername, sizeof(sendername));
if(isnull(result))
{
SendClientMessage(playerid, COLOR_GRAD2, "USE: (/h ou /hc)helper [helper chat]");
return true;
}
if (PlayerInfo[playerid][pHelper] >= 1)
{
new string[128];
format(string, sizeof(string), "*%d Helper %s: %s", PlayerInfo[playerid][pHelper], sendername, result);
SendHelperMessage(COR_HELPER, string);
PLLogs("helperchat", string);
printf("Helper %s: %s", sendername, result);
}
return true;
}
CMD:ah(playerid, result[])
{
GetPlayerName(playerid, sendername, sizeof(sendername));
if(isnull(result))
{
return SendClientMessage(playerid, COLOR_GRAD2, "USE: (/ah)dmin/helper [admin/helper chat]");
}
new string[128];
if(PlayerInfo[playerid][pAdmin] >= 1)
{
format(string, sizeof(string), "*%d Admin %s: %s", PlayerInfo[playerid][pAdmin], sendername, result);
ChatHelperAdmin(COLOR_YELLOW2,string);
PLLogs("AdminHelperChat", string);
}
else if(PlayerInfo[playerid][pHelper] >= 1)
{
format(string, sizeof(string)," *%d Helper %s: %s", PlayerInfo[playerid][pHelper], sendername, result);
ChatHelperAdmin(COLOR_YELLOW2, string);
PLLogs("AdminHelperChat", string);
}
return 1;
}
public SendHelperMessage(COLOR, striing[])
{
for(new i=1; i != MAX_ADMINS; i++)
{
if(PlayerInfo[i][pHelper] >= 1)
{
SendClientMessage(i, COLOR, striing);
}
}
return 1;
}
public ChatHelperAdmin(COLOR,const striing[])
{
for(new i=1; i != MAX_ADMINS; i++)
{
if(PlayerInfo[i][pHelper] >= 1 || PlayerInfo[i][pAdmin] >= 1)
{
SendClientMessage(i, COLOR, striing);
printf("%s", striing);
}
}
return 1;
}
Respuesta: [Ajuda] O que tem de errado nesses comandos? -
SammyJ - 29.12.2016
PHP код:
public SendHelperMessage(COLOR, const striing[])
{
for(new i=1; i != MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pHelper] >= 1)
{
SendClientMessage(i, COLOR, striing);
}
}
return 1;
}
public ChatHelperAdmin(COLOR, const striing[])
{
for(new i=1; i != MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pHelper] >= 1 || PlayerInfo[i][pAdmin] >= 1)
{
SendClientMessage(i, COLOR, striing);
printf("%s", striing);
}
}
return 1;
}
Re: [Ajuda] O que tem de errado nesses comandos? -
WiliHacking - 31.12.2016
Continua bugado mano.
Re: [Ajuda] O que tem de errado nesses comandos? -
MultiKill - 31.12.2016
O cуdigo do
Glederson_dom esta quase certo, o ъnico erro que ele nгo arrumou foi a variбvel i comeзar com o valor 1.
Por causa disso caso o seu id for 0 ele nгo irб mostrar a mensagem para vocк.
PHP код:
public SendHelperMessage(COLOR, const striing[])
{
for(new i, j = GetPlayerPoolSize(); i <= j; i++)
{
if(IsPlayerConnected(i) && PlayerInfo[i][pHelper] >= 1)
{
SendClientMessage(i, COLOR, striing);
}
}
return 1;
}
public ChatHelperAdmin(COLOR, const striing[])
{
for(new i, j = GetPlayerPoolSize(); i <= j; i++)
{
if(IsPlayerConnected(i) && (PlayerInfo[i][pHelper] >= 1 || PlayerInfo[i][pAdmin] >= 1))
{
SendClientMessage(i, COLOR, striing);
printf("%s", striing);
}
}
return 1;
}