Raised This Month: $ Target: $400
 0% 

awp/autosniper replacer


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
allenwr
Veteran Member
Join Date: Jan 2006
Location: The place where the karm
Old 05-01-2006 , 01:28   awp/autosniper replacer
Reply With Quote #1

Code:
#include <amxmodx>   #include <amxmisc>   #include <fun>   public check_noobguns(id)   {       if(get_cvar_num("amx_nonoobguns") != 1 || !is_user_alive(id))           return PLUGIN_CONTINUE       new weap = read_data(1)       if(weap == 18 || weap == 24 || weap == 13)       {           new params[2]           params[0] = id           params[1] = weap                 set_task(0.1, "drop_noobguns", id , params , 2)       }           return PLUGIN_CONTINUE   }   public drop_awp(params[2])   {       new id = params[0]       new weap = params[1]       new origin[3]       get_user_origin(id, origin, 0)       origin[2] -= 2000       set_user_origin(id, origin)       switch(weap)       {           case 18: engclient_cmd(id, "drop", "weapon_awp")           }       give_item(id, "weapon_scout")       give_item(id, "ammo_762nato")       origin[2] += 2001       set_user_origin(id, origin)   }   public drop_g3sg1(params[2])   {       new id = params[0]       new weap = params[1]       new origin[3]       get_user_origin(id, origin, 0)       origin[2] -= 2000       set_user_origin(id, origin)       switch(weap)       {           case 13: engclient_cmd(id, "drop", "weapon_g3sg1")         }       give_item(id, "weapon_mac10")       give_item(id, "ammo_762nato")       origin[2] += 2001       set_user_origin(id, origin)   }   public drop_sg550(params[2])   {       new id = params[0]       new weap = params[1]       new origin[3]       get_user_origin(id, origin, 0)       origin[2] -= 2000       set_user_origin(id, origin)       switch(weap)       {           case 24: engclient_cmd(id, "drop", "weapon_sg550")         }       give_item(id, "weapon_tmp")       give_item(id, "ammo_762nato")       origin[2] += 2001       set_user_origin(id, origin)   }   public plugin_init()   {       register_plugin("Nonoobguns", "0.1", "Allenwr")       register_event("WeapPickup", "check_noobguns", "b")       register_cvar("amx_nonoobguns", "1")   }

i cant find the error(s) in my code, any one see why?
it compiles fine, but it doesnt work on my server
please help
__________________
Don't ever place an order with Vee Servers. This is why.
allenwr is offline
Send a message via ICQ to allenwr Send a message via Yahoo to allenwr
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 05-01-2006 , 01:33   Re: awp/autosniper replacer
Reply With Quote #2

I told you earlier that all you needed to do was combine all 3 of those functions into 1:
Code:
#include <amxmodx>    #include <amxmisc>  #include <fun>    public check_noobguns(id)     {         if(get_cvar_num("amx_nonoobguns") != 1 || !is_user_alive(id))             return PLUGIN_CONTINUE        new weap = read_data(1)     if(weap == 18 || weap == 24 || weap == 13)      {           new params[2]           params[0] = id          params[1] = weap                    set_task(0.1, "drop_noobguns", id , params , 2)     }             return PLUGIN_CONTINUE    }     public drop_noobguns(params[2])   {         new id = params[0]      new weap = params[1]        new origin[3]         get_user_origin(id, origin, 0)        origin[2] -= 2000         set_user_origin(id, origin)       switch(weap)        {             case CSW_AWP:         {             engclient_cmd(id, "drop", "weapon_awp")             give_item(id, "weapon_scout")                 give_item(id, "ammo_762nato")         }         case CSW_G3SG1:         {             engclient_cmd(id, "drop", "weapon_g3sg1")             give_item(id, "weapon_mac10")             give_item(id, "ammo_762nato")         }         case CSW_SG550:         {             engclient_cmd(id, "drop", "weapon_sg550")             give_item(id, "weapon_tmp")               give_item(id, "ammo_762nato")         }     }             origin[2] += 2001         set_user_origin(id, origin)   } public plugin_init()      {         register_plugin("Nonoobguns", "0.1", "Allenwr")       register_event("WeapPickup", "check_noobguns", "b")       register_cvar("amx_nonoobguns", "1")      }
__________________
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
allenwr
Veteran Member
Join Date: Jan 2006
Location: The place where the karm
Old 05-01-2006 , 01:39  
Reply With Quote #3

