need help with helper chat. -
RODELA - 26.04.2018
i want admins can also talk at /hc even they are not helpers...
here is the codes :
Код:
CMD:hc(playerid, params[])
{
if(PlayerInfo[playerid][pHelper] < 1)
{
return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
}
if(isnull(params))
{
return SendClientMessage(playerid, COLOR_GREY3, "[Usage]: /hc [helper chat]");
}
if(PlayerInfo[playerid][pToggleHelper])
{
return SendClientMessage(playerid, COLOR_GREY, "You can't speak in the helper chat as you have it toggled.");
}
foreach(new i : Player)
{
if(PlayerInfo[i][pHelper] > 0 && !PlayerInfo[i][pToggleHelper])
{
if(strlen(params) > MAX_SPLIT_LENGTH)
{
SendClientMessageEx(i, COLOR_AQUA, "** %s %s: %.*s... **", GetHelperRank(playerid), GetPlayerRPName(playerid), MAX_SPLIT_LENGTH, params);
SendClientMessageEx(i, COLOR_AQUA, "** %s %s: ...%s **", GetHelperRank(playerid), GetPlayerRPName(playerid), params[MAX_SPLIT_LENGTH]);
}
else
{
SendClientMessageEx(i, COLOR_AQUA, "** %s %s: %s **", GetHelperRank(playerid), GetPlayerRPName(playerid), params);
}
}
}
return 1;
}
Re: need help with helper chat. -
IceBilizard - 26.04.2018
try this
PHP код:
CMD:hc(playerid, params[])
{
if(PlayerInfo[playerid][pHelper] < 1 || PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(isnull(params)) return SendClientMessage(playerid, COLOR_GREY3, "[Usage]: /hc [helper chat]");
if(PlayerInfo[playerid][pToggleHelper]) return SendClientMessage(playerid, COLOR_GREY, "You can't speak in the helper chat as you have it toggled.");
foreach(new i : Player)
{
if(PlayerInfo[i][pHelper] > 0 && !PlayerInfo[i][pToggleHelper] && PlayerInfo[i][pAdmin] > 0)
{
if(strlen(params) > MAX_SPLIT_LENGTH)
{
SendClientMessageEx(i, COLOR_AQUA, "** %s %s: %.*s... **", GetHelperRank(playerid), GetPlayerRPName(playerid), MAX_SPLIT_LENGTH, params);
SendClientMessageEx(i, COLOR_AQUA, "** %s %s: ...%s **", GetHelperRank(playerid), GetPlayerRPName(playerid), params[MAX_SPLIT_LENGTH]);
}
else
{
SendClientMessageEx(i, COLOR_AQUA, "** %s %s: %s **", GetHelperRank(playerid), GetPlayerRPName(playerid), params);
}
}
}
return 1;
}
Re: need help with helper chat. -
RODELA - 26.04.2018
now saying "You are not authorized to use this command." i am lvl 7 admin.
Re: need help with helper chat. -
Bruno13 - 26.04.2018
Try it:
PHP код:
if(!(PlayerInfo[playerid][pHelper] > 1 || PlayerInfo[playerid][pAdmin] > 1))
{
return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
}
Re: need help with helper chat. -
IceBilizard - 26.04.2018
PHP код:
if(PlayerInfo[playerid][pHelper] < 1 && PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
Re: need help with helper chat. -
RODELA - 26.04.2018
no message when i type /hc Hello
Re: need help with helper chat. -
RODELA - 26.04.2018
but helpers can see my message but i can't see their Message....
Re: need help with helper chat. -
IceBilizard - 26.04.2018
change this
PHP код:
foreach(new i : Player)
{
if(PlayerInfo[i][pHelper] > 0 && !PlayerInfo[i][pToggleHelper] || PlayerInfo[i][pAdmin] > 0)
{
if(strlen(params) > MAX_SPLIT_LENGTH)
{
SendClientMessageEx(i, COLOR_AQUA, "** %s %s: %.*s... **", GetHelperRank(playerid), GetPlayerRPName(playerid), MAX_SPLIT_LENGTH, params);
SendClientMessageEx(i, COLOR_AQUA, "** %s %s: ...%s **", GetHelperRank(playerid), GetPlayerRPName(playerid), params[MAX_SPLIT_LENGTH]);
}
else
{
SendClientMessageEx(i, COLOR_AQUA, "** %s %s: %s **", GetHelperRank(playerid), GetPlayerRPName(playerid), params);
}
}
}
and give a try
Re: need help with helper chat. -
RODELA - 26.04.2018
worked thanks Both of you

+Rep.