Raised This Month: $ Target: $400
 0% 

Problem with one of my scripts


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Silent_Killer
Junior Member
Join Date: May 2004
Old 05-10-2004 , 18:53   Problem with one of my scripts
Reply With Quote #1

Code:
#include <amxmodx>

public plugin_init()
{
register_plugin ("get wep name", "0.1", "Silent_Killer")
register_clcmd ("getwepname", "getwep", ADMIN_KICK, "Gets your weapons name")
}

public getwep (id, level, cid)
{
new wepname[32]
get_weaponname (id, wepname, 31)
client_print(id, print_chat, "Your weapon name is currently %s!", wepname)
return PLUGIN_HANDLED
}
The plugin is complied and everything, but when I go into game and type in getwepname, nothing happens. Any clue why?
Silent_Killer is offline
Silent_Killer
Junior Member
Join Date: May 2004
Old 05-12-2004 , 21:16  
Reply With Quote #2

Well, I got it working, but no matter what I do it returns weapon_p228 all the time, even when I don't have it. Anyone know what I did wrong?
Silent_Killer is offline
ts2do
Senior Member
Join Date: Mar 2004
Old 05-13-2004 , 19:22  
Reply With Quote #3

Code:
#include <amxmodx> public plugin_init() {     register_plugin ("get wep name", "0.1", "Silent_Killer")     register_clcmd ("getwepname", "getwep", ADMIN_KICK, "Gets your weapons name") } public getwep (id, level, cid) {     new temp[2]     get_weaponname(get_user_weapon(id,temp[0],temp[1], wepname, 31)     client_print(id, print_chat, "Your weapon name is currently %s!", wepname)     return PLUGIN_HANDLED }
what u had it doing was get_weaponname for the player's id, not the weapon's id..say ur id is 1....then itll return the weapon name for weapon #1.......what u wanna do is find the waeponname of the weapon the player is holding, get_user_weapon returns that value
ts2do is offline
Send a message via AIM to ts2do
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 20:13.


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