my bad, i noobed it... when you told me the 1st time, i didnt code it right...

i would show you what i did, but i lost it...

2 +karma points to v3x.
__________________
Don't ever place an order with Vee Servers. This is why.
allenwr is offline
Send a message via ICQ to allenwr Send a message via Yahoo to allenwr
RCC|Dynamite
Senior Member
Join Date: May 2004
Location: Germany
Old 05-02-2006 , 09:02  
Reply With Quote #4

It's a good plugin idea. It should add a concmd so that it can specify what guns to replace what.

Like:

amx_ng_replace awp ak47
amx_ng_replace g3sg1 mac10

That would make this plugin more flexible.

I wanne implemented admin immunity and any warning messages, to notify the players that those weapons are not allowed. I'd love to see the look on someones face who's been saving up for an awp 5 rounds and realizes it's not allowed.

someone can help me to realize it?

Code:
#include <amxmodx>     #include <amxmisc>     #include <fun>     #define ADMIN_LEVEL ADMIN_CHAT public check_noobguns(id)     {         if(get_cvar_num("amx_nonoobguns") != 1 || !is_user_alive(id))     if(get_cvar_num("sv_allow_admin_awp") == 1 && access(id, ADMIN_LEVEL))     if(get_cvar_num("sv_allow_admin_auto") == 1 && access(id, ADMIN_LEVEL))     if(get_cvar_num("sv_allow_admin_sg550") == 1 && access(id, ADMIN_LEVEL))           return PLUGIN_CONTINUE         new weap = read_data(1)         if(weap == 18 || weap == 24 || weap == 13)         {             new params[2]             params[0] = id             params[1] = weap                     set_task(0.1, "drop_noobguns", id , params , 2)         }               return PLUGIN_CONTINUE     }     public drop_noobguns(params[2])     {         new id = params[0]         new weap = params[1]         new origin[3]         get_user_origin(id, origin, 0)         origin[2] -= 2000         set_user_origin(id, origin)         switch(weap)         {             case CSW_AWP:         {             engclient_cmd(id, "drop", "weapon_awp")                 give_item(id, "weapon_scout")                 give_item(id, "ammo_762nato")             client_print(id, print_center, "AWP's are not allowed. Here you have a real gun!")           }         case CSW_G3SG1:         {             engclient_cmd(id, "drop", "weapon_g3sg1")             give_item(id, "weapon_mac10")             give_item(id, "ammo_762nato")             client_print(id, print_center, "G3SG1's are not allowed. Here you have a real gun!")         }         case CSW_SG550:         {             engclient_cmd(id, "drop", "weapon_sg550")             give_item(id, "weapon_tmp")                 give_item(id, "ammo_762nato")             client_print(id, print_center, "SG550's are not allowed. Here you have a real gun!")         }     }             origin[2] += 2001         set_user_origin(id, origin)     } public plugin_init()     {         register_plugin("Nonoobguns", "0.1", "Allenwr")         register_event("WeapPickup", "check_noobguns", "b")         register_cvar("amx_nonoobguns", "1")     register_cvar("sv_allow_admin_g3sg1", "0")     register_cvar("sv_allow_admin_sg550", "0")     register_cvar("sv_allow_admin_awp", "0")         return PLUGIN_CONTINUE }
__________________

|###########|
|###########|
|###########|
RCC|Dynamite is offline
Send a message via ICQ to RCC|Dynamite
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 05:12.


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