AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   + commands (https://forums.alliedmods.net/showthread.php?t=19418)

Stormsys 10-16-2005 12:53

+ commands
 
how exsaclty can a +command be used

so it keep repeating the function TestFunct, whenh the bind button is held down


thanks

Zenith77 10-16-2005 13:05

+commands repeat until you let go of the button.

Stormsys 10-16-2005 13:23

yeh thats what i thought 2, but it ony semes to do the command once ....

do i use
register_concmd
or
register_clcmd

broertje 10-16-2005 13:38

register_clcmd

Stormsys 10-16-2005 13:46

yreh just tryed it but same thiong it look like it6 ony repetes the function once so ...

i think unine /\ said, it just has +w/e once and tells the script to stop by -w/e, but how i make the function repeat ansd then stop

broertje 10-16-2005 13:48

i dont understand,post the small(not that i can help,but can always try:d)

Stormsys 10-16-2005 13:54

Code:
        register_clcmd("+sshp_restore", "MB", ADMIN_LEVEL_F,"- gives an admin there 16000 money back")         register_clcmd("-sshp_restore", "MB", ADMIN_LEVEL_F,"- gives an admin there 16000 money back")

and the func
Code:
public MB(id) { if (!(get_user_flags(id)&ADMIN_LEVEL_F)) {         }else{         cs_set_user_money(id, 16000)     } }

ok then it sets it once, im still holding the button i press f1
at buyzone, it uses the money but dosent get it back to 16000 untill i let go(set it to do it once more then -command shows)

now is there i way i can have the function gooing in loops on a timer or somming untill -command to stop the loop

broertje 10-16-2005 14:02

i'm not sure,but i have this...im going to try it out now,
Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #define PLUGIN "New Plugin" #define VERSION "1.0" #define AUTHOR "Author" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)              register_clcmd("+sshp_restore", "MB", ADMIN_LEVEL_F,"- gives an admin there 16000 money back") } public MB(id) { if (!(get_user_flags(id)&ADMIN_LEVEL_F)) {           }else{         cs_set_user_money(id, 16000)       } }

broertje 10-16-2005 14:05

works for me,
so bind a key to +sshp_restore and if you use that key you recieve 16000,is it that you want?

XxAvalanchexX 10-16-2005 14:10

If you want a continuous use, you have to do something like this...

Code:
public plugin_init() {    register_clcmd("+command","command_start");    register_clcmd("-command","command_stop"); } public command_start(id) {    set_task(1.0,"money",id); } public command_stop(id) {    remove_task(id); } public money(id) {    cs_set_user_money(id,16000);    set_task(1.0,"money",id); }


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

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