Raised This Month: $51 Target: $400
 12% 

Mor Freegun Help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MOBOB
Member
Join Date: Dec 2004
Old 01-22-2006 , 01:17   Mor Freegun Help
Reply With Quote #1

Maybe you remember helping me with a freegun granting plugin that allows certain pplayers to recieve free weapons once per map. See below for code:

Code:
#include <amxmodx>  #include <amxmisc>  #include <cstrike>  #include <fun>  #define PLUGIN "Freegun"  #define VERSION "1.0"  #define AUTHOR "|sXe| Mr. Foster"  new bool:user_gothisgun[33] public plugin_init() {      register_plugin(PLUGIN, VERSION, AUTHOR)      register_clcmd("freegun", "cmd_weapon", ADMIN_LEVEL_H, "<weapon(m4, ak)>")  }  public client_putinserver(id) {     user_gothisgun[id] = false } public cmd_weapon(id, level, cid) {      if(!cmd_access(id, level, cid, 2))         return PLUGIN_HANDLED     if(user_gothisgun[id])         return PLUGIN_HANDLED             new whatwassaid[32]      read_argv(1, whatwassaid, 31)           new name[32]     get_user_name(id, name, 31)         if(equali(whatwassaid,"m4", 2))     {          give_item(id, "weapon_m4a1")          cs_set_user_bpammo(id, CSW_M4A1, 90)     client_print(id,print_console,"You have received your M4A1. Thank you for donating to our server.")         client_print(0,print_chat, "*****%s used his freegun power to give himself an M4A1.*****", name)     client_print(0,print_chat, "*****Say /rewards to learn about dontating to our server and recieving rewards.*****", name)          user_gothisgun[id] = true     }     else if(equali(whatwassaid,"ak", 2))     {          give_item(id, "weapon_ak47")         cs_set_user_bpammo(id, CSW_AK47, 90)     client_print(id,print_console,"You have received your AK47. Thank you for donating to our server.")         client_print(0,print_chat, "*****%s used his freegun power to give himself an AK47.*****", name)     client_print(0,print_chat, "*****Say /rewards to learn about dontating to our server and recieving rewards.*****", name)          user_gothisgun[id] = true     }     return PLUGIN_HANDLED }

I am looking to edit this plugin so that it allows users to access this feature 3 times per map. I tried to do it myself but nothing works....

Here is what i came up with:


Code:
#include <amxmodx>  #include <amxmisc>  #include <cstrike>  #include <fun>  #define PLUGIN "Freegun"  #define VERSION "1.0"  #define AUTHOR "|sXe| Mr. Foster"  new bool:user_gothisgun[33] new bool:user_gothisgun2[33] new bool:user_gothisgun3[33] public plugin_init() {      register_plugin(PLUGIN, VERSION, AUTHOR)      register_clcmd("freegun", "cmd_weapon", ADMIN_LEVEL_H, "<weapon(m4, ak)>")  }  public client_putinserver(id) {     user_gothisgun[id] = false     user_gothisgun2[id] = false     user_gothisgun3[id] = false } public cmd_weapon(id, level, cid) {      if(!cmd_access(id, level, cid, 2))         return PLUGIN_HANDLED     new whatwassaid[32]      read_argv(1, whatwassaid, 31)           new name[32]     get_user_name(id, name, 31)         if(user_gothisgun[id])         if(equali(whatwassaid,"m4", 2))         {              give_item(id, "weapon_m4a1")              cs_set_user_bpammo(id, CSW_M4A1, 90)             client_print(id,print_console,"You have received your M4A1. Thank you for donating to our server.")         client_print(id,print_console,"You have used your last freegun access for this map. Please wait until next map before trying again.")             client_print(0,print_chat, "%s used his freegun power to give himself an M4A1.", name)         client_print(0,print_chat, "Say /rewards to learn about dontating to our server and recieving rewards.", name)              user_gothisgun2[id] = true         }         else if(equali(whatwassaid,"ak", 2))         {              give_item(id, "weapon_ak47")             cs_set_user_bpammo(id, CSW_AK47, 90)         client_print(id,print_console,"You have received your AK47. Thank you for donating to our server.")         client_print(id,print_console,"You have used your last freegun access for this map. Please wait until next map before trying again.")             client_print(0,print_chat, "%s used his freegun power to give himself an AK47.", name)         client_print(0,print_chat, "Say /rewards to learn about dontating to our server and recieving rewards.", name)              user_gothisgun2[id] = true         }           return PLUGIN_HANDLED     if(user_gothisgun2[id])         if(equali(whatwassaid,"m4", 2))         {              give_item(id, "weapon_m4a1")              cs_set_user_bpammo(id, CSW_M4A1, 90)             client_print(id,print_console,"You have received your M4A1. Thank you for donating to our server.")         client_print(id,print_console,"You have used your freegun access for the second time this map. You have 1 use remaining.")             client_print(0,print_chat, "%s used his freegun power to give himself an M4A1.", name)         client_print(0,print_chat, "Say /rewards to learn about dontating to our server and recieving rewards.", name)              user_gothisgun3[id] = true         }         else if(equali(whatwassaid,"ak", 2))         {              give_item(id, "weapon_ak47")             cs_set_user_bpammo(id, CSW_AK47, 90)         client_print(id,print_console,"You have received your AK47. Thank you for donating to our server.")         client_print(id,print_console,"You have used your freegun access for the second time this map. You have 1 use remaining.")             client_print(0,print_chat, "%s used his freegun power to give himself an AK47.", name)         client_print(0,print_chat, "Say /rewards to learn about dontating to our server and recieving rewards.", name)              user_gothisgun3[id] = true         }        return PLUGIN_HANDLED     if(user_gothisgun3[id])         return PLUGIN_HANDLED                 if(equali(whatwassaid,"m4", 2))     {          give_item(id, "weapon_m4a1")          cs_set_user_bpammo(id, CSW_M4A1, 90)     client_print(id,print_console,"You have received your M4A1, Thank you for donating to our server.")     client_print(id,print_console,"You have used your freegun access for the first time this map. You have 2 uses remaining.")         client_print(0,print_chat, "%s used his freegun power to give himself an M4A1.", name)     client_print(0,print_chat, "Say /rewards to learn about dontating to our server and recieving rewards.", name)          user_gothisgun[id] = true     }     else if(equali(whatwassaid,"ak", 2))     {          give_item(id, "weapon_ak47")         cs_set_user_bpammo(id, CSW_AK47, 90)     client_print(id,print_console,"You have received your AK47. Thank you for donating to our server.")     client_print(id,print_console,"You have used your freegun access for the first time this map. You have 2 uses remaining.")         client_print(0,print_chat, "%s used his freegun power to give himself an AK47.", name)     client_print(0,print_chat, "Say /rewards to learn about dontating to our server and recieving rewards.", name)          user_gothisgun[id] = true     }     return PLUGIN_HANDLED }

