[Help] /helpme System.
#1

Can someone explain me how can I make a simple helpers system and /helpme command?
Reply
#2

You need to first of all, script the helper variable in the playerinfo enum, or what ever you've scripted.
Then, you need to make a /makehelper command, which is good IMO.
Then, you can do a /helpme command, that will send a message to all players.
Here's the /askq from my script, same as /helpme.
pawn Код:
if(strcmp(cmd, "/askq", true) == 0) {
        if(IsPlayerConnected(playerid)) {
            if(Mute[playerid] == 1) {
                SendClientMessage(playerid, TEAM_CYAN_COLOR, "You can't speak, you have been silenced !");
                return 1;
            }
            GetPlayerName(playerid, sendername, sizeof(sendername));
            GiveNameSpace(sendername);
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' ')) {
                idx++;
            }
            new offset = idx;
            new result[128];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            if(!strlen(result)) {
                SendClientMessage(playerid, COLOR_GRAD2, "[{EE5555}USAGE{FFFFFF}]: /askq [text]");
                return 1;
            }
            format(string, sizeof(string), "Question from %s ID:[%i]: %s", sendername, playerid, (result));
            SendHelperMessage(COLOR_ASKQ, string);
            SendAdminMessage(COLOR_ASKQ, string);
            SendClientMessage(playerid, COLOR_GREEN, "Your question has been sent to all online supporters.");
        }
        return 1;
    }
My SendHelperMessage function :
pawn Код:
forward SendHelperMessage(color, string[]);
public SendHelperMessage(color, string[])
{
    foreach (Player,i) {
        if(gPlayerLogged[i] == 1) {
            if(PlayerInfo[i][pHelper] == 1) {
                SendClientMessage(i, color, string);
            }
        }
    }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)