Raised This Month: $ Target: $400
 0% 

My second script. Need some help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
XunTric
BANNED
Join Date: Jan 2005
Location: Norway/Norge
Old 02-04-2005 , 11:43   My second script. Need some help
Reply With Quote #1

Hey i was making my second script. Im really noob at this just as you know. I got a name changer plugin, llama plugin and chicken plugin. And i tryed to make a command called amx_mess which makes you llama, chicken and changes your name too "DONT MESS WITH THE ADMINS". And another command that removes the stuff... I know i forgot some lines to indentify the user so amxx knows who to "mess" up. So i need some help.
Here it is:
Code:
#include <amxmodx> #include <amxmisc> public plugin_init() { register_plugin("amx_mess", "1.0", "XunTric") register_concmd("amx_mess", "cmdmess", ADMIN_KICK, "<name or #userid>") register_concmd("amx_unmess", "cmdunmess", ADMIN_KICK, "<name or #userid>") } public cmdmess(id,level,cid) {     if (!cmd_access(id,level,cid,2))          return PLUGIN_HANDLED     server_cmd("amx_chicken %s")     server_cmd("amx_llama %s")     server_cmd("amx_name %s DONT MESS WITH THE ADMINS")          return PLUGIN_HANDLED } public cmdunmess(id,level,cid) {     if (!cmd_acces(id,level,cid,2))          return PLUGIN_HANDLED     server_cmd("amx_unchicken %s")     server_cmd("amx_unllama %s")     server_cmd("amx_name %s I CAN CHANGE MY NAME BACK NOW")          return PLUGIN_HANDLED     }
XunTric is offline
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 02-04-2005 , 12:20   some work
Reply With Quote #2

You need to read the argument of the player name. The command gets called but the input <name> you want to 'mess' is not called. Try this:

Code:
#include <amxmodx> #include <amxmisc> public plugin_init() { register_plugin("amx_mess", "1.0", "XunTric") register_concmd("amx_mess", "cmdmess", ADMIN_KICK, "<name or #userid>") register_concmd("amx_unmess", "cmdunmess", ADMIN_KICK, "<name or #userid>") } public cmdmess(id,level,cid) {     if (!cmd_access(id,level,cid,2))          return PLUGIN_HANDLED     new arg[32]     read_argv(1,arg,31)     new player = cmd_target(id,arg,31)     server_cmd("amx_chicken %s", player)     server_cmd("amx_llama %s", player)     server_cmd("amx_name %s DONT MESS WITH THE ADMINS", player)          return PLUGIN_HANDLED }

Do the same for unmess and im not sure if the server_cmd with the %s will work, just test with it for a bit
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 02-04-2005 , 16:01  
Reply With Quote #3

I believe he is trying to run the commands via player name, so you need to get the name, too. Try this.

Code:
#include <amxmodx> #include <amxmisc> public plugin_init() { register_plugin("amx_mess", "1.0", "XunTric") register_concmd("amx_mess", "cmdmess", ADMIN_KICK, "<name or #userid>") register_concmd("amx_unmess", "cmdunmess", ADMIN_KICK, "<name or #userid>") } public cmdmess(id,level,cid) {     if (!cmd_access(id,level,cid,2))          return PLUGIN_HANDLED     new arg[32]     read_argv(1,arg,31)     new player = cmd_target(id,arg,1)     if(!player)          return PLUGIN_HANDLED     new name[64];     get_user_name(player,name,63);     server_cmd("amx_chicken ^"%s^"", name)     server_cmd("amx_llama ^"%s^"", name)     server_cmd("amx_name ^"%s^" ^"DONT MESS WITH THE ADMINS^"", name)          return PLUGIN_HANDLED }

I also made sure to check that the player was found (the "!player" check) and fixed the flags for cmd_target.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
XunTric
BANNED
Join Date: Jan 2005
Location: Norway/Norge
Old 02-04-2005 , 18:00  
Reply With Quote #4

Thanks guys it almost works! It compiles and the command work. But the command only make you llama and changes your name. It doesnt make you to a chicken. Any ideas how to fix it? Just as you know i used what XxAvalanchexX said. Its maybe because i get those warnings when i compile? When i compile i get this:

//// amx_mess.sma
// D:Spill/Steam/SteamApps/My@Mail(Secret )/detiacted server/cstrike/addons/amxmodx/scripting/amx_mess.sma <30> : warning 217: loose indentation
// D:Spill/Steam/SteamApps/My@Mail(Secret )/detiacted server/cstrike/addons/amxmodx/scripting/amx_mess.sma <52> : warning 217: loose indentation
//
// 2 warnings.
// Done.

And can somebody help me to make amx write "*Player* has been messed up by the admins. Have fun!" on the screen when the command is used?
Well, this is what i got now:
Code:
#include <amxmodx> #include <amxmisc> public plugin_init() { register_plugin("amx_mess", "1.0", "XunTric") register_concmd("amx_mess", "cmdmess", ADMIN_KICK, "<name or #userid>") register_concmd("amx_unmess", "cmdunmess", ADMIN_KICK, "<name or #userid>") } public cmdmess(id,level,cid) {     if (!cmd_access(id,level,cid,2))          return PLUGIN_HANDLED     new arg[32]     read_argv(1,arg,31)     new player = cmd_target(id,arg,1)     if(!player)          return PLUGIN_HANDLED     new name[64];     get_user_name(player,name,63);     server_cmd("amx_llama ^"%s^"", name)     server_cmd("amx_chicken ^"%s^"", name)     server_cmd("amx_name ^"%s^" ^"DONT MESS WITH THE ADMINS^"", name)          return PLUGIN_HANDLED } public cmdunmess(id,level,cid) {         if (!cmd_access(id,level,cid,2))          return PLUGIN_HANDLED     new arg[32]     read_argv(1,arg,31)     new player = cmd_target(id,arg,1)     if(!player)          return PLUGIN_HANDLED     new name[64];     get_user_name(player,name,63);     server_cmd("amx_unllama ^"%s^"", name)     server_cmd("amx_unchicken ^"%s^"", name)     server_cmd("amx_name ^"%s^" ^"I CAN CHANGE MY NAME BACK NOW^"", name)          return PLUGIN_HANDLED }
XunTric is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 02-04-2005 , 20:41  
Reply With Quote #5

Loose indentations don't affect the plugin at all. Anyway, are you sure the amx_chicken function exists? Do you have chickenmod on your server?
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
XunTric
BANNED
Join Date: Jan 2005
Location: Norway/Norge
Old 02-05-2005 , 04:15  
Reply With Quote #6

Yes im 100% sure that chicken mod exist. I dont got the original on metamod though. I just downloaded that chickenmod: rebirth thing to amxx. Do you have any idea of whats wrong?
-----------------------------------------------------------------------------
EDIT:
I made it! =) I just read thru the chicken mod readme file and found a command called c_chicken instead of amx_chicken. And that one worked =)
XunTric is offline
Silverice146
Member
Join Date: Mar 2005
Location: In a box
Old 04-06-2005 , 00:11  
Reply With Quote #7

lol gj sounds pretty tight
__________________
Silverice146 is offline
Send a message via AIM to Silverice146
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 04-06-2005 , 14:28  
Reply With Quote #8



Silverice, you revived a thread 2 months old for no reaosn whatsoever... nice.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Reply



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 19:21.


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