help plz
#1

//---------------------------------------------------------------<[Giveallevel]>----------------------------------------------------------------------//
if(strcmp(cmd, "/givelevelall", true) == 0)//By SeTh
{
if (PlayerInfo[playerid][pAdmin] >= 1337)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
new playerlevel = PlayerInfo[playerid][pLevel];
PlayerInfo[pLevel] = playerlevel + 1;
format(string, sizeof(string), " Administrator %s gave up 1 level all players who are online",sendername);
SendClientMessage(i,COLOR_LIGHTGREEN,string);
}
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command !");
}
}

and error F:\Warcraft III\Maps\Download\SainTs.pwn(21335) : error 033: array must be indexed (variable "PlayerInfo")
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Error.
wtf i can doo?
Reply
#2

I'm guessing you need to make it Playerinfo[i][pLevel]

also you can save a line
Код:
PlayerInfo[i][pLevel]++;
Reply
#3

Many errors here, compiling errors, and also errors that will compile but not do what you want them to do.
Код:
//---------------------------------------------------------------<[Giveallevel]>----------------------------------------------------------------------//
if(strcmp(cmd, "/givelevelall", true) == 0)//By SeTh
{
if (PlayerInfo[playerid][pAdmin] >= 1337)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
PlayerInfo[i][pLevel]++;
format(string, sizeof(string), " Administrator %s gave up 1 level all players who are online",sendername); // <-- have you defined sendername?
SendClientMessage(i,COLOR_LIGHTGREEN,string);
}
}
return 1;
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " you are not authorized to use that command !");
}
}
Reply
#4

ok tnx
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)