Raised This Month: $ Target: $400
 0% 

Give Item Plugin [HELP]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mr. Satan
Senior Member
Join Date: Apr 2004
Location: Fort Wayne, Indiana
Old 08-30-2005 , 14:41   Give Item Plugin [HELP]
Reply With Quote #1

Why wont this work?!

It compiles fine, no errors. However, it is like the command isn't registered at all.

Code:
// GIVING CLIENT ITEMS PVK v1.2b by Dewd In The Newd //========================================================= #include <amxmod> #include <amxmisc> public give_item_pvk(admin_index,victim_index,weapon_give[]) {    new arg1[32]    read_argv(1,arg1,32)    new name[32]    get_user_name(victim_index,name,32)   // Remove The slashes before the follow 2 lines of code to enable info messages    // set_hudmessage(200, 50, 0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1)    // show_hudmessage(0,"%s Has Been Given An Attack",name)     // Items        if (equal(weapon_give,"all")){       give_item(victim_index,"item_chainmail")       give_item(victim_index,"item_food")       give_item(victim_index,"item_leather")       give_item(victim_index,"item_platemail")       give_item(victim_index,"item_treasurechest")    } else if (equal(weapon_give,"chainmail")){       give_item(victim_index,"item_chainmail")    } else if (equal(weapon_give,"food")){       give_item(victim_index,"item_food")    } else if (equal(weapon_give,"leather")) {       give_item(victim_index,"item_leather")    } else if (equal(weapon_give,"platemail")){       give_item(victim_index,"item_platemail")    } else if (equal(weapon_give,"tchest")){       give_item(victim_index,"item_treasurechest")    } else {       client_print(admin_index,print_console,"[AMXX] There is no such item")       return PLUGIN_CONTINUE    }        // client_print(admin_index,print_console,"[AMXX] Client ^"%s^" has been given an item",name)    return PLUGIN_CONTINUE } public admin_item_pvk(id) {    if (!(get_user_flags(id)&ADMIN_LEVEL_A)) {       client_print(id,print_console,"[AMXX] You have no access to that command")       return PLUGIN_HANDLED    }    new argc = read_argc()    if (argc < 3) {       client_print(id,print_console,"[AMXX] Usage: amx_item_pvk < part of nick > or < # index > < item to give >")       return PLUGIN_HANDLED    }    new arg1[32]    new arg2[32]    new arg3[32]    read_argv(1,arg1,32)    read_argv(2,arg2,32)    read_argv(3,arg3,32) //Index    if (equal(arg1,"#")) {       if (is_user_connected(str_to_num(arg2))) {          give_item_pvk(id,str_to_num(arg2),arg3)       } else {          client_print(id,print_console,"[AMXX] Client not found")       }    } else {       new player = find_player("lb",arg1)       if (player) {          give_item_pvk(id,player,arg2)       } else {          client_print(id,print_console,"[AMXX] Client with that part of nick not found")       }    }        return PLUGIN_HANDLED } public plugin_init() {    register_plugin("PVK Give Items","1.2b","Dewd In The Newd")    register_concmd("amx_item_pvk","admin_item_pvk",ADMIN_LEVEL_A,"<part of nick> or <# index> <item to give>")    return PLUGIN_CONTINUE }
__________________
DITN's TEAMSPEAK Server @ ditn.sytes.net:8767
Mr. Satan is offline
Send a message via AIM to Mr. Satan Send a message via MSN to Mr. Satan Send a message via Yahoo to Mr. Satan
Zenith77
Veteran Member
Join Date: Aug 2005
Old 08-30-2005 , 16:45  
Reply With Quote #2

Quote:
public plugin_init()
{
register_plugin("PVK Give Items","1.2b","Dewd In The Newd")
register_concmd("amx_item_pvk","admin_item_pv k",ADMIN_LEVEL_A,"<part of nick> or <# index> <item to give>")
return PLUGIN_CONTINUE
}
take that out...its forwarding it :/
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 08-30-2005 , 16:54  
Reply With Quote #3

