AMX error.
#1

This code:
Код:
enum drugs
{
	drugSender = INVALID_PLAYER_ID,
	drugReceiver = INVALID_PLAYER_ID,
	drugPrice,
	drugAmount
}
new SellDrugs[1000][drugs];

stock FreeDrugsSlot()
{
	for(new i=0; i < sizeof(SellDrugs); i++)
	{
		if(SellDrugs[i][drugSender] == INVALID_PLAYER_ID) return i;
		break;
	}
	return 0;
}

stock HasSentDrugsTo(playerid)
{
	for(new i=0; i < sizeof(SellDrugs); i++)
	{
		if(SellDrugs[i][drugReceiver] == playerid) return true;
		break;
	}
	return false;
}
Gives me the error AMX not initialised. Why?
Reply
#2

I can't say much about the run time error as I'm not aware but assigning a value in the items (in enumerator) is not for a default value as you think. Basically the size of the 2nd dimension is 65538. When the mode starts, loop and reset to INVALID_PLAYER_ID.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)