AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Weapon Stripping on ResetHUD (https://forums.alliedmods.net/showthread.php?t=5790)

twistedeuphoria 09-12-2004 23:08

Weapon Stripping on ResetHUD
 
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.

KRoT@L 09-13-2004 06:50

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 }

karlos 09-13-2004 07:22

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 }

SidLuke 09-13-2004 10:09

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 }

WDUK 09-13-2004 10:41

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'?

PM 09-13-2004 10:44

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.

Twilight Suzuka 09-13-2004 11:15

There should be like, a better way. a WAY better way.

twistedeuphoria 09-13-2004 11:34

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?

Twilight Suzuka 09-13-2004 13:23

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.

twistedeuphoria 09-13-2004 14:14

Oh yeah, would blocking buyequip be the same as blocking buy? ie.
Code:
register_clcmd("buyequip","blockbuy")


All times are GMT -4. The time now is 17:17.

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