Quote:
Originally Posted by Zenith77
Quote:
public plugin_init()
{
register_plugin("PVK Give Items","1.2b","Dewd In The Newd")
register_concmd("amx_item_pvk","admin_item_pv k",ADMIN_LEVEL_A,"<part of nick> or <# index> <item to give>")
return PLUGIN_CONTINUE
}
take that out...its forwarding it :/
What are you talking about? plugin_init needs no return. He could put PLUGIN_HANDLED, CONTINUE, or nothing, and it would do the same thing
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 08-30-2005 , 17:02  
Reply With Quote #4

Hmm, let's try re-writing this a bit.

Code:
// GIVING CLIENT ITEMS PVK v1.2b by Dewd In The Newd //========================================================= #include <amxmodx> #include <amxmisc> #include <fun> public give_item_pvk(admin_index,victim_index,weapon_give[]) {    new name[32]    get_user_name(victim_index,name,31)      // Remove The slashes before the follow 2 lines of code to enable info messages    // set_hudmessage(200, 50, 0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1)    // show_hudmessage(0,"%s Has Been Given An Attack",name)      if (equali(weapon_give,"all")){       give_item(victim_index,"item_chainmail")       give_item(victim_index,"item_food")       give_item(victim_index,"item_leather")       give_item(victim_index,"item_platemail")       give_item(victim_index,"item_treasurechest")    } else {       new item[32]       format(item,31,"item_%s",weapon_give)       give_item(victim_index,item)    }        // client_print(admin_index,print_console,"[AMXX] Client ^"%s^" has been given an item",name) } public admin_item_pvk(id,level,cid) {    if(!cmd_access(id,level,cid,3)) {       return PLUGIN_HANDLED    }    new arg1[32]    new arg2[32]    read_argv(1,arg1,31)    read_argv(2,arg2,31)    new target = cmd_target(id,arg1,6)    if(!target) {       return PLUGIN_HANDLED    }    give_item_pvk(id,target,arg2)    return PLUGIN_HANDLED } public plugin_init() {    register_plugin("PVK Give Items","1.2b","Dewd In The Newd")    register_concmd("amx_item_pvk","admin_item_pvk",ADMIN_LEVEL_A,"<player> <item>") }
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Mr. Satan
Senior Member
Join Date: Apr 2004
Location: Fort Wayne, Indiana
Old 08-30-2005 , 19:11  
Reply With Quote #5

Still doesn't work.

Unknown Command: amx_item_pvk
__________________
DITN's TEAMSPEAK Server @ ditn.sytes.net:8767
Mr. Satan is offline
Send a message via AIM to Mr. Satan Send a message via MSN to Mr. Satan Send a message via Yahoo to Mr. Satan
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 08-30-2005 , 19:27  
Reply With Quote #6

Are there any load errors in the server's console?
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Mr. Satan
Senior Member
Join Date: Apr 2004
Location: Fort Wayne, Indiana
Old 08-30-2005 , 19:29  
Reply With Quote #7

Nope
__________________
DITN's TEAMSPEAK Server @ ditn.sytes.net:8767
Mr. Satan is offline
Send a message via AIM to Mr. Satan Send a message via MSN to Mr. Satan Send a message via Yahoo to Mr. Satan
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 08-30-2005 , 19:33  
Reply With Quote #8

Just tested it on my server and it works fine besides that fact that it isn't Pirates, Vikings, and Knights so I can't receive the items. If I give it invalid arguments it shows me the correct usage and if I use the correct usage the command goes through and doesn't say unknown command. It must be something on your part.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Mr. Satan
Senior Member
Join Date: Apr 2004
Location: Fort Wayne, Indiana
Old 08-30-2005 , 19:50  
Reply With Quote #9

I'm running AMXX 1.55.

No compiling errors or anything. I copied it straight from the forums.

I made the plugin from another plugin I made for ESF, the ESF one works, but on PVK it doesn't.
__________________
DITN's TEAMSPEAK Server @ ditn.sytes.net:8767
Mr. Satan is offline
Send a message via AIM to Mr. Satan Send a message via MSN to Mr. Satan Send a message via Yahoo to Mr. Satan
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 14:17.


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