Raised This Month: $ Target: $400
 0% 

NoScopeMode


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

I just read over all of the "sniper" plugins i could find becasue im trying to make a plugin that lets you have unlittied ammo and only gives you a scout but its no scope ONLY. So If Any One Could Help??? Would Be Great
__________________
onfirenburnin420 is offline
Send a message via AIM to onfirenburnin420
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 04-10-2005 , 16:33  
Reply With Quote #2

You could try this, don't know if it will work:

Code:
public client_PreThink(id) {    if(!is_user_alive(id)) {       return PLUGIN_CONTINUE;    }    new button = get_user_button(id);    if(button & IN_ATTACK2) {       entity_set_int(id,EV_INT_button,button & ~IN_ATTACK2);    }    return PLUGIN_CONTINUE; }
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
onfirenburnin420
Senior Member
Join Date: Jan 2005
Old 04-11-2005 , 15:18  
Reply With Quote #3

Ok I Got This:
Code:
#include <amxmodx>   #include <fun> #include <engine> public plugin_init() { register_plugin("NoScopeMode","1.0","Fire") register_cvar("amx_scope","1") } public client_PreThink(id) { if (get_cvar_num("amx_scope") !=1) { return PLUGIN_CONTINUE; } if(!is_user_alive(id)) { return PLUGIN_CONTINUE; } new button = get_user_button(id); if(button & IN_ATTACK2) { entity_set_int(id,EV_INT_button,button & ~IN_ATTACK2); } return PLUGIN_CONTINUE; }
And It Works But Now I Just Need To Make A Csay Message...
__________________
onfirenburnin420 is offline
Send a message via AIM to onfirenburnin420
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-11-2005 , 15:25  
Reply With Quote #4

Use set_hudmessage() and show_hudmessage(). Also, this plugin will help you with the placement.
__________________
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-11-2005 , 17:12  
Reply With Quote #5

how would i toggle the hud_message for when the plugin is turned on or off.... example "No Scope Mode Has Just Been Enabled" or when you turn it off it says "No Scope Mode Has Now Been Disabled" plz help
__________________
onfirenburnin420 is offline
Send a message via AIM to onfirenburnin420
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-11-2005 , 17:35  
Reply With Quote #6

Something like this:
Code:
#include <amxmodx> #include <amxmisc> #include <fun> #include <engine> public plugin_init() {     register_plugin("NoScopeMode","1.0","Fire")     register_clcmd("amx_scope","doScope",ADMIN_KICK,"- Turns scope mode on/off")     register_cvar("amx_noscope","1") } public client_PreThink(id) {     if (get_cvar_num("amx_noscope") !=1) {         return PLUGIN_CONTINUE     }     if(!is_user_alive(id)) {         return PLUGIN_CONTINUE     }     new button = get_user_button(id);     if(button & IN_ATTACK2) {         entity_set_int(id,EV_INT_button,button & ~IN_ATTACK2);     }     return PLUGIN_CONTINUE } public doScope(id,level,cid) {     if(!cmd_access(id,level,cid,2))         return PLUGIN_HANDLED     new arg[4]     read_argv(1,arg,3)     new cmd = arg[3]     if(cmd == 1) {         // set_hudmessage(...)         show_hudmessage(0,"No scope mode on")         set_cvar_num("amx_noscope",1)     }     else if(cmd == 0) {         // set_hudmessage(...)         show_hudmessage(0,"No scope mode off")         set_cvar_num("amx_noscope",1)     }     return PLUGIN_HANDLED }

Command: amx_scope <1|0>
Cvar: amx_noscope <1|0>
__________________
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-11-2005 , 18:35  
Reply With Quote #7

