for(); doesn't work
#1

I made a function in my mode.
In the function I got for(); command that for some reason cause function to don't work. there is no problem to compile the script, but the function does nothing.
When I remove the for(); line from the function it works fine(but I need the for(); ).

Why does it happen?

the code is:

Код:
#define MAX_BASES 3
new base_name[MAX_BASES][256];
new playerteam[MAX_PLAYERS]; //defined meanwhile the game

public OnGameModeInit()
{
    //example for base_name definition (name in hebrew, the modes language,seems that the forum doesn't support it)
    base_name[base_civ_HQ] = "оид шащй ажшзйн";
}
SpawnList(playerid)
{
	new str[1024];
	for(new n = 0; n <= MAX_BASES; n++)
	{
	  if(base_team[n] == playerteam[playerid])
 		{
			format(str,sizeof(str),"%s%s\n",str,base_name[n]);
		}
	}
	ShowPlayerDialog(playerid,7,DIALOG_STYLE_LIST,"Spawn points",str,"OK","Cancel");
}
Please help me
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)