Raised This Month: $ Target: $400
 0% 

Need help spawning crowbar


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
joecaprini
Junior Member
Join Date: Jul 2004
Location: In a blackhole
Old 03-10-2005 , 20:46   Need help spawning crowbar
Reply With Quote #1

I was trying to write a plugin that will spawn a crowbar in front of you but I can't get it to appear it just says unknown command.

Code:
#include <amxmodx> #include <engine> public plugin_init() {     register_plugin("Crowbar","0.1","JoeCaprini")     register_clcmd("amx_crowbar","createcrowbar",ADMIN_BAN,"- Creates a crowbar") } public createcrowbar() {     // Create the crowbar     new entbar = create_entity("info_target")     // Give it a new name     entity_set_string(entbar,EV_SZ_classname,"crowbar")     // Set the model     entity_set_model(entbar,"models/w_crowbar.mdl")     // Position it     new Float:PVEC[3] = {0.0,0.0,0.0}     entity_set_origin(entbar,PVEC)     // Set some properties I don't understand     entity_set_int(entbar, EV_INT_solid, 1)     entity_set_int(entbar, EV_INT_movetype, 6)     return PLUGIN_CONTINUE } // new weaponid, clip, ammo // weaponid = get_user_weapon(id, clip, ammo) // if (weaponid == CSW_C4) // { //      ammo_hud(id, 1) //      entity_set_string(id, EV_SZ_viewmodel, "models/v_crowbar.mdl") //      entity_set_string(id, EV_SZ_weaponmodel, "models/p_crowbar.mdl") // } public plugin_precache() {     precache_model("models/w_crowbar.mdl")     precache_model("models/v_crowbar.mdl")     precache_model("models/p_crowbar.mdl") }
__________________
-JOECAPRINI-
joecaprini is offline
Send a message via AIM to joecaprini
tight2089
Member
Join Date: Mar 2005
Location: Newport Beach, CA
Old 03-10-2005 , 22:03  
Reply With Quote #2

1) Did you install all the files in the right place and add a line to plugins.ini
2) Do you have the proper metamods in order to use this plugin?
__________________
Condition Zero UWC3 Server I.P:
67.18.205.222:27015
Clan WebSite:
www.GamingC3nter.com
tight2089 is offline
Send a message via AIM to tight2089 Send a message via MSN to tight2089
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 03-10-2005 , 22:09  
Reply With Quote #3

Quote:
Originally Posted by tight2089
1) Did you install all the files in the right place and add a line to plugins.ini
2) Do you have the proper metamods in order to use this plugin?
Wow , he needs help with the SCRIPTING of the plugin , not the INSTALLING of a plugin.
Peli is offline
Send a message via MSN to Peli
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 03-10-2005 , 22:16  
Reply With Quote #4

The classname should be "weapon_crowbar", not "crowbar", and you're setting its origin to 0, 0, 0, which probably isn't where the player is standing.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 03-10-2005 , 23:30  
Reply With Quote #5

You've forgotten something Avalanche.

Code:
new entbar = create_entity("info_target")
Wont do.
Code:
new entbar = create_entity("weapon_crowbar")
Is how you should do it. Just changing the classname does not change what the ent is.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
joecaprini
Junior Member
Join Date: Jul 2004
Location: In a blackhole
Old 03-11-2005 , 19:43  
Reply With Quote #6

Ok that's it, I give up. I simply cannot get it to spawn Could anyone please tell me how to spawn it infront of me and when I pick it up it is a crowbar? I have no clue
__________________
-JOECAPRINI-
joecaprini is offline
Send a message via AIM to joecaprini
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 14:10.


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