Raised This Month: $ Target: $400
 0% 

Count Down Script


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dizzy
Veteran Member
Join Date: Jun 2004
Location: Massachusetts
Old 02-21-2005 , 21:40   Count Down Script
Reply With Quote #1

Ok...

In my plugin When I have a script go how do you make it give the person something for 5 or 10 seconds?

because when then command in my script goes it doesn't wait 5 seconds then shut off

how do you do this?

thanks
__________________
My Plugins

Purchase Mod - Stable
Type Sounds - Stable
Monster Spawner - Stable
Nade Giver - Maintenance
Dizzy is offline
Send a message via AIM to Dizzy
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 02-21-2005 , 21:54  
Reply With Quote #2

Perhaps describe it in more detail?

You want to perform an action constantly for five seconds?
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Dizzy
Veteran Member
Join Date: Jun 2004
Location: Massachusetts
Old 02-21-2005 , 21:58  
Reply With Quote #3

Yes..

It gives a client speed for 5 seconds

(I would also like a HUD message count down

this is what it does.

Code:
public speed10(id) {    if (get_cvar_num("sv_nfs")==0)       client_print(0,print_chat,"[AMXX][Need For Speed] Is Off!")       return PLUGIN_HANDLED    if (hashadspeed[id])       client_print(0,print_chat,"[AMXX][Need For Speed] Sorry, Try Next Round!")       return PLUGIN_CONTINUE       set_user_speed(id, set_user_speed(id) + 300)       cs_set_user_money(id, cs_get_user_money(id) - 1600)       client_print(0,print_chat,"[AMXX][Need For Speed] You Have Speed For 10 Seconds!")       hashadspeed[id] = true       hasnothadspeed[id] = false       return PLUGIN_HANDLED }

After 5 seconds it shuts off.
__________________
My Plugins

Purchase Mod - Stable
Type Sounds - Stable
Monster Spawner - Stable
Nade Giver - Maintenance
Dizzy is offline
Send a message via AIM to Dizzy
Sp4rt4n
Senior Member
Join Date: Dec 2004
Old 02-21-2005 , 21:58  
Reply With Quote #4

i think he wants to give someone something for five seconds and then take it away from them..
Sp4rt4n is offline
Send a message via MSN to Sp4rt4n
Dizzy
Veteran Member
Join Date: Jun 2004
Location: Massachusetts
Old 02-21-2005 , 22:01  
Reply With Quote #5

yes.

Speed

Please read it..

Also! What is a reasonable speed for a client?

300?

Because lets say the bomb is aboiut to blow and you buy speed.

You run over there quickly with the speed but you needed to pay 1600 for 10 seconds of speed.

It gets you over there
__________________
My Plugins

Purchase Mod - Stable
Type Sounds - Stable
Monster Spawner - Stable
Nade Giver - Maintenance
Dizzy is offline
Send a message via AIM to Dizzy
knekter
Senior Member
Join Date: Mar 2004
Location: PA
Old 02-21-2005 , 22:04   interesting
Reply With Quote #6

Well I know one way of doing it....

Code:
#include <xs> new times[33] = 5 xs_task_begin(1.0, "turn_off", id + 752, "b", 0) xs_task_pushint(id) xs_task_end() XS_MAKE_TASKFUNC(turn_off) {     new id = xs_task_paramint(0)     times[id] -= 1     if(times[id] < 0)         remove_task(id + 752, 0)     hud_message.... }
__________________
More updates for Matrix Mod!
knekter is offline
Send a message via AIM to knekter Send a message via MSN to knekter
Dizzy
Veteran Member
Join Date: Jun 2004
Location: Massachusetts
Old 02-21-2005 , 22:09  
Reply With Quote #7

where would that go in this script?

Code:
//======================================================= #include <amxmodx> #include <fun> //======================================================= new bool:hashadspeed[32] new bool:hasnothadspeed[32] new times[33] = 5 //======================================================= /******************************************************************* *Need For Speed: By: Dizzy                            *===============                                      *Description - Gives You Extra Speed For Either                 *5 or 10 Seconds For A Price (1 Per Round)                  *                                               *Cvars - sv_nfs 0|1 [Off|On]                                *                                               *Clcmds - /needspeed5 - Gives 5 Seconds Of Speed For 800 Dollars   *       /needspeed10 - Gives 10 Seconds Of Speed For 1600 Dollars *         /needspeed? - Tells Client If NFS Is On Or Off           *                                                 *Comments? - Email: <a href="mailto:[email protected]">[email protected]</a>                  *          AIM: AwPOAwPDiZzY                          *******************************************************************/ //======================================================= //======================================================= public plugin_init() {     register_plugin("Need For Speed",".1","Dizzy")     register_cvar("sv_nfs","1")     register_clcmd("say /needspeed5","speed5")     register_clcmd("say /needspeed10","speed10")     register_clcmd("say /needspeed?","speed?")     register_event("ResetHUD","newround","b") } //======================================================= //======================================================= public client_connect( id ) {     hashadspeed[id] = false     hasnothadspeed[id] = true } public client_disconnect( id ) {     hashadspeed[id] = false     hasnothadspeed[id] = true } //======================================================= //======================================================= public speed5( id ) {    if (get_cvar_num("sv_nfs")==0)       client_print(0,print_chat,"[AMXX][Need For Speed] Is Off!")       return PLUGIN_HANDLED    }    else    {       if (hashadspeed[id])          client_print(0,print_chat,"[AMXX][Need For Speed] Sorry, Try Next Round!")          return PLUGIN_CONTINUE    }    else    {       set_user_speed(id, set_user_speed(id) + 300)       cs_set_user_money(id, cs_get_user_money(id) - 800)       client_print(0,print_chat,"[AMXX][Need For Speed] You Have Speed For 5 Seconds!")       hashadspeed[id] = true       hasnothadspeed[id] = false       return PLUGIN_HANDLED } //======================================================= //======================================================= public speed10(id) {    if (get_cvar_num("sv_nfs")==0)       client_print(0,print_chat,"[AMXX][Need For Speed] Is Off!")       return PLUGIN_HANDLED    }    else    {       if (hashadspeed[id])          client_print(0,print_chat,"[AMXX][Need For Speed] Sorry, Try Next Round!")          return PLUGIN_CONTINUE    }    else    {       set_user_speed(id, set_user_speed(id) + 300)       cs_set_user_money(id, cs_get_user_money(id) - 1600)       client_print(0,print_chat,"[AMXX][Need For Speed] You Have Speed For 10 Seconds!")       hashadspeed[id] = true       hasnothadspeed[id] = false       return PLUGIN_HANDLED } //======================================================= //======================================================= public speed?(id) {    if (get_cvar_num("sv_nfs")==0)       client_print(0,print_chat,"[AMXX][Need For Speed] Is Off!")    if (get_cvar_num("sv_nfs")==1)       client_print(0,print_chat,"[AMXX][Need For Speed] Is On!")    if (hashadspeed[id])       client_print(0,print_chat,"[AMXX][Need For Speed] You Have Had Speed This Round!")    if (hasnothadspeed[id])       client_print(0,print_chat,"[AMXX][Need For Speed] You Have Not Had Speed This Round!")       return PLUGIN_HANDLED } //======================================================= //======================================================= public roundchange(id) {    hadhadspeed[id] = false    hasnothadspeed[id] = true    return PLUGIN_CONTINUE } //=======================================================
__________________
My Plugins

Purchase Mod - Stable
Type Sounds - Stable
Monster Spawner - Stable
Nade Giver - Maintenance
Dizzy is offline
Send a message via AIM to Dizzy
Dizzy
Veteran Member
Join Date: Jun 2004
Location: Massachusetts
Old 02-22-2005 , 01:11  
Reply With Quote #8

Help? Sorta Kinda?
__________________
My Plugins

Purchase Mod - Stable
Type Sounds - Stable
Monster Spawner - Stable
Nade Giver - Maintenance
Dizzy is offline
Send a message via AIM to Dizzy
Freecode
Never Fall Asleep
Join Date: Jan 2004
Old 02-22-2005 , 01:49  
Reply With Quote #9

Here http://forums.alliedmods.net/showthread.php?t=6481
read these two sections
Indentation, PLEASE!
Whitespace, Whitespace, Whitespace!!!
Freecode is offline
Dizzy
Veteran Member
Join Date: Jun 2004
Location: Massachusetts
Old 02-22-2005 , 13:27  
Reply With Quote #10

Better Freecode?

Code:
//======================================================= #include <amxmodx> #include <fun> //======================================================= new bool:hashadspeed[32] new bool:hasnothadspeed[32] new times[33] = 5 //======================================================= /******************************************************************* *Need For Speed: By: Dizzy                            *===============                                      *Description - Gives You Extra Speed For Either                 *5 or 10 Seconds For A Price (1 Per Round)                  *                                               *Cvars - sv_nfs 0|1 [Off|On]                                *                                               *Clcmds - /needspeed5 - Gives 5 Seconds Of Speed For 800 Dollars   *       /needspeed10 - Gives 10 Seconds Of Speed For 1600 Dollars *         /needspeed? - Tells Client If NFS Is On Or Off           *                                                 *Comments? - Email: <a href="mailto:[email protected]">[email protected]</a>                  *          AIM: AwPOAwPDiZzY                          *******************************************************************/ //======================================================= //======================================================= public plugin_init() {     register_plugin("Need For Speed",".1","Dizzy")     register_cvar("sv_nfs","1")     register_clcmd("say /needspeed5","speed5")     register_clcmd("say /needspeed10","speed10")     register_clcmd("say /needspeed?","speed?")     register_event("ResetHUD","newround","b") } //======================================================= //======================================================= public client_connect( id ) {     hashadspeed[id] = false     hasnothadspeed[id] = true } public client_disconnect( id ) {     hashadspeed[id] = false     hasnothadspeed[id] = true } //======================================================= //======================================================= public speed5( id ) {    if (get_cvar_num("sv_nfs")==0)       client_print(0,print_chat,"[AMXX][Need For Speed] Is Off!")       return PLUGIN_HANDLED    }    else    {       if (hashadspeed[id])          client_print(0,print_chat,"[AMXX][Need For Speed] Sorry, Try Next Round!")          return PLUGIN_CONTINUE    }    else    {       set_user_maxspeed(id, set_user_maxspeed(id) + 300)       cs_set_user_money(id, cs_get_user_money(id) - 800)       client_print(0,print_chat,"[AMXX][Need For Speed] You Have Speed For 5 Seconds!")       hashadspeed[id] = true       hasnothadspeed[id] = false       return PLUGIN_HANDLED } //======================================================= //======================================================= public speed10(id) {    if (get_cvar_num("sv_nfs")==0)       client_print(0,print_chat,"[AMXX][Need For Speed] Is Off!")       return PLUGIN_HANDLED    }    else    {       if (hashadspeed[id])          client_print(0,print_chat,"[AMXX][Need For Speed] Sorry, Try Next Round!")          return PLUGIN_CONTINUE    }    else    {       set_user_maxspeed(id, set_user_maxspeed(id) + 300)       cs_set_user_money(id, cs_get_user_money(id) - 1600)       client_print(0,print_chat,"[AMXX][Need For Speed] You Have Speed For 10 Seconds!")       hashadspeed[id] = true       hasnothadspeed[id] = false       return PLUGIN_HANDLED } //======================================================= //======================================================= public speed?(id) {    if (get_cvar_num("sv_nfs")==0)       client_print(0,print_chat,"[AMXX][Need For Speed] Is Off!")    if (get_cvar_num("sv_nfs")==1)       client_print(0,print_chat,"[AMXX][Need For Speed] Is On!")    if (hashadspeed[id])       client_print(0,print_chat,"[AMXX][Need For Speed] You Have Had Speed This Round!")    if (hasnothadspeed[id])       client_print(0,print_chat,"[AMXX][Need For Speed] You Have Not Had Speed This Round!")       return PLUGIN_HANDLED } //======================================================= //======================================================= public roundchange(id) {    hadhadspeed[id] = false    hasnothadspeed[id] = true    return PLUGIN_CONTINUE } //=======================================================

Could You Help With My Question Now?
__________________
My Plugins

Purchase Mod - Stable
Type Sounds - Stable
Monster Spawner - Stable
Nade Giver - Maintenance
Dizzy is offline
Send a message via AIM to Dizzy
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 14:02.


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