03.08.2012, 06:38
Got an error 033: array must be indexed (variable "-unknown-")
I dunno how to fix this.. So i need help.
EDIT: Fixed. Used strval.
pawn Код:
if(level >= 2 && level <= 4)
{
new levelmsg[32];
{
switch (levelmsg)
{
case 2: levelmsg = "VIP.";
case 3: levelmsg = "Special VIP.";
case 4: levelmsg = "Permanent VIP.";
}
format(string,sizeof(string),"** You've granted %s a %s.", GetName(targetid), levelmsg);
SCM(playerid, COLOR_YELLOW, string);
format(string,sizeof(string),"** You've been granted a %s by %s.", levelmsg, GetName(playerid));
SCM(targetid, COLOR_GREEN, "*** Congratulations...");
SCM(targetid, COLOR_GREEN, string);
PlayerInfo[playerid][pVIP] = level;
}
if(level >= 5 && level <= 9 )
{
switch (levelmsg)
{
case 5: levelmsg = "Moderator.";
case 6: levelmsg = "Junior Admin.";
case 7: levelmsg = "General Admin.";
case 8: levelmsg = "Uber Admin.";
case 9: levelmsg = "Management.";
}
if(level < PlayerInfo[playerid][pLevel])
{
format(string,sizeof(string),"** You've been demoted from the %s Status by %s.", levelmsg, GetName(playerid));
SCM(targetid, COLOR_RED, string);
format(string,sizeof(string),"** You've demoted %s to %s Status.", GetName(targetid), levelmsg);
SCM(playerid, COLOR_YELLOW, string);
}
else if(level > PlayerInfo[playerid][pLevel])
{
format(string,sizeof(string),"** You've been promoted to %s Status by %s.", levelmsg, GetName(playerid));
SCM(targetid, COLOR_GREEN, string);
format(string,sizeof(string),"** You've promoted %s to %s Status.",GetName(targetid), levelmsg);
SCM(playerid,COLOR_YELLOW, string);
}
format(string,sizeof(string),"** You've granted a %s Status to %s.", levelmsg, GetName(targetid));
SCM(playerid, COLOR_YELLOW, string);
format(string,sizeof(string),"** You've been granted a %s Status by %s.", levelmsg, GetName(playerid));
SCM(targetid, COLOR_GREEN,"*** Congratulations...");
SCM(targetid, COLOR_GREEN, string);
PlayerInfo[playerid][pLevel] = level;
}
}
EDIT: Fixed. Used strval.