Code:
#include <amxmodx> #include <amxmisc> #include <fun> #include <engine> public plugin_init() { register_plugin("NoScopeMode","1.0","Fire") register_cvar("amx_scope","1") register_clcmd("amx_scope 1","noscopeon",ADMIN_LEVEL_A,"- Turns No Scope Mode On") register_clcmd("amx_scope 0","noscopeoff",ADMIN_LEVEL_A,"- Turns No Scope Mode Off") } public client_PreThink(id) { if (get_cvar_num("amx_scope") !=0) { return PLUGIN_CONTINUE; } if(!is_user_alive(id)) { return PLUGIN_CONTINUE; } new button = get_user_button(id); if(button & IN_ATTACK2) { entity_set_int(id,EV_INT_button,button & ~IN_ATTACK2); } return PLUGIN_CONTINUE; } public noscopeon(id,lvl,cid) { if(!cmd_access(id,lvl,cid,2)) { server_cmd ("amx_scope 1") show_hudmessage(0,"No Scope Mode Is On") } return PLUGIN_HANDLED } public noscopeoff(id,lvl,cid) { if(!cmd_access(id,lvl,cid,2)) { server_cmd ("amx_scope 0") show_hudmessage(0,"No Scope Mode Is Off") } return PLUGIN_HANDLED }

Cant Get This To Work Wut Am I Doing Wrong???
__________________
onfirenburnin420 is offline
Send a message via AIM to onfirenburnin420
xeroblood
BANNED
Join Date: Mar 2004
Location: Toronto, Canada
Old 04-11-2005 , 21:24  
Reply With Quote #8

Try this
Code:
#include <amxmodx> #include <amxmisc> //#include <fun> #include <engine> public plugin_init() {     register_plugin("NoScopeMode","1.0","Fire")     register_cvar("sv_scope","1")     register_clcmd("amx_scope","ToggleScope",ADMIN_LEVEL_A,"<1|0> - Turns No Scope Mode On/Off") } public client_PreThink(id) {     if (!get_cvar_num("sv_scope"))         return PLUGIN_CONTINUE;     if(!is_user_alive(id))         return PLUGIN_CONTINUE;     new button = get_user_button(id);     if(button & IN_ATTACK2)         entity_set_int(id,EV_INT_button,button & ~IN_ATTACK2);     return PLUGIN_CONTINUE; } public ToggleScope(id,lvl,cid) {     if( !cmd_access(id,lvl,cid,1) )         return PLUGIN_HANDLED;     set_hudmessage(200, 100, 0, -1.0, 0.35, 0, 6.0, 12.0, 0.1, 0.2, 4);     new arg[4]     read_argv( 1, arg, 4 )     if( equali( arg, "on", 2 ) || equali( arg, "1", 1 ) )     {         set_cvar_num( "sv_scope", 1)         show_hudmessage(0,"No Scope Mode Is On")     }     else     {         set_cvar_num( "sv_scope", 0)         show_hudmessage(0,"No Scope Mode Is Off")     }     return PLUGIN_HANDLED }

Note:
You didnt need fun module included..
Also, you should follow the naming conventions used for CVARs and AMX commands, like:

Cvars start with 'sv_', which stands for 'Server Variable'
Commands start with 'amx_' which is self-explanitory.. (or 'amxx_')

Just helps users remember the command/cvar name..

Editted to reflect Avalanches keen eye from post below
(using all default values of course...)
xeroblood is offline
Send a message via MSN to xeroblood
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 04-11-2005 , 22:47  
Reply With Quote #9

I think the problem here is that he isn't using set_hudmessage at all but trying to show one...
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
xeroblood
BANNED
Join Date: Mar 2004
Location: Toronto, Canada
Old 04-11-2005 , 23:10  
Reply With Quote #10

I Totally missed that!! Good eye Avalanche!

I editted my post above, added:
(from amxmodx.inc)
Code:
native set_hudmessage(red=200, green=100, blue=0, Float:x=-1.0, Float:y=0.35, effects=0, Float:fxtime=6.0, Float:holdtime=12.0, Float:fadeintime=0.1, Float:fadeouttime=0.2,channel=4);
xeroblood is offline
Send a message via MSN to xeroblood
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 09:56.


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