SA-MP Forums Archive
help plz - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: help plz (/showthread.php?tid=174915)



help plz - StyleR - 07.09.2010

//---------------------------------------------------------------<[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?


Re: help plz - Rachael - 07.09.2010

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

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



Re: help plz - Rachael - 07.09.2010

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 !");
}
}



Re: help plz - StyleR - 07.09.2010

ok tnx