Raised This Month: $ Target: $400
 0% 

[HELP] Plugin compiles but no valid command in game


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
josjau
Junior Member
Join Date: Oct 2006
Old 10-05-2006 , 20:34   Re: [HELP] Plugin compiles but no valid command in game
Reply With Quote #5

OK the plugin now loads and menus show up but all actions chosen on menu just close the menu. I cannot find an error message

Code:
/* Plugin Created by Dethmaul This plugins is a heavily modified version of admin_aimmenu. Usage: Bind keys to : amx_aimadminmenu, amx_lastadminmenu Aim at desired target and then press the key to bring up the Point Menu The amx_lastadminmenu basicaly recalls the last targeted player (Allows you to quickly target a player that was kicked - as long as you haven't selected a new target since kicking the last perpetrator. This plugins requires the following other plugins to  work correctly: dod_eviladmin, amx_forcequit, & spray_management to work correctly.   */ #include <amxmodx> #include <amxmisc> /* ******************************* Define section *********************************** */ #define MaxPlayers 20            // Max players #define BanTime 10            // How long the Temp ban should last #define LastAdminTarget 1        // Include amx_lastadminmenu code #define SlapDMG 0                // How much dmg the slap does // If you want to change the command sent to the client to show the rules search for "amx_publicrules" /* ******************************* Define section end *********************************** */ new g_AdminTarget[MaxPlayers+1]        // Used to store the target, a array is used incase 2+ admins use the menu at the same time. new g_LastTarget[MaxPlayers+1]        // Contains the ID of the last admin target. public plugin_init() {     register_plugin("AMX Point Mneu","1.0","Dethmaul")     register_menucmd(register_menuid("Aim Adminmenu"),1023,"aimadminmenu")     //register_concmd("amx_pointmenu", "cmdPointMenu", ADMIN_LEVEL_B, "Amx_pointmenu Options First..")     register_clcmd("amx_aimadminmenu","cmdAimAdminmenu",ADMIN_BAN,"Loads adminmenu based on who your aiming at") #if LastAdminTarget == 1     register_clcmd("amx_lastadminmenu","cmdLastAdminTarget",ADMIN_BAN,"Loads adminmenu based on the last player a admin action was taken agaist") #endif     } public aimadminmenu(id,key){     if (!is_user_connected(g_AdminTarget[id])){         client_print(id,print_center,"This player has left the server")                 return PLUGIN_HANDLED         }     new param[2]     switch(key){         case 0: {             g_LastTarget[id] = g_AdminTarget[id]             //param[0] = 0             param[0] = g_AdminTarget[id]             param[1] = id             //EchoAdminAction(param)             server_cmd("amx_evilglow #%d",get_user_userid(g_AdminTarget[id]))             }                     case 1: {             user_slap(g_AdminTarget[id],SlapDMG)             g_LastTarget[id] = g_AdminTarget[id]             //param[0] = 0             param[0] = g_AdminTarget[id]             param[1] = id             //EchoAdminAction(param)             }                                 case 2: {             g_LastTarget[id] = g_AdminTarget[id]             //param[0] = 0             param[0] = g_AdminTarget[id]             param[1] = id             //EchoAdminAction(param)             server_cmd("amx_nick #%d DoDUser",get_user_userid(g_AdminTarget[id]))             }                 case 3: {             g_LastTarget[id] = g_AdminTarget[id]             //param[0] = 0             param[0] = g_AdminTarget[id]             param[1] = id             //EchoAdminAction(param)             server_cmd("amx_evilbury #%d",get_user_userid(g_AdminTarget[id]))             }                 case 4: {             g_LastTarget[id] = g_AdminTarget[id]             //param[0] = 0             param[0] = g_AdminTarget[id]             param[1] = id             //EchoAdminAction(param)             server_cmd("amx_evilvision #%d",get_user_userid(g_AdminTarget[id]))             }                 case 5: {             g_LastTarget[id] = g_AdminTarget[id]             //param[0] = 0             param[0] = g_AdminTarget[id]             param[1] = id             //EchoAdminAction(param)             server_cmd("amx_evilmelee #%d",get_user_userid(g_AdminTarget[id]))             }                     case 6: {             g_LastTarget[id] = g_AdminTarget[id]             //param[0] = 0             param[0] = g_AdminTarget[id]             param[1] = id             //EchoAdminAction(param)             server_cmd("amx_evilpimpslap #%d",get_user_userid(g_AdminTarget[id]))             }                 }     return PLUGIN_HANDLED     } public DisplayAimAdminmenu(id){     new menuBody[512],VictimName[33],len     get_user_name(g_AdminTarget[id],VictimName,32)     len = format(menuBody,2047,"\rPoint Menu^nTarget aquired:  %s^n^n",VictimName)     len += format(menuBody[len],2047 - len,"\w1. Make Player Glow/Not Glow^n" )     len += format(menuBody[len],2047 - len,"\w2. Slap Player (%d Damage)^n",SlapDMG )     len += format(menuBody[len],2047 - len,"\w3. Change Player Name to DoDUser^n" )     len += format(menuBody[len],2047 - len,"\w4. Bury/Unbury Player^n" )     len += format(menuBody[len],2047 - len,"\w5. Change Player Vision^n" )     len += format(menuBody[len],2047 - len,"\w6. Force Melee/Regular^n" )     len += format(menuBody[len],2047 - len,"\w7. Change Player Run Speed^n" )     len += format(menuBody[len],2047 - len,"\w8. MegaSlap Player^n^n^n" )     len += format(menuBody[len],2047 - len,"\w0. Exit" )     new keys = (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<7|1<<8|1<<9)     show_menu(id,keys,menuBody)     } public cmdAimAdminmenu(id,level,cid){ // This part of the code gets who the admin is aiming at, and checks for immmunity      if(!cmd_access (id,level,cid,1))       {       return PLUGIN_HANDLED      }      new TargetID,body      get_user_aiming(id,TargetID,body)        if (!TargetID){ // Checks to see if "TargetID" has any value, if it does not. Then the admin is not aiming at anyone.           client_print(id,print_center,"No valid target for Adminmenu")           return PLUGIN_HANDLED          }      if(access(TargetID, ADMIN_IMMUNITY)) {     //if (get_user_flags(TargetID) && ADMIN_IMMUNITY){ // Checks if the TargetID has admin immunity           client_print(id,print_center,"Target has admin immunity")           return PLUGIN_HANDLED          }        g_AdminTarget[id] = TargetID        DisplayAimAdminmenu(id)      return PLUGIN_HANDLED     } #if LastAdminTarget == 1 public cmdLastAdminTarget(id,level,cid){ // This code checks if g_LastTarget[id] has any value.  If it does, it opens the menu menu     if(!cmd_access (id,level,cid,1)) return PLUGIN_HANDLED     if (!g_LastTarget[id]){ // Checks to see if "TargetID" has any value, if it does not. Then the admin is not aiming at anyone.         client_print(id,print_center,"There is no last admin target.")         return PLUGIN_HANDLED         }     g_AdminTarget[id] = g_LastTarget[id]     DisplayAimAdminmenu(id)     return PLUGIN_HANDLED     } #endif

Last edited by josjau; 10-05-2006 at 21:16.
josjau is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:57.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode