i got error 033 pls help
#1

i want to make an admin chat only i got an error can someone help me?


C:\Program Files\Rockstar Games\script\gamemodes\gmd.pwn(1577) : error 033: array must be indexed (variable "text")

pawn Код:
dcmd_achat(playerid, params[])
{
if(AdminLevel [playerid] == 0) return SendClientMessage(playerid, RED, "You need to be an admin!"); // line 1577
new text[128];
if((params, "s",text)) return SendClientMessage(playerid, APINK, "Usage: /achat [Text]");
format(text,sizeof(text),""white"Admin "PINK"%s "white"| Text: "PINK"%s",GetName(playerid),params[0]);
foreach(Player, i)
if(AdminLevel [playerid] >1)
SendClientMessage(i,APINK,text);
return 1;
}
What i am doing wrong and please explain why?
Reply
#2

thats mine
pawn Код:
dcmd_ac(playerid,params[])
{
    new string[128];
    new pname[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pname,sizeof(pname));
    if(!strlen(params))
    {
        SendClientMessage(playerid,COLOR_ERROR,"[USAGE] /ac (Message)");
        return 1;
    }
    format(string,sizeof(string),"[ADMIN CHAT] Admin %s(%d): %s",pname,playerid,params);
    SendAdminMessage(COLOR_PINK,string);
    IRC_GroupSay(gGroupID,IRC_ADMINCHANNEL,string);
    return 1;
}
to fit in yours
pawn Код:
dcmd_ac(playerid,params[])
{
    new string[128];
    new pname[MAX_PLAYER_NAME];
       if(AdminLevel [playerid] == 0) return SendClientMessage(playerid, RED, "You need to be an admin!");
    GetPlayerName(playerid,pname,sizeof(pname));
    if(!strlen(params))
    {
        SendClientMessage(playerid,COLOR_ERROR,"[USAGE] /ac (Message)");
        return 1;
    }
    format(string,sizeof(string),"[ADMIN CHAT] Admin %s(%d): %s",pname,playerid,params);
    SendClientMessage(i,APINK,text);
    return 1;
}
hope this works
Reply
#3

Yea great it helps Thank You!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)