|
Senior Member
Join Date: Aug 2009
Location: Look behind you... Very
|

10-31-2009
, 13:54
What is wrong with my code?
|
#1
|
PHP Code:
/* Plugin made by OneMoreLevel */ /* Any modification to this code is illegal unless told so by the author. */ ////////////////////////////////////////////////////////////////////////////////////////// // ChangeLog // Version 1.1, Public release. //-- Made the base of the plugin, and made it multilingual // // // // // // // // // // // // //////////////////////////////////////////////////////////////////////////////////////////// // CVARS // SPY_Cost --- This is how much the spy Costs, default = 5000. // PLUGIN_TOGGLE --- Toggle the plugin, default 1 (on)
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> #define PLUGIN "TF2 Spy" #define VERSION "1.1" #define AUTHOR "OneMoreLevel" new spyToggle,spyCost;
public plugin_init() { register_plugin("TF2 Spy", "1.1", "OneMoreLevel") register_clcmd("say !spy" , "Say_spy") register_clcmd("say_team !spy" , "Say_spy") register_clcmd("say !abilities","plugin_menu") spyToggle = register_cvar("PLUGIN_TOGGLE", "1"); spyCost = register_cvar("SPY_Cost", "5000"); register_dictionary( "TF2Dictionary.txt") } public Say_spy (id) { if (is_user_alive(id)) { client_print(0, print_chat, "%L", LANG_SERVER, "TYPE_SPY") if (cs_get_user_money(id)) > (get_pcvar_num(spyCost)) cs_set_user_money(id, cs_get_user_money,(id) - (get_pcvar_num(spyCost)); strip_user_weapons(id) client_print( id, print_chat, "%L", LANG_SERVER, "NOW_SPY") // Free Multi-lingual advertising :D } else if (cs_get_user_money(id)) < (get_pcvar_num(spyCost)) { client_print( id, print_chat, "%L", LANG_SERVER, "NOT_ENOUGH_MONEY") } else if (!is_user_alive(id)) { client_print( id, print_chat, "%L", LANG_SERVER, "CANNOT_SPY") } } public plugin_menu (id) { new menu = menu_create("\rTF2 Spy Abilities", "menu_handler"); menu_additem(menu, "\wTeam Camo - Look like the other team", "1", 0); menu_additem(menu, "\wEnviroment Camo - Grass suit", "2", 0); menu_additem(menu, "\wPartial Invisibility - 75% Invis.", "3", 0); menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); if (is_user_alive(id)) menu_display(id, menu, 0); else { client_print( id, print_console, "%L", LANG_SERVER, "SPY_DEAD") } } public menu_handler(id, menu, item) { if (item == MENU_EXIT ) { menu_destroy(menu); } // Here are the data functions and variables 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: { // Print the message and destroy the menu if ( get_user_team( id ) == 2 ) // CT? { (strip_user_weapons(id)) cs_set_user_team( id, CS_TEAM_CT, CS_T_LEET ); menu_destroy(menu); } else if( get_user_team( id ) == 1 ) // T? { (strip_user_weapons(id)) cs_set_user_team( id, CS_TEAM_T, CS_CT_GIGN ); menu_destroy(menu); } menu_destroy(menu); } case 2: { menu_destroy(menu); } case 3: { if ( get_user_team( id ) == 2 ) { (strip_user_weapons(id)) cs_set_user_team( id, CS_TEAM_CT, CS_CT_GIGN ); set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 65) menu_destroy(menu); } else if( get_user_team( id ) == 1 ) { (strip_user_weapons(id)) cs_set_user_team( id, CS_TEAM_T, CS_T_LEET ); set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 65) menu_destroy(menu); } menu_destroy(menu); } } // Kill the menu, and make a return. menu_destroy(menu); return PLUGIN_HANDLED; } public client_connect(id) { client_print( id, print_console, "%L", LANG_SERVER, "WELCOME_MSG") client_print( id, print_chat, "%L", LANG_SERVER, "WELCOME_MSG") } public client_disconnect(id) { client_print( id, print_console, "%L", LANG_SERVER, "GOODBYE_MSG") client_print( id, print_chat, "%L", LANG_SERVER, "GOODBYE_MSG") } ///////////////////////////////// // To Do? //-- Make "feign death" option //-- Ad no footsteps //-- Knife model? // // // // // // // // // //////////////////////////////////
I get a few errors with this, anybody know what it is?
(I know I dont use One of the variables yet.)
__________________
|
|