Jump to content
  • 0

Ajutatma va rog problema /hc


Question

Posted

Playeri simpli pot scri pe /hc dar ei nu vad iar admini/helperi vad ca ei scriu...

if(strcmp(cmd, "/hc", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pMuted] == 1)
            {
                SendClientMessage(playerid, COLOR_WHITE, "Nu poti scrie in chat deoarece ai primit mute!");
                return 1;
            }
            GetPlayerName(playerid, sendername, sizeof(sendername));
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[64];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            result[0] = toupper(result[0]);
            if(!strlen(result))
            {
                SendClientMessage(playerid, COLOR_SERVER, "USAGE:{FFFFFF} /hc [text]");
                return 1;
            }
            new arank[256];
            if(PlayerInfo[playerid][pAdmin] == 1) arank = "Trial Admin";
            else if(PlayerInfo[playerid][pAdmin] == 2) arank = "Junior Admin";
            else if(PlayerInfo[playerid][pAdmin] == 3) arank = "Moderator";
            else if(PlayerInfo[playerid][pAdmin] == 4) arank = "Global Moderator";
            else if(PlayerInfo[playerid][pAdmin] == 5) arank = "Administrator";
            else if(PlayerInfo[playerid][pAdmin] == 6) arank = "Co-Owner";
            else if(PlayerInfo[playerid][pAdmin] == 7) arank = "Owner";
            if(PlayerInfo[playerid][pHelper] >= 1)
            {
                format(string, sizeof(string), "[Helper %d] %s: %s", PlayerInfo[playerid][pHelper], sendername, result);
                HBroadCast(COLOR_YELLOW, string);
            }
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(IsPlayerConnected(i) && PlayerInfo[pAdmin] >= 6)
                {
                    format(string, 256, "(/hc): Helper %s: %s", GetName(playerid), (result));
                    SCM(i, COLOR_YELLOW, string);
                }
            }
        }
        return 1;
    }

5 answers to this question

Recommended Posts

  • 0
Posted (edited)

Pui o restrictie daca lvl de helper e strict mai mic ca 1 sa returneze un mesaj.Daca nu reusesti un lucru asa simplu e nasol. Daca vrei sa scrie si admini pe /hc pui conditia ca daca are adm level <1 sa reurneze un mesaj

Edited by AddisoN
  • 0
Posted
Acum 8 ore, BaD_bOy_MD a spus:

Playeri simpli pot scri pe /hc dar ei nu vad iar admini/helperi vad ca ei scriu...

if(strcmp(cmd, "/hc", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pMuted] == 1)
            {
                SendClientMessage(playerid, COLOR_WHITE, "Nu poti scrie in chat deoarece ai primit mute!");
                return 1;
            }
            GetPlayerName(playerid, sendername, sizeof(sendername));
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[64];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            result[0] = toupper(result[0]);
            if(!strlen(result))
            {
                SendClientMessage(playerid, COLOR_SERVER, "USAGE:{FFFFFF} /hc [text]");
                return 1;
            }
            new arank[256];
            if(PlayerInfo[playerid][pAdmin] == 1) arank = "Trial Admin";
            else if(PlayerInfo[playerid][pAdmin] == 2) arank = "Junior Admin";
            else if(PlayerInfo[playerid][pAdmin] == 3) arank = "Moderator";
            else if(PlayerInfo[playerid][pAdmin] == 4) arank = "Global Moderator";
            else if(PlayerInfo[playerid][pAdmin] == 5) arank = "Administrator";
            else if(PlayerInfo[playerid][pAdmin] == 6) arank = "Co-Owner";
            else if(PlayerInfo[playerid][pAdmin] == 7) arank = "Owner";
            if(PlayerInfo[playerid][pHelper] >= 1)
            {
                format(string, sizeof(string), "[Helper %d] %s: %s", PlayerInfo[playerid][pHelper], sendername, result);
                HBroadCast(COLOR_YELLOW, string);
            }
            for(new i = 0; i < MAX_PLAYERS; i++)
            {
                if(IsPlayerConnected(i) && PlayerInfo[pAdmin] >= 6)
                {
                    format(string, 256, "(/hc): Helper %s: %s", GetName(playerid), (result));
                    SCM(i, COLOR_YELLOW, string);
                }
            }
        }
        return 1;
    }

pune if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 1)

  • Upvote 1

FiveGame  Lands

Pawno Developer, Mapping , Scripter

Since 2016

  • 0
Posted
Acum 3 minute, Geani a spus:

pune if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 1)

Atunci Helperi si playeri simpli nu pot iar admini pot

  • 0
  • Administrator
Posted

Duplicat la

Daca faci mai multe subiecte nu o sa primesti ajutor mai repede.

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.