Raised This Month: $ Target: $400
 0% 

Enabled and disabled problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DarlD
Senior Member
Join Date: Aug 2004
Old 12-16-2005 , 23:24   Enabled and disabled problem
Reply With Quote #1

Im creating a World of Warcraft mod for amxmodx. With the inventory, the bags, the weapons and skills. a lot of work ahead and i have to admit this plugin might be a little bit out of my league, but eh what the eck!

Im using a bool to enable and disable all the commands at once
Code:
new bool:enabled
And i use read_argv to set it, like so:
Code:
public enable(id,level,cid)     {     if (!cmd_access(id,level,cid,1))         {         client_print(id,print_console,"[World Of Warcraft]: You have no access to this command")         return PLUGIN_HANDLED     }     new arg[11]     read_argv(1,arg,10)         if ( (equali(arg,"on", 2)) || (equal(arg,"1", 1)) )         {         enabled = true         client_print(0,print_chat,"[World Of Warcraft] is now Enabled")         client_print(0,print_console,"[World Of Warcraft] is now Enabled")     }     else     if ( (equali(arg,"off",3)) || (equal(arg,"0",4)) )         {         enabled = false         client_print(0,print_chat,"[World Of Warcraft] is now Disabled")         client_print(0,print_console,"[World Of Warcraft] is now Disabled")     }     return PLUGIN_HANDLED }

problem is that the cmds are not registering. when i type wow_enabled on in the console it does nothing

getting 1 warning when i try to compile
Code:
warning 204: symbol is assigned a value that is never used: "enabled"
__________________
DarlD is offline
Send a message via MSN to DarlD
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 12-16-2005 , 23:28  
Reply With Quote #2

where else are you using the bool enabled ?
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 12-16-2005 , 23:30  
Reply With Quote #3

Who script?
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
DarlD
Senior Member
Join Date: Aug 2004
Old 12-16-2005 , 23:32  
Reply With Quote #4

@suicid3: my own

@teame06: I will be using it when an admin will try to enable or disable the other stuff(ex.:bags, inventory)
__________________
DarlD is offline
Send a message via MSN to DarlD
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 12-16-2005 , 23:33  
Reply With Quote #5

It just telling you that you havn't used it for nothing yet.

If you make a fake function to test it like..

Code:
function() {     if(enabled)     {         Do stuff.     } }

Then it go away but other than that you really havn't used it.
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 12-16-2005 , 23:35  
Reply With Quote #6

Wow I'm really tired.....I meant to say "Post the script" but instead started to as "Whole script?" then it came out as "Who script?"

Good night.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
DarlD
Senior Member
Join Date: Aug 2004
Old 12-16-2005 , 23:42  
Reply With Quote #7

rofl, so about the on off command. anyone know why it aint working? (wow_enabled isnt even registered as a command)

if you guyz want to see the hole code now:
Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #define PLUGIN "World of Warcraft" #define AUTHOR "Meta" new bool:enabled public plugin_init()     {     register_plugin(PLUGIN, "0.1", AUTHOR)     register_clcmd("wow_quests","quests",ADMIN_KICK,"Enable or Disable the quests")     register_clcmd("wow_items","items",ADMIN_KICK,"Enable or Disable the items")     register_clcmd("wow_bags","bags",ADMIN_KICK,"Enable or Disable the bags")     register_clcmd("wow_inventory","inventory",ADMIN_KICK,"Enable or Disable the inventory")     register_clcmd("wow_enable","enable",ADMIN_KICK,"Disable or Enable WoW"); } public enable(id,level,cid)     {     if (!cmd_access(id,level,cid,1))         {         client_print(id,print_console,"[World Of Warcraft]: You have no access to this command")         return PLUGIN_HANDLED     }     new arg[11]     read_argv(1,arg,10)         if ( (equali(arg, "on", 2)) || (equal(arg, "1", 1)) )         {         enabled = true         client_print(0,print_chat,"[World Of Warcraft] is now Enabled")         client_print(0,print_console,"[World Of Warcraft] is now Enabled")     }     else     if ( (equali(arg, "off", 3)) || (equal(arg, "0", 4)) )         {         enabled = false         client_print(0,print_chat,"[World Of Warcraft] is now Disabled")         client_print(0,print_console,"[World Of Warcraft] is now Disabled")     }     return PLUGIN_HANDLED } public quests(id,level,cid)     {     if (!cmd_access(id,level,cid,1))         {         client_print(id,print_console,"[World Of Warcraft]: You have no access to this command")         return PLUGIN_HANDLED     }     if ( enabled == true )         {         new arg[11]         read_argv(1,arg,10)                 if ( (equali(arg, "on", 2)) || (equal(arg,"1",1)) )             {             client_print(id,print_console,"[WoW Quests] are now enabled")         }         else         if ( (equali(arg, "off", 3)) || (equal(arg,"0",4)) )             {             client_print(id,print_console,"[WoW Quests] are now disabled")         }     }     return PLUGIN_HANDLED }
__________________
DarlD is offline
Send a message via MSN to DarlD
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 12-17-2005 , 02:43  
Reply With Quote #8

Quote:
Originally Posted by DarlD
wow_enabled isnt even registered as a command
It looks like you are registering wow_enable(no d), not wow_enabled.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
DarlD
Senior Member
Join Date: Aug 2004
Old 12-17-2005 , 06:23  
Reply With Quote #9

I missed typed in the other post i meant wow_enable
__________________
DarlD is offline
Send a message via MSN to DarlD
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 12-17-2005 , 11:20  
Reply With Quote #10

The reason is that you dont have functions for the other commands. And when plugin_init() get to a register_clcmd() with no function it stops running everything else. So either make the other functions first or comment out the lines with register_clcmd() that dont do anything
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
Reply


Thread Tools
Display Modes

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 16:01.


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