Raised This Month: $51 Target: $400
 12% 

[Help] Delay/Timer and Silent Command Execution.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SilverCore
Junior Member
Join Date: Nov 2010
Old 02-14-2011 , 15:54   [Help] Delay/Timer and Silent Command Execution.
Reply With Quote #1

I made a command that executed built-in config,
I want to make the commands unseen,
How do i do it without making the FindConVar thing?

And also, i want to delay some functions in my plugin, for example:
Code:
 
PrintToChatAll("Hello!, Please Wait 2 Seconds!");
Delay(2000);
PrintToChatAll("2 Seconds Has Passed Away");
How can i do this? (Delay doesn't exist...)
SilverCore is offline
toazron1
Senior Member
Join Date: Oct 2006
Old 02-14-2011 , 15:56   Re: [Help] Delay/Timer and Silent Command Execution.
Reply With Quote #2

use a timer - CreateTimer
__________________
toazron1 is offline
Send a message via AIM to toazron1
SilverCore
Junior Member
Join Date: Nov 2010
Old 02-14-2011 , 15:58   Re: [Help] Delay/Timer and Silent Command Execution.
Reply With Quote #3

Quote:
Originally Posted by toazron1 View Post
use a timer - CreateTimer
How do i use it in the code?
Quote:
PrintToChatAll("Wait");
CreateTimer(2000);
PrintToChatAll("Done");
Or how?

And what about the silent commands, any idea?
SilverCore is offline
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 02-14-2011 , 17:38   Re: [Help] Delay/Timer and Silent Command Execution.
Reply With Quote #4

http://wiki.alliedmods.net/Category:SourceMod_Scripting

And dont post until you've read that
AtomicStryker is offline
SilverCore
Junior Member
Join Date: Nov 2010
Old 02-15-2011 , 08:17   Re: [Help] Delay/Timer and Silent Command Execution.
Reply With Quote #5

Quote:
Originally Posted by AtomicStryker View Post
http://wiki.alliedmods.net/Category:SourceMod_Scripting

And dont post until you've read that
Says nothing about silent commands.
ServerCommand("..");
SilverCore is offline
toazron1
Senior Member
Join Date: Oct 2006
Old 02-15-2011 , 08:46   Re: [Help] Delay/Timer and Silent Command Execution.
Reply With Quote #6

http://wiki.alliedmods.net/Commands_...d_Scripting%29

Note: If you are executing cvars from a config file you need to hook each one and remove one of the flags (cant think of what it is off the top of my head) on it afaik.
__________________
toazron1 is offline
Send a message via AIM to toazron1
Shouldercannon
BANNED
Join Date: Sep 2009
Location: Russia, Penza
Old 02-15-2011 , 08:57   Re: [Help] Delay/Timer and Silent Command Execution.
Reply With Quote #7

PHP Code:
public OnClientPutInServer(client

    
PrintToChat(client"Hello!, Please Wait 2 Seconds!"); 
    
CreateTimer(2.0Timer_Advertiseclient); 
}

public 
Action:Timer_Advertise(Handle:timerany:client)
{
    if (
IsClientInGame(client))
        
PrintToChat(client"2 Seconds Has Passed Away");


Last edited by Shouldercannon; 02-15-2011 at 09:01.
Shouldercannon is offline
Send a message via ICQ to Shouldercannon
toazron1
Senior Member
Join Date: Oct 2006
Old 02-15-2011 , 09:13   Re: [Help] Delay/Timer and Silent Command Execution.
Reply With Quote #8

Its better practice to pass userid into timers rather than the clientid
__________________
toazron1 is offline
Send a message via AIM to toazron1
Monkeys
Veteran Member
Join Date: Jan 2010
Old 02-15-2011 , 09:47   Re: [Help] Delay/Timer and Silent Command Execution.
Reply With Quote #9

Quote:
Originally Posted by toazron1 View Post
Its better practice to pass userid into timers rather than the clientid
If the timer is short and you do the propper checks, it hardly ever gives any issues.
__________________
Get a lid on that zombie,
he's never gonna be alri-i-ight.
Oooh get a lid on that zombie,
or he's gonna feed all night.
Monkeys is offline
toazron1
Senior Member
Join Date: Oct 2006
Old 02-15-2011 , 10:27   Re: [Help] Delay/Timer and Silent Command Execution.
Reply With Quote #10

Although that's true, someone starting out should learn the correct way rather than pick up poor coding methods early on.
__________________
toazron1 is offline
Send a message via AIM to toazron1
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 00:33.


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