Local /me command script.
#2

pawn Код:
if(strcmp(cmd, "/me", true) == 0)
    {
      if(IsPlayerConnected(playerid))
      {
        if(gPlayerLogged[playerid] == 0)
        {
          SendClientMessage(playerid, COLOR_GREY, "  You havent logged in yet !");
          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;
            if(!strlen(result))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /me [action]");
                return 1;
            }
            if(PlayerInfo[playerid][pMaskuse] == 1)
            {
              format(string, sizeof(string), "* Stranger %s", result);
            }
            else
            {
                format(string, sizeof(string), "* %s %s", sendername, result);
            }
            ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
            printf("%s", string);
        }
        return 1;
    }
Displays as purple /me, like many RP servers do.
Reply


Messages In This Thread
Local /me command script. - by Waynewayne - 13.03.2010, 19:31
Re: Local /me command script. - by Crezy-Boy - 13.03.2010, 19:33
Re: Local /me command script. - by Waynewayne - 13.03.2010, 19:36
Re: Local /me command script. - by RP Addict - 13.03.2010, 19:41
Re: Local /me command script. - by Chriham3 - 13.03.2010, 19:45
Re: Local /me command script. - by Waynewayne - 13.03.2010, 19:47
Re: Local /me command script. - by Zimon95 - 13.03.2010, 19:49
Re: Local /me command script. - by Waynewayne - 13.03.2010, 19:50
Re: Local /me command script. - by Waynewayne - 13.03.2010, 19:55
Re: Local /me command script. - by RP Addict - 13.03.2010, 19:57

Forum Jump:


Users browsing this thread: 1 Guest(s)