Errros in my code
PHP Code:
#include <amxmodx> #include <amxmisc> #include <hamsandwich> #include <colorchat> #include <fakemeta> #include <cstrike> #include <fun> #define PLUGIN "DeathMatch: All Stars" #define VERSION "1.0" #define AUTHOR "Cheese" new amx_gamename; new g_pWelcomeMsg; public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) register_plugin( "Game Namer", "1.1", "Cheese" ); amx_gamename = register_cvar( "amx_gamename", "DeathMatch: All Stars" ); register_forward( FM_GetGameDescription, "GameDesc" ); g_pWelcomeMsg = register_cvar( "amxx_welcome", "1" ); RegisterHam(Ham_Spawn, "player", "DeathMatchClassMenu", 1 ); } public DeathMatchClassMenu(id) { new menu = menu_create("\yDeathMatch Class Menu :", "DeathMatchClassMenu_handler"); menu_additem(menu, "\wPistols \r(Glock, Usp, Deagle)", "1", 0); menu_additem(menu, "\wShotguns \r(Shotgun, Auto Shotgun", "2", 0); menu_additem(menu, "\wSMG \r(Mac 10, Mp5)", "3", 0); menu_additem(menu, "\wRifles \r(Ak47, Scout)", "4", 0); menu_additem(menu, "\wMachine Guns \r(M249)", "5", 0); menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); menu_display(id, menu, 0); } public DeathMatchClassMenu_handler(id, menu, item) { if( item == MENU_EXIT ) { menu_destroy(menu); return PLUGIN_HANDLED; } new data[6], iName[64]; new access, callback; menu_item_getinfo(menu, item, access, data,5, iName, 63, callback); new key = str_to_num(data); switch(key) { case 1: { give_item(id, "weapon_glock18"); cs_set_user_bpammo( id, CSW_GLOCK18, 120 ); give_item(id, "weapon_usp"); cs_set_user_bpammo( id, CSW_USP, 120 ); give_item(id, "weapon_deagle"); cs_set_user_bpammo( id, CSW_DEAGLE, 120 ); } case 2: { give_item(id, "weapon_m3"); cs_set_user_bpammo( id, CSW_M3, 120 ); give_item(id, "weapon_xm1014"); cs_set_user_bpammo( id, CSW_XM1014, 120 ); } case 3: { give_item(id, "weapon_mac10"); cs_set_user_bpammo( id, CSW_MAC10, 120 ); give_item(id, "weapon_mp5navy"); cs_set_user_bpammo( id, CSW_MP5NAVY, 120 ); } case 4: { give_item(id, "weapon_ak47"); cs_set_user_bpammo( id, CSW_AK47, 120 ); give_item(id, "weapon_scout"); cs_set_user_bpammo( id, CSW_SCOUT, 120 ); } case 5: { give_item(id, "weapon_m249"); cs_set_user_bpammo( id, CSW_M249, 120 ); } } return PLUGIN_HANDLED; } public client_putinserver( id ) { set_task( 60.0, "Advertise", id, _, _, "b" ); set_task( 5.0, "Welcome", id ); } public Welcome( id ) { new szName[ 32 ]; get_user_name( id, szName, charsmax( szName ) ); Color( id, "!g[ DeathMatch ]!n Welcome !g%s!n, DeathMatch: All Stars !gV1.0!n Coded By !gCheese.", szName, PLUGIN, VERSION, AUTHOR ); } public Advertise( id ) { if( get_pcvar_num( g_pWelcomeMsg ) ) { Color( id, ""); } } stock Color( id, String[ ], any:... ) { static szMsg[ 192 ]; vformat( szMsg, charsmax( szMsg ), String, 3 ); replace_all( szMsg, charsmax( szMsg ), "!n", "^1" ); replace_all( szMsg, charsmax( szMsg ), "!t", "^3" ); replace_all( szMsg, charsmax( szMsg ), "!g", "^4" ); static msgSayText = 0; if( !msgSayText ) msgSayText = get_user_msgid( "SayText" ); new Players[ 32 ], iNum = 1, i; if( id ) Players[ 0 ] = id; else get_players( Players, iNum, "ch" ); for( --iNum; iNum >= 0; iNum-- ) { i = Players[ iNum ]; message_begin( MSG_ONE_UNRELIABLE, msgSayText, _, i ); write_byte( i ); write_string( szMsg ); message_end( ); } } public GameDesc( ) { static gamename[32]; get_pcvar_string( amx_gamename, gamename, 31 ); forward_return( FMV_STRING, gamename ); return FMRES_SUPERCEDE; }
|