AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Set time (https://forums.alliedmods.net/showthread.php?t=10733)

FoX Rider 02-27-2005 16:46

Set time
 
How would you set a certain time limit, for a plugin to last?
Example: Noclip for 10 seconds.

Peli 02-27-2005 17:04

You use the set_task() native :
Code:
Public Function(id) {    set_task(10.0,"FunctionName",id) } public FunctionName(id) {    set_user_noclip(id,1) }
Get it?

FoX Rider 02-27-2005 17:25

Uh-huh. Thanks Peli.

FoX Rider 02-27-2005 18:19

Wait, so..

Code:

Public Function(id)
{
  set_task(10.0,"FunctionName",id)
}

public FunctionName(id)
{
  set_user_noclip(id,1)
}

Im not following. Can u do a sample. :D

v3x 02-27-2005 19:01

Code:
public doNoclip(id) {    set_user_noclip(id,1) // Set noclip    set_task(10.0,"remNoclip",id) // After ten secs, run remNoclip } public remNoclip(id) { // Remove noclip    set_user_noclip(id,0) }

Peli 02-28-2005 19:40

No problem , Vex explained it better than I did , sorry forgot to explain it. If you still need help , ask.

xeroblood 03-01-2005 10:56

Should be:

Code:
public doNoclip(id) {    set_user_noclip(id,1) // Set noclip     new args[2]     args[0] = id    set_task(10.0,"remNoclip", 0, args, 1) // After ten secs, run remNoclip } public remNoclip( args[] ) {     new id = args[0] // Remove noclip    set_user_noclip(id,0) }

v3x 03-01-2005 12:16

Yea yea yea, xero.. LOL

Always gotta be the bigshot :(. I was just showin him the basics.


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

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