Raised This Month: $ Target: $400
 0% 

Reliable client_cmd


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 04-10-2011 , 18:36   Reliable client_cmd
Reply With Quote #1

Is it possible to make reliable client_cmd? If yes, how?
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
lis_16
Senior Member
Join Date: Feb 2008
Old 04-10-2011 , 18:42   Re: Reliable client_cmd
Reply With Quote #2

Try fe. in loop while(1){
client_cmd(id, "stopsound")
client_cmd(id, "mp3 play sound/misc/something.mp3")
}
lis_16 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-10-2011 , 18:48   Re: Reliable client_cmd
Reply With Quote #3

What you mean reliable ? Have you tried to start command with a semicolon ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 04-10-2011 , 19:29   Re: Reliable client_cmd
Reply With Quote #4

For example:
I want that client_cmd income to client earlier than emit_sound
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-10-2011 , 19:38   Re: Reliable client_cmd
Reply With Quote #5

You could do this:
Code:
new bool:g_play_sound[33]; public plugin_init() {     register_clcmd("_play_sound", "CmdPlaySound"); } public CmdPlaySound(id) {     if( g_play_sound[id] )     {         g_play_sound[id] = false;         // emit_sound()     }     return PLUGIN_HANDLED; } // wherever your code is: foo(id) {     g_play_sound[id] = true;     client_cmd(id, "your client command here; wait; _play_sound"); }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-11-2011 , 05:38   Re: Reliable client_cmd
Reply With Quote #6

Quote:
Originally Posted by PRoSToTeM@ View Post
For example:
I want that client_cmd income to client earlier than emit_sound
Which kind of command ?
If you don't want the ping delay and if you don't need amxx to catch the command you can just use engclient_cmd, command is straightly sent to engine.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 04-11-2011 , 06:40   Re: Reliable client_cmd
Reply With Quote #7

Quote:
Originally Posted by ConnorMcLeod View Post
Which kind of command ?
If you don't want the ping delay and if you don't need amxx to catch the command you can just use engclient_cmd, command is straightly sent to engine.
Example this command nosound 1
In one of forward I want to send this
PHP Code:
public forward_pre(idclient_cmd(0"nosound 1"
And this
PHP Code:
public forward_post(id)
{
   
client_cmd(0"nosound 0")
   
emit_sound(...)

But command nosound 1 and nosound 0 income to client is not at the time.
emit_sound income to client earlier than command nosound 0
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-11-2011 , 06:46   Re: Reliable client_cmd
Reply With Quote #8

Then, use xolent code.

I think there is a way to emit a sound that will ignore some players, search the forum, may be it was with SVC_SPAWNSTATICSOUND but i don't remember.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 04-11-2011 at 06:49.
ConnorMcLeod is offline
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 07:25.


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