i got error 033 pls help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: i got error 033 pls help (
/showthread.php?tid=448090)
i got error 033 pls help -
hebron - 03.07.2013
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?
Re: i got error 033 pls help -
_Khaled_ - 03.07.2013
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
Re: i got error 033 pls help -
hebron - 03.07.2013
Yea great it helps Thank You!!