PDA

View Full Version : Issue on Compile: Line 23: Invalid expression, assumed 0


DrToadley
11-11-2014, 10:02
If someone can please PLEASE help me with this I would be greatly appreciated.


Source Code: https://www.dropbox.com/s/fa1a92ilxqm9asa/ksg_2fort.sp?dl=0

rodrigo286
11-11-2014, 11:23
Uggly code... :nono:

Change this...


public Action:Command_ServerInfo(client, args)


to this...


public Action:Command_ServerInfo(client, args)
{
}


And ident you code, like this below :)

Code fixed and idented:


#include <sourcemod>

#define MENU_MAIN (1 << 1)
#define MENU_SOMETHING (1 << 2)

public Plugin:myinfo =
{
name = "Server Information",
author = "Butch Cassidy",
description = "Server Information Loads If Input == sm_serverinfo",
version = "1.0",
url = "http://sourcemod.net , http://sourcemm.net",
}

public OnPluginStart()
{
RegConsoleCmd("sm_serverinfo", Command_ServerInfo, "View server information.");
PrintToServer("[SM] Plugin:ServerInformation v1.0 Initiating...");
PrintToChatAll("[SM] Plugin:ServerInformation v1.0 Initiating...");
PrintToServer("[SM] Success! Type sm_serverinfo for server information!")
PrintToChatAll("[SM] Success! Type !serverinfo for server information!")
}

public Action:Command_ServerInfo(client, args)
{
}

public ShowInfoMenu(client, menutype)
{
if (menutype & MENU_MAIN)
{
new Handle:menu = CreateMenu(hMainMenu);
SetMenuTitle(menu, "[KSG] Server Info Plugin");
AddMenuItem(menu, "0", "View Server IP");
AddMenuItem(menu, "1", "View Group Page");
AddMenuItem(menu, "2", "Cancel");
DisplayMenu(menu, client, MENU_TIME_FOREVER);
}

if (menutype & MENU_SOMETHING)
{
new Handle:menu = CreateMenu(hSomethingMenu);
SetMenuExitBackButton(menu, false); //THIS ADDS A BACK BUTTON TO THE MENU
SetMenuTitle(menu, "SOME MENU:");
AddMenuItem(menu, "0", "ITEM 1");
AddMenuItem(menu, "1", "ITEM 2");
DisplayMenu(menu, client, MENU_TIME_FOREVER);
}
}

public hMainMenu(Handle:menu, MenuAction:action, client, param2)
{
switch (action)
{
case MenuAction_Select:
{
decl String:choice[64];
GetMenuItem(menu, param2, choice, sizeof(choice));
new item = StringToInt(choice);

switch (item)
{
case 0:
{
PrintToChat(client,"[KSG] 2Fort IP: 66.150.188.238:9000")
}

case 1:
{
ShowMOTDPanel(client, "KSGGroup", "http://steamcommunity.com/groups/killstreakgaming", MOTDPANEL_TYPE_URL)
}
}
}

case MenuAction_End:
{
CloseHandle(menu);
}
}
}

public hSomethingMenu(Handle:menu, MenuAction:action, client, param2)
{
switch (action)
{
case MenuAction_Select:
{
decl String:choice[64];
GetMenuItem(menu, param2, choice, sizeof(choice));
new item = StringToInt(choice);

switch (item)
{
case 0:
{
//DO SOME SHIT WHEN USER SELECTS ITEM 1
}

case 1:
{
//DO SOME SHIT WHEN USER SELECTS ITEM 2
}
}
}

case MenuAction_Cancel:
{
if (param2 == MenuCancel_ExitBack)
{
ShowInfoMenu(client, MENU_MAIN); //GO BACK FROM THIS MENU TO MAIN MENU
}
}

case MenuAction_End:
{
CloseHandle(menu);
}
}
}


Regards. :bee: