Raised This Month: $ Target: $400
 0% 

amx_weapons


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
onfirenburnin420
Senior Member
Join Date: Jan 2005
Old 04-08-2005 , 19:21   amx_weapons
Reply With Quote #1

Here Is My Code I Want Only Admins With ADMIN_LEVEL_A To Be Able To Use The Commands... What Do I Do?
Code:
#include <amxmodx> #include <fun> public plugin_init() {     register_plugin("Weapon","1.0","Fire")     register_cvar("amx_weapon","1")     register_clcmd("say /m4","m4a1") } public m4a1(id) { if (get_cvar_num("amx_weapon") !=0) {     give_item(id,"weapon_m4a1")     give_item(id,"ammo_556nato")     give_item(id,"ammo_556nato")     give_item(id,"ammo_556nato")     give_item(id,"ammo_556nato")     give_item(id,"ammo_556nato") } return PLUGIN_HANDLED }
Also Isnt There A Way To Shorten This Up?:
Code:
    give_item(id,"weapon_m4a1")     give_item(id,"ammo_556nato")     give_item(id,"ammo_556nato")     give_item(id,"ammo_556nato")     give_item(id,"ammo_556nato")     give_item(id,"ammo_556nato")
__________________
onfirenburnin420 is offline
Send a message via AIM to onfirenburnin420
KyleD
Member
Join Date: Mar 2005
Location: Anchorage, AK
Old 04-08-2005 , 19:36  
Reply With Quote #2

cs_set_user_bpammo(id,CSW_M4A1,90)

I think..
__________________
KyleD is offline
Send a message via MSN to KyleD
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-08-2005 , 19:40  
Reply With Quote #3

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> public plugin_init() {     register_plugin("Weapon","1.0","Fire")     register_cvar("amx_weapon","1")     register_clcmd("say /m4","m4a1",ADMIN_LEVEL_A,"- Gives m4") } public m4a1(id,lvl,cid) {     if(!cmd_access(id,lvl,cid,2)) {         return PLUGIN_HANDLED     }     if (get_cvar_num("amx_weapon") !=0) {         give_item(id,"weapon_m4a1")         cs_set_user_bpammo(id, CSW_M4A1, 90)     }     return PLUGIN_HANDLED }
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
onfirenburnin420
Senior Member
Join Date: Jan 2005
Old 04-08-2005 , 20:37  
Reply With Quote #4

ok i did all of that and now i have a grand total of :
Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> public plugin_init() {     register_plugin("Weapon","1.0","Fire")     register_cvar("amx_weapon","1")     register_clcmd("say /m4","m4a1",ADMIN_LEVEL_A,"- Gives m4")     register_clcmd("say /ak","ak47",ADMIN_LEVEL_A,"- Gives ak")     register_clcmd("say /deagle","deagle",ADMIN_LEVEL_A,"- Gives deagle")     register_clcmd("say /mp5","mp5navy",ADMIN_LEVEL_A,"- Gives mp5navy")     register_clcmd("say /smoke","smoke",ADMIN_LEVEL_A,"- Gives smoke")     register_clcmd("say /flash","flash",ADMIN_LEVEL_A,"- Gives flash")     register_clcmd("say /he","he",ADMIN_LEVEL_A,"- Gives he")     register_clcmd("say /awp","awp",ADMIN_LEVEL_A,"- Gives awp")     register_clcmd("say /all","all",ADMIN_LEVEL_B,"- Gives all") } public m4a1(id,lvl,cid) {     if(!cmd_access(id,lvl,cid,2)) {         return PLUGIN_HANDLED     }     if (get_cvar_num("amx_weapon") !=0) {         give_item(id,"weapon_m4a1")         cs_set_user_bpammo(id, CSW_M4A1, 90)     }     return PLUGIN_HANDLED } public ak47(id,lvl,cid) {     if(!cmd_access(id,lvl,cid,2)) {         return PLUGIN_HANDLED     }     if (get_cvar_num("amx_weapon") !=0) {         give_item(id,"weapon_ak47")         cs_set_user_bpammo(id, CSW_AK47, 90)     }     return PLUGIN_HANDLED } public deagle(id,lvl,cid) {     if(!cmd_access(id,lvl,cid,2)) {         return PLUGIN_HANDLED     }     if (get_cvar_num("amx_weapon") !=0) {         give_item(id,"weapon_deagle")         cs_set_user_bpammo(id, CSW_DEAGLE, 35)     }     return PLUGIN_HANDLED } public mp5navy(id,lvl,cid) {     if(!cmd_access(id,lvl,cid,2)) {         return PLUGIN_HANDLED     }     if (get_cvar_num("amx_weapon") !=0) {         give_item(id,"weapon_mp5navy")         cs_set_user_bpammo(id, CSW_MP5NAVY, 120)     }     return PLUGIN_HANDLED } public smoke(id,lvl,cid) {     if(!cmd_access(id,lvl,cid,2)) {         return PLUGIN_HANDLED     }     if (get_cvar_num("amx_weapon") !=0) {         give_item(id,"weapon_smokegrenade")     }     return PLUGIN_HANDLED } public flash(id,lvl,cid) {     if(!cmd_access(id,lvl,cid,2)) {         return PLUGIN_HANDLED     }     if (get_cvar_num("amx_weapon") !=0) {         give_item(id,"weapon_flashbang")     give_item(id,"weapon_flashbang")     }     return PLUGIN_HANDLED } public he(id,lvl,cid) {     if(!cmd_access(id,lvl,cid,2)) {         return PLUGIN_HANDLED     }     if (get_cvar_num("amx_weapon") !=0) {         give_item(id,"weapon_hegrenade")     }     return PLUGIN_HANDLED } public awp(id,lvl,cid) {     if(!cmd_access(id,lvl,cid,2)) {         return PLUGIN_HANDLED     }     if (get_cvar_num("amx_weapon") !=0) {         give_item(id,"weapon_awp")         cs_set_user_bpammo(id, CSW_AWP, 30)     }     return PLUGIN_HANDLED } public all(id,lvl,cid) {     if(!cmd_access(id,lvl,cid,2)) {         return PLUGIN_HANDLED     }     if (get_cvar_num("amx_weapon") !=0) {         give_item(id,"weapon_m4a1")         cs_set_user_bpammo(id, CSW_M4A1, 90)         give_item(id,"weapon_ak47")         cs_set_user_bpammo(id, CSW_AK47, 90)         give_item(id,"weapon_deagle")         cs_set_user_bpammo(id, CSW_DEAGLE, 35)         give_item(id,"weapon_mp5navy")         cs_set_user_bpammo(id, CSW_MP5NAVY, 120)         give_item(id,"weapon_smokegrenade")         give_item(id,"weapon_flashbang")     give_item(id,"weapon_flashbang")         give_item(id,"weapon_hegrenade")         give_item(id,"weapon_awp")         cs_set_user_bpammo(id, CSW_AWP, 30)     }     return PLUGIN_HANDLED }
thanks guys you have been a great help
__________________
onfirenburnin420 is offline
Send a message via AIM to onfirenburnin420
KyleD
Member
Join Date: Mar 2005
Location: Anchorage, AK
Old 04-08-2005 , 21:20  
Reply With Quote #5

Glad to be of help.
__________________
KyleD is offline
Send a message via MSN to KyleD
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 09:55.


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