Some admin chat help please
#9

Okey, i tryed this code and added taked oway all the errors but when i type /a text i get command not found. But then i just type /a i get [ADMIN]Name[lvl thing]:/a ..
Here is the code without error:
pawn Код:
if(strcmp(cmdtext, "/a", true) == 0)
    {
      new idx;
        if(dini_Int(file, "admin") <1) return SendClientMessage(playerid, COLOR_YELLOW, "You are not admin!");
        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)) return SendClientMessage(playerid, COLOR_YELLOW, "Usage: /a [ur txt here]");
        new pname3[256];
        new string[256];
        GetPlayerName(playerid, pname3, sizeof(pname3));
        format(string,sizeof(string),"[ADMIN]: %s (lvl:%d): %s", pname3, PlayerInfo[playerid][Admin], result);
        for(new i=0;i<MAX_PLAYERS;i++)
        {
            if(dini_Int(file, "admin") >= 1)
            SendClientMessage(i,COLOR_ORANGE,string);
        }
        return 1;
    }
Reply


Messages In This Thread
Some admin chat help please - by Danand - 13.04.2009, 18:18
Re: Some admin chat help please - by luxeon - 13.04.2009, 19:16
Re: Some admin chat help please - by Danand - 13.04.2009, 19:20
Re: Some admin chat help please - by luxeon - 13.04.2009, 19:42
Re: Some admin chat help please - by Danand - 13.04.2009, 19:44
Re: Some admin chat help please - by luxeon - 13.04.2009, 19:46
Re: Some admin chat help please - by Danand - 13.04.2009, 19:49
Re: Some admin chat help please - by FranKyG70 - 13.04.2009, 20:02
Re: Some admin chat help please - by Danand - 13.04.2009, 20:50
Re: Some admin chat help please - by Danand - 14.04.2009, 04:51

Forum Jump:


Users browsing this thread: 1 Guest(s)