Create Menu - Error - Pls Help
#1

Hello All
Pls Help.
https://sampwiki.blast.hk/wiki/Creating_a_simple_Menu
Код:
// Test menu functionality filterscipt
 
#include <a_samp>
 
#define TEST_MENU_ITEMS 6
 
new Menu:TestMenu = -1;
new TestMenuStrings[6][16] = {"Test1", "Test2", "Test3", "Test4", "Test5", "Test6"};
 
HandleTestMenuSelection(playerid, row)
{
	new s[256];
 
	if(row < TEST_MENU_ITEMS) {
		format(s,256,"You selected item %s",TestMenuStrings[row]);
		SendClientMessage(playerid,0xFFFFFFFF,s);
	}
}
 
InitTestMenu()
{
	TestMenu = CreateMenu("Test Menu", 1, 200.0, 150.0, 200.0, 200.0);
        if(TestMenu == -1)
        {
            printf("The creation of menu failed!");
            return 0;
        }
	for(new x=0; x < TEST_MENU_ITEMS; x++) {
    	        AddMenuItem(TestMenu, 0, TestMenuStrings[x]);
	}
        return 1;
}
 
public OnFilterScriptInit()
{
   	if(InitTestMenu())
        {
            printf("The creation of menu succeeded!");
        }
        return 1;
}
 
public OnPlayerSelectedMenuRow(playerid, row)
{
        new Menu:PlayerMenu = GetPlayerMenu(playerid);
 
        if(PlayerMenu == TestMenu) {
	     HandleTestMenuSelection(playerid, row);
	}
        return 1;
}
 
public OnPlayerCommandText(playerid, cmdtext[])
{
	if(!strcmp(cmdtext, "/menutest", true) && TestMenu != -1)	{
    	     ShowMenuForPlayer(TestMenu, playerid);
    	     return 1;
	}
	return 0;
}
To Compile Error
C:\Users\simest\Desktop\menu.pwn(7) : warning 213: tag mismatch
C:\Users\simest\Desktop\menu.pwn(23) : warning 217: loose indentation
C:\Users\simest\Desktop\menu.pwn(23) : warning 213: tag mismatch
C:\Users\simest\Desktop\menu.pwn(2 : warning 217: loose indentation
C:\Users\simest\Desktop\menu.pwn(31) : warning 217: loose indentation
C:\Users\simest\Desktop\menu.pwn(40) : warning 217: loose indentation
C:\Users\simest\Desktop\menu.pwn(55) : warning 213: tag mismatch
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


7 Warnings.
------------------------------
Sorry. My Bad English.
Reply
#2

to fix errors of loose indentation add at top of your script
pawn Код:
#pragma tabsize 0
about the other erros pls show me the lines
Reply
#3

Quote:
Originally Posted by iThePunisher
Посмотреть сообщение
to fix errors of loose indentation add at top of your script
pawn Код:
#pragma tabsize 0
about the other erros pls show me the lines
No don't use #pragma tabsize 0 if you want clear script...
Quote:
Originally Posted by ******
Посмотреть сообщение
If you have loose indentation warnings, then fix them. Don't use tabsize 0.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)