[HELP] if player banned
#1

Hello. I made myself command checkoffplayer and I store player info banned into a variable abanned[1] which I load with ini_fileparse and I want to make

if(abanned[1] == 1) so if banned variable hold the banned pinfo so I was thinking if abanned is 1 then it send message player is banned but the problem is that it gives me array size must be indexed abanned
Reply
#2

Show us the code that gives that error.
Reply
#3

I give you the code and the line where it's error

if(abanned[0] == 1) //this is that code
Reply
#4

Show where you defined that array.

Like
PHP код:
new abanned[MAX_PLAYERS]; 
or
PHP код:
enum pInfo
{
    
abanned
}
new 
PlayerInfo[MAX_PLAYERS][pInfo]; 
or something.
Reply
#5

new abanned[1][MAX_PLAYER_NAME];

then public Banned

public Banned(playerid,name[],value[])
{
INI_String("PlayerBanned",abanned[0],MAX_PLAYER_NAME); I want from here in commad get 1 or 0 from abanned beacuse that variable hold playerbanned which is for pinfo where it's 0 or 1 and that I need in offcheckplayer
return 1;
}
Reply
#6

You also declared MAX_PLAYERS, but you ain't using it.
It should be like this:
pawn Код:
if(abanned[0][playerid] == 1)
Reply
#7

It won't work that way look my other code which I get from offline player like level and admin level

this code is in off comand check

pawn Код:
format(acc,128,PATH,name);
    INI_ParseFile(acc,"OffLineData",.bExtra = true, .extra = playerid);
    format(string,sizeof(string),"Level[%s] AdminLV[%s],offdata[0],offdata[1]);
    SendClientMessage(playerid,COLOR_YELLOW,string);
pawn Код:
public OffLineData(playerid,name[],value[])
{
INI_String("Level",offdata[0],MAX_PLAYER_NAME);
    INI_String("AdminLevel",offdata[1],MAX_PLAYER_NAME);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)