looping error
#1

Код:
public OnPlayerSpawn(playerid)
{
	new string[128] = "";
	for(new i = 0; i > MAX_CLASSES; i++)
	{
	    if(!strcmp(string, "")) format(string, sizeof(string), "%s\n%s", string, Classes[i][Name]);
		else format(string, sizeof(string), "%s", Classes[i][Name]);
	}
	ShowPlayerDialog(playerid, d_spawn, DIALOG_STYLE_LIST, "Select Class", string, "Select", "");
	return 1;
}
My variables are completely good, the problem is when I place it with my loop, it doesn't show in-game.
Reply
#2

Код:
 for(new i = 0; i > MAX_CLASSES; i++)
should be
Код:
 for(new i = 0; i < MAX_CLASSES; i++)
full code:

PHP код:
new string[128] = "";
    for(new 
0MAX_CLASSESi++)
    {
        if(!
strcmp(string"")) format(stringsizeof(string), "%s\n%s"stringClasses[i][Name]);
        else 
format(stringsizeof(string), "%s"Classes[i][Name]);
    }
    
ShowPlayerDialog(playeridd_spawnDIALOG_STYLE_LIST"Select Class"string"Select"""); 
Reply
#3

Thank you very much! You're a lifesaver. I've been searching this error for hours. Thank youuu!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)