error compiling my script :\
this is my error (errors) xD
Code:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team
C:\Program Files (x86)\Steam\steamapps\tor0en\dedicated server\cstrike\addons\amxmodx\scripting\include\fun.inc(13) : error 017: undefined symbol "AMXX_VERSION_NUM"
C:\Program Files (x86)\Steam\steamapps\tor0en\dedicated server\cstrike\addons\amxmodx\scripting\include\fun.inc(45) : error 017: undefined symbol "kRenderFxNone"
C:\Program Files (x86)\Steam\steamapps\tor0en\dedicated server\cstrike\addons\amxmodx\scripting\include\fakemeta.inc(15) : error 017: undefined symbol "AMXX_VERSION_NUM"
Warning: Loose indentation on line 155
Warning: Loose indentation on line 161
Warning: Loose indentation on line 166
Warning: Loose indentation on line 174
Warning: Loose indentation on line 178
Warning: Loose indentation on line 185
Warning: Loose indentation on line 186
Warning: Loose indentation on line 190
Warning: Loose indentation on line 197
Warning: Loose indentation on line 198
3 Errors.
Could not locate output file C:\Program Files (x86)\Steam\steamapps\tor0en\dedicated server\cstrike\addons\amxmodx\plugins\Tmenu.amx (compile failed).
and here is my script....
Code:
#include <fun>
#include <fakemeta>
#include <amxmodx>
public plugin_init()
{
//..stuff for your plugin
register_clcmd( "say /MM","MainMenu")
//note that we do not need to register the menu anymore, but just a way to get to it
}
//lets make the function that will make the menu
public MainMenu(id)
{
//first we need to make a variable that will hold the menu
new menu = menu_create("\rMainMenu", "menu_handler")
//Note - menu_create
//The first parameter is what the menu will be titled (what is at the very top)
//The second parameter is the function that will deal/handle with the menu (which key was pressed, and what to do)
//Now lets add some things to select from the menu
menu_additem(menu, "\wGame Changer", "1", 2)
menu_additem(menu, "\wRespawn Players", "2", 2)
//Note - menu_additem
//The first parameter is which menu we will be adding this item/selection to
//The second parameter is what text will appear on the menu (Note that it is preceeded with a number of which item it is)
//The third parameter is data that we want to send with this item
//The fourth parameter is which admin flag we want to be able to access this item (I have had no experience with this, so I am just assuming this is how it works. It uses the admin flags from the amxconst.inc)
//Set a property on the menu
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
//Note - menu_setprop
//The first parameter is the menu to modify
//The second parameter is what to modify (found in amxconst.inc)
//The third parameter is what to modify it to (in this case, we are adding a option to the menu that will exit the menu. setting it to MEXIT_NEVER will disable this option)
//Lets dispaly the menu
menu_display(id, menu, 0)
//Note - menu_display
//The first parameter is which index to show it to (you cannot show this to everyone at once)
//The second parameter is which menu to show them (in this case, the one we just made)
//The third parameter is which page to start them on
}
//okay, we showed them the menu, now lets handle it (looking back at menu_create, we are going to use that function)
public menu_handler(id, menu, item)
{
//we don't want to deal with them if they exited a menu
if (item == MENU_EXIT)
{
menu_destroy(menu)
//Note that you will want to destroy the menu after they do something
return PLUGIN_HANDLED
}
//now lets create some variables that will give us information about the menu and the item that was pressed/chosen
new data[6], iName[64]
new access, callback
//heres the function that will give us that information (since it doesnt magicaly appear)
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback)
//Note - that you can do this next step how you want, this is just the way I prefer
//looking back to menu_additem, we sent data with every item we added, this is where it gets a little fishy for us (where you can do your own method)
new key = str_to_num(data)
//note that all my datas were numbers (you can do it with whatever type of string you want)
//now lets find which item was pressed
switch(key)
{
case 1:{
client_cmd(id, "SwitcherMenu")
return PLUGIN_HANDLED
}
case 2:{
client_cmd(id,"respawn_player")
}
}
//lets finish up this function with a menu_destroy, and a return
menu_destroy(menu)
return PLUGIN_HANDLED
}
//game Switcher
public SwitcherMenu(id)
{
//first we need to make a variable that will hold the menu
new menu = menu_create("\rGame Switcher", "Switchmenu_handler")
//Note - menu_create
//The first parameter is what the menu will be titled (what is at the very top)
//The second parameter is the function that will deal/handle with the menu (which key was pressed, and what to do)
//Now lets add some things to select from the menu
menu_additem(menu, "\wNormal", "1", 2)
menu_additem(menu, "\wHide and seek", "2", 2)
menu_additem(menu, "\wWarmup", "3",2)
menu_additem(menu, "\w1337awpmap", "4", 2)
//Note - menu_additem
//The first parameter is which menu we will be adding this item/selection to
//The second parameter is what text will appear on the menu (Note that it is preceeded with a number of which item it is)
//The third parameter is data that we want to send with this item
//The fourth parameter is which admin flag we want to be able to access this item (I have had no experience with this, so I am just assuming this is how it works. It uses the admin flags from the amxconst.inc)
//Set a property on the menu
menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
//Note - menu_setprop
//The first parameter is the menu to modify
//The second parameter is what to modify (found in amxconst.inc)
//The third parameter is what to modify it to (in this case, we are adding a option to the menu that will exit the menu. setting it to MEXIT_NEVER will disable this option)
//Lets dispaly the menu
menu_display(id, menu, 0)
//Note - menu_display
//The first parameter is which index to show it to (you cannot show this to everyone at once)
//The second parameter is which menu to show them (in this case, the one we just made)
//The third parameter is which page to start them on
}
//okay, we showed them the menu, now lets handle it (looking back at menu_create, we are going to use that function)
public Switchmenu_handler(id, menu, item)
{
//we don't want to deal with them if they exited a menu
if (item == MENU_EXIT)
{
menu_destroy(menu)
//Note that you will want to destroy the menu after they do something
return PLUGIN_HANDLED
}
//now lets create some variables that will give us information about the menu and the item that was pressed/chosen
new data[6], iName[64]
new access, callback
//heres the function that will give us that information (since it doesnt magicaly appear)
menu_item_getinfo(menu, item, access, data,5, iName, 63, callback)
//Note - that you can do this next step how you want, this is just the way I prefer
//looking back to menu_additem, we sent data with every item we added, this is where it gets a little fishy for us (where you can do your own method)
new key = str_to_num(data)
//note that all my datas were numbers (you can do it with whatever type of string you want)
//now lets find which item was pressed
switch(key)
{
case 1:{
client_print(id, print_chat, "Server Mode: Normal!")
//note that if we dont want to continue through the function, we can't just end with a return. We want to kill the menu first
server_cmd("sv_gravity 800");
server_cmd("mp_freezetime 6")
server_cmd("mp_startmoney 800")
server_cmd("mp_footsteps 1")
server_cmd("sv_restart 3")
server_print("Server is Restarting!")
menu_destroy(menu)
return PLUGIN_HANDLED
}
case 2:{
client_print(id, print_chat, "Server Mode: Hide and Seek!")
server_cmd("sv_gravity 200");
server_cmd("mp_freezetime 0")
server_cmd("mp_footsteps 0")
server_cmd("mp_startmoney 10")
server_cmd("sv_airaccelerate 100")
server_cmd("sv_restart 3")
server_print("Server is Restarting!")
menu_destroy(menu)
return PLUGIN_HANDLED
}
case 3:{ //again i don't have experience with the admin limitations, so i don't know if you need to have a check before this (im assuming you don't though ^_^)
client_print(id, print_chat, "Server Mode: Warmup!")
server_cmd("sv_gravity 800");
server_cmd("mp_freezetime 0")
server_cmd("mp_startmoney 16000")
server_cmd("sv_airaccelerate 10")
server_cmd("sv_restart 3")
server_cmd("mp_footsteps 1")
server_print("Server is Restarting!")
menu_destroy(menu)
return PLUGIN_HANDLED
}
case 4:{ //again i don't have experience with the admin limitations, so i don't know if you need to have a check before this (im assuming you don't though ^_^)
client_print(id, print_chat, "Server Mode: Warmup!")
server_cmd("sv_gravity 800");
server_cmd("mp_freezetime 0")
server_cmd("mp_startmoney 16000")
server_cmd("sv_airaccelerate 1000")
server_cmd("sv_restart 3")
server_cmd("mp_footsteps 0")
server_print("Server is Restarting!")
menu_destroy(menu)
return PLUGIN_HANDLED
}
}
//lets finish up this function with a menu_destroy, and a return
menu_destroy(menu)
return PLUGIN_HANDLED
}
public respawn_player(id)
{
if(is_user_connected(id))
{
//Make the engine think he is spawning
set_pev(id,pev_deadflag,DEAD_RESPAWNABLE);
set_pev(id, pev_iuser1, 0);
dllfunc(DLLFunc_Think,id)
//Move his body so if corpse is created it is not in map
engfunc(EngFunc_SetOrigin,id,Float:{-4800.0,-4800.0,-4800.0})
//Actual Spawn
set_task(0.5,"spawnagain",id)
}
}
public spawnagain(id)
{
//Make sure he didn't disconnect in the 0.5 seconds that have passed.
if(is_user_connected(id))
{
//Spawn player
spawn(id)
dllfunc(DLLFunc_Spawn,id)
//After 1.0 the player will be spawned fully and you can mess with the ent (give weapons etc)
//set_task(1.0,"player_fully_spawned",id)
}
}
|