new BitArray:array<MAX_PLAYERS>;
new BitArray:array[MAX_PLAYERS];
|
A “slot” is the same in any array. It is just one piece of the array. Saying new arr[20]; declares an array with 20 slots. Saying new arr<20>; is similar, it declares an array with 20 slots too, but a special array. A special array is one that isn’t really an array. They are usually defined by libraries as here.
|
new BitArray:Escondertxt<MAX_PLAYERS>;
public OnPlayerConnect(playerid)
{
Bit_Set(BitArray:Escondertxt<playerid>, playerid, bool:false);
return 1;
}
public OnPlayerSpawn(playerid)
{
if(Bit_Get(BitArray:Escondertxt, playerid) == false)
{
MostrarAllTXTS(playerid);
}
else
{
EsconderAllTXTS(playerid);
}
return 1;
}
YCMD:texts(playerid, params[], help)
{
if(Bit_Get(BitArray:Escondertxt, playerid) == false)
{
Bit_Set(BitArray:Escondertxt<playerid>, playerid, bool:true);
EsconderAllTXTS(playerid);
SendMessageAVS(playerid, "Vocк escondeu todas as textdraws.");
}
else
{
Bit_Set(BitArray:Escondertxt<playerid>, playerid, bool:false);
MostrarAllTXTS(playerid);
SendMessageAVS(playerid, "Vocк ativou todas as textdraws.");
}
return 1;
}