Must be assigned to an array
#5

Quote:
Originally Posted by ssǝן‾ʎ
I count 10 characters max there, why do you need an array of size 128 to store 10 characters - what are the other 118 cells for?
Would this be an improvement?

Код:
new stato[MAX_PLAYERS][10];
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if(strcmp("/prigione1", cmdtext, true, 10) == 0) return stato[playerid]="prigione1";

	if (strcmp("/prigione2", cmdtext, true, 10) == 0) return stato[playerid]="prigione2";

	if (strcmp("/base1", cmdtext, true, 10) == 0) return stato[playerid]="base1";

	if (strcmp("/base2", cmdtext, true, 10) == 0) return stato[playerid]="base2";

	return 0;
}
Reply


Messages In This Thread
Must be assigned to an array - by Negrosoo - 22.08.2009, 13:12
Re: Must be assigned to an array - by Surmek - 22.08.2009, 13:15
Re: Must be assigned to an array - by Negrosoo - 23.08.2009, 17:49
Re: Must be assigned to an array - by dice7 - 23.08.2009, 17:58
Re: Must be assigned to an array - by radhakr - 23.08.2009, 18:10
Re: Must be assigned to an array - by radhakr - 23.08.2009, 18:31

Forum Jump:


Users browsing this thread: 1 Guest(s)