Raised This Month: $ Target: $400
 0% 

Weapon Stripping on ResetHUD


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
twistedeuphoria
Veteran Member
Join Date: Jul 2004
Old 09-12-2004 , 23:08   Weapon Stripping on ResetHUD
Reply With Quote #1

Could someone tell me what I'm doing wrong here?
Code:
#include <amxmodx> #include <fun> public plugin_init() {     register_event("ResetHUD","stripwepstask","b") } public stripwepstask(id) {       set_task(1.0,"stripweps",(3424+id))     return PLUGIN_CONTINUE } public stripweps(id) {     strip_user_weapons(id)     return PLUGIN_CONTINUE }
Also, how would I disable the buy menu?
Thank you for your time.
__________________
twistedeuphoria is offline
KRoT@L
Member
Join Date: Aug 2004
Location: http://www.amxmod.net
Old 09-13-2004 , 06:50  
Reply With Quote #2

Code:
set_task(1.0,"stripweps",id)

Code:
public block_buy(id) {     if(cs_get_user_buyzone(id))         return PLUGIN_HANDLED     return PLUGIN_CONTINUE } public blockcommand(id) {     return PLUGIN_HANDLED } public plugin_init() { register_clcmd("cl_setautobuy","blockcommand") register_clcmd("cl_autobuy","blockcommand") register_clcmd("cl_setrebuy","blockcommand") register_clcmd("cl_rebuy","blockcommand") register_clcmd("buy","block_buy") return PLUGIN_CONTINUE }
KRoT@L is offline
karlos
Veteran Member
Join Date: Apr 2004
Location: Germany/Poland
Old 09-13-2004 , 07:22  
Reply With Quote #3

twistedeuphoria try this:
Code:
public stripwepstask(id){     new Userid[1]     Userid[0] = id     set_task(1.0,"stripweps",(3424+id),Userid,1)     return PLUGIN_CONTINUE } public stripweps(id[]){     strip_user_weapons(id[0])     return PLUGIN_CONTINUE }
__________________
alias White Panther
karlos is offline
SidLuke
Senior Member
Join Date: Mar 2004
Location: Poland, Chrzanow
Old 09-13-2004 , 10:09  
Reply With Quote #4

Code:
#include <amxmodx> #include <fun> public plugin_init() {     register_event("ResetHUD","stripwepstask","b") } public stripwepstask(id) {         set_task(1.0,"stripweps",3424+id)     return PLUGIN_CONTINUE } public stripweps(id) {     strip_user_weapons(id-3424)     return PLUGIN_CONTINUE }
or if this is your only task in plugin
Code:
#include <amxmodx> #include <fun> public plugin_init() {     register_event("ResetHUD","stripwepstask","b") } public stripwepstask(id) {         set_task(1.0,"stripweps",id)     return PLUGIN_CONTINUE } public stripweps(id) {     strip_user_weapons(id)     return PLUGIN_CONTINUE }
SidLuke is offline
Send a message via AIM to SidLuke Send a message via MSN to SidLuke
WDUK
Senior Member
Join Date: Aug 2004
Location: Great Britain
Old 09-13-2004 , 10:41  
Reply With Quote #5

Code:
public stripwepstask(id) {           set_task(1.0,"stripweps",3424+id)     return PLUGIN_CONTINUE } public stripweps(id) {     strip_user_weapons(id-3424)     return PLUGIN_CONTINUE }

Why do you need the number '3424'? Just curious as i'm learning, why not use just 'id'?
__________________
R.E.M Gig 2005
Done by VH2
Lancashire Cricket Ground
I'm There!
WDUK is offline
Send a message via MSN to WDUK
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 09-13-2004 , 10:44  
Reply With Quote #6

It's only a random number so he makes somehow "sure" there is no such task id in the system. I don't like this system but modifying it would be too much mess and could break many plugins.
__________________
hello, i am pm
PM is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 09-13-2004 , 11:15  
Reply With Quote #7

There should be like, a better way. a WAY better way.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
twistedeuphoria
Veteran Member
Join Date: Jul 2004
Old 09-13-2004 , 11:34  
Reply With Quote #8

Thanks everybody! I'll test it when I get home. On the subject of task id's, I agree, but then again how would you do that?
__________________
twistedeuphoria is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 09-13-2004 , 13:23  
Reply With Quote #9

Easy. set_task_personal. Same as normal, but you give it ONE name, then when you want to end it, you use end_task_personal(number,id), and it ends it for that ID.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
twistedeuphoria
Veteran Member
Join Date: Jul 2004
Old 09-13-2004 , 14:14  
Reply With Quote #10

Oh yeah, would blocking buyequip be the same as blocking buy? ie.
Code:
register_clcmd("buyequip","blockbuy")
__________________
twistedeuphoria 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 17:17.


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