Need some 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Need some help! (
/showthread.php?tid=52545)
Need some help! -
Techno - 06.10.2008
ive got this code:
Код:
#include <a_samp>
#pragma tabsize 0
//-------Menu's-------------
new Menu:info;
//-------Colors---------------
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_LIGHTRED 0xFF6347AA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_LIGHTGREEN 0x9ACD32AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_PURPLE 0xC2A2DAAA
#define COLOR_DBLUE 0x2641FEAA
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/info", true) == 0)
{
ShowMenuForPlayer(info, playerid);
return 1;
}
return 0;
}
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print("'Info Menu by: Techno");
;
print("--------------------------------------\n");
info = CreateMenu("info Menu", 1, 50.0, 180.0, 200.0, 200.0);
SetMenuColumnHeader(info, 0, "Info Menu By Techno");
AddMenuItem(info, 0, "Server Admins");
}
public OnPlayerSelectedMenuRow(playerid, row)
{
new info:CurrentMenu = GetPlayerMenu(playerid);
if(CurrentMenu == info)
{
switch(row)
{
case 0:
{
SendClientMessage(playerid, 0xDEEE20FF, "Hello.");
}
return 1;
}
public OnPlayerExitedMenu(playerid)
{
SendClientMessage(playerid, 0xFFFFFFFF, "XTREME: Thanks for using this menu!");
return 1;
}
errors:
Код:
C:\DOCUME~1\Youri\MIJNDO~1\xtreme\info.pwn(33) : error 036: empty statement
C:\DOCUME~1\Youri\MIJNDO~1\xtreme\info.pwn(44) : warning 213: tag mismatch
C:\DOCUME~1\Youri\MIJNDO~1\xtreme\info.pwn(45) : warning 213: tag mismatch
C:\DOCUME~1\Youri\MIJNDO~1\xtreme\info.pwn(54) : error 002: only a single statement (or expression) can follow each "case"
C:\DOCUME~1\Youri\MIJNDO~1\xtreme\info.pwn(54) : warning 215: expression has no effect
C:\DOCUME~1\Youri\MIJNDO~1\xtreme\info.pwn(56) : error 029: invalid expression, assumed zero
C:\DOCUME~1\Youri\MIJNDO~1\xtreme\info.pwn(56) : error 004: function "OnPlayerExitedMenu" is not implemented
C:\DOCUME~1\Youri\MIJNDO~1\xtreme\info.pwn(62) : error 030: compound statement not closed at the end of file (started at line 44)
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
5 Errors.
Re: Need some help! -
Techno - 06.10.2008
dont get it
i copied that block of code out another file and it gives a error?:O
Re: Need some help! -
darkhuman - 16.09.2009
Here is the ful code working...
Код:
#include <a_samp>
#pragma tabsize 0
//-------Menu's-------------
new Menu:info;
//-------Colors---------------
#define COLOR_GREY 0xAFAFAFAA
#define COLOR_GREEN 0x33AA33AA
#define COLOR_RED 0xAA3333AA
#define COLOR_LIGHTRED 0xFF6347AA
#define COLOR_LIGHTBLUE 0x33CCFFAA
#define COLOR_LIGHTGREEN 0x9ACD32AA
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_PURPLE 0xC2A2DAAA
#define COLOR_DBLUE 0x2641FEAA
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/info", true) == 0)
{
ShowMenuForPlayer(info, playerid);
return 1;
}
return 0;
}
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print("'Info Menu by: Techno");
print("--------------------------------------\n");
info = CreateMenu("info Menu", 1, 50.0, 180.0, 200.0, 200.0);
SetMenuColumnHeader(info, 0, "Info Menu By Techno");
AddMenuItem(info, 0, "Server Admins");
}
public OnPlayerSelectedMenuRow(playerid, row)
{
new Menu:Current = GetPlayerMenu(playerid);
if(Current == info)
{
switch(row)
{
case 0:
{
SendClientMessage(playerid, 0xDEEE20FF, "Hello.");
}
}
}
return 1;
}
public OnPlayerExitedMenu(playerid)
{
return 1;
}