Create Menu - Error - Pls Help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Create Menu - Error - Pls Help (
/showthread.php?tid=505239)
Create Menu - Error - Pls Help -
Miladajir - 07.04.2014
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.
Re: Create Menu - Error - Pls Help -
iThePunisher - 07.04.2014
to fix errors of loose indentation add at top of your script
about the other erros pls show me the lines
Re: Create Menu - Error - Pls Help -
vassilis - 07.04.2014
Quote:
Originally Posted by iThePunisher
to fix errors of loose indentation add at top of your script 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.
|