SA-MP Forums Archive
/hc help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /hc help (/showthread.php?tid=506866)



/hc help - lulo356 - 14.04.2014

If you are a admin, and not a helper, you cant talk in the /hc, well you can but its not showing the text.
pawn Код:
CMD:hc(playerid, params[])
{
    new string[128];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(!PlayerInfo[playerid][pHelper] && !PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
    if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /hc [text]");
    if(AntiAdv(playerid, params)) return 1;
    if(PlayerInfo[playerid][pHelper] && !PlayerInfo[playerid][pAdmin]) format(string, sizeof(string), "** %s %s: %s", RPHLN(playerid), RPN(playerid), params);
    foreach(Player, i)
    {
        if(IsPlayerLoggedIn(i))
        {
            if(PlayerInfo[i][pHelper] || PlayerInfo[i][pAdmin])
            {
                SendClientMessage(i, COLOR_LIME, string);
            }
        }
    }
    // Logs
    if(PlayerInfo[playerid][pHelper] && !PlayerInfo[playerid][pAdmin]) format(string, sizeof(string), "*%s %s: %s", RPHLN(playerid), RPN(playerid), params);
    else if(!PlayerInfo[playerid][pHelper] && PlayerInfo[playerid][pAdmin])format(string, sizeof(string), "*%s %s: %s", RPALN(playerid), RPN(playerid), params);
    Log("logs/helperchat.log", string);
    return 1;
}



Re: /hc help - RenSoprano - 14.04.2014

&& mean that you need to be helper and admin to use this command you can use || this mean you need to be helper or admin


Re: /hc help - lulo356 - 14.04.2014

Quote:
Originally Posted by RenSoprano
Посмотреть сообщение
&& mean that you need to be helper and admin to use this command you can use || this mean you need to be helper or admin
Alright, let me check <3


Re: /hc help - GloomY - 15.04.2014

Код:
CMD:hc(playerid, params[])
{
    new string[128];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(!PlayerInfo[playerid][pHelper] && !PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
    if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /hc [text]");
    if(AntiAdv(playerid, params)) return 1;
    if(PlayerInfo[playerid][pHelper] || PlayerInfo[playerid][pAdmin]) format(string, sizeof(string), "** %s %s: %s", RPHLN(playerid), RPN(playerid), params);
    foreach(Player, i)
    {
        if(IsPlayerLoggedIn(i))
        {
            if(PlayerInfo[i][pHelper] || PlayerInfo[i][pAdmin])
            {
                SendClientMessage(i, COLOR_LIME, string);
            }
        }
    }
    // Logs
    if(PlayerInfo[playerid][pHelper] && !PlayerInfo[playerid][pAdmin]) format(string, sizeof(string), "*%s %s: %s", RPHLN(playerid), RPN(playerid), params);
    else if(!PlayerInfo[playerid][pHelper] && PlayerInfo[playerid][pAdmin])format(string, sizeof(string), "*%s %s: %s", RPALN(playerid), RPN(playerid), params);
    Log("logs/helperchat.log", string);
    return 1;
}