Help with Y_Bits
#3

Quote:
Originally Posted by ******
Посмотреть сообщение
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.
I've made this code for tests, but don't work for others players, just for ID 0

Код:
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;
}
Reply


Messages In This Thread
Help with Y_Bits - by Electrifying - 24.09.2018, 22:00
Re: Help with Y_Bits - by VVWVV - 24.09.2018, 22:07
Re: Help with Y_Bits - by Electrifying - 24.09.2018, 22:53

Forum Jump:


Users browsing this thread: 1 Guest(s)