PLease help me!!

Thanks,
MOBOB
__________________
MOBOB is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 01-22-2006 , 08:38  
Reply With Quote #2

No actually I don't, but here:

Code:
#include <amxmodx>  #include <amxmisc>  #include <cstrike>  #include <fun>  #define PLUGIN "Freegun"  #define VERSION "1.0"  #define AUTHOR "|sXe| Mr. Foster"  new user_gothisgun[33] public plugin_init() {      register_plugin(PLUGIN, VERSION, AUTHOR)      register_clcmd("freegun", "cmd_weapon", ADMIN_LEVEL_H, "<weapon(m4, ak)>")      register_event("ResetHUD","clear_used","be") }  public client_disconnect(id) {     clear_used(id) } public clear_used(id) {     user_gothisgun[id] = 0 } public cmd_weapon(id, level, cid) {      if(!cmd_access(id, level, cid, 2))         return PLUGIN_HANDLED         if(user_gothisgun[id] >= 3)     {         client_print(id,print_console,"You have used this the max number of times this round.")         client_print(id,print_chat,"[AMXX] You have used this the max number of times this round.")         return PLUGIN_HANDLED     }         new whatwassaid[32]      read_argv(1, whatwassaid, 31)         new name[32]     get_user_name(id, name, 31)         if(equali(whatwassaid,"m4", 2))     {          give_item(id, "weapon_m4a1")          cs_set_user_bpammo(id, CSW_M4A1, 90)         client_print(id,print_console,"You have received your M4A1. Thank you for donating to our server.")         client_print(0,print_chat, "*****%s used his freegun power to give himself an M4A1.*****", name)         client_print(0,print_chat, "*****Say /rewards to learn about dontating to our server and recieving rewards.*****", name)          user_gothisgun[id]++     }     else if(equali(whatwassaid,"ak", 2))     {          give_item(id, "weapon_ak47")         cs_set_user_bpammo(id, CSW_AK47, 90)         client_print(id,print_console,"You have received your AK47. Thank you for donating to our server.")         client_print(0,print_chat, "*****%s used his freegun power to give himself an AK47.*****", name)         client_print(0,print_chat, "*****Say /rewards to learn about dontating to our server and recieving rewards.*****", name)          user_gothisgun[id]++     }     return PLUGIN_HANDLED }
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
MOBOB
Member
Join Date: Dec 2004
Old 01-22-2006 , 16:47  
Reply With Quote #3

thanks alot. I am going to test it now.
__________________
MOBOB is offline
MOBOB
Member
Join Date: Dec 2004
Old 01-22-2006 , 20:58  
Reply With Quote #4

works great thanks alot
__________________
MOBOB 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 13:36.


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