AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Reliable client_cmd (https://forums.alliedmods.net/showthread.php?t=154605)

PRoSToTeM@ 04-10-2011 18:36

Reliable client_cmd
 
Is it possible to make reliable client_cmd? If yes, how?

lis_16 04-10-2011 18:42

Re: Reliable client_cmd
 
Try fe. in loop while(1){
client_cmd(id, "stopsound")
client_cmd(id, "mp3 play sound/misc/something.mp3")
}

ConnorMcLeod 04-10-2011 18:48

Re: Reliable client_cmd
 
What you mean reliable ? Have you tried to start command with a semicolon ?

PRoSToTeM@ 04-10-2011 19:29

Re: Reliable client_cmd
 
For example:
I want that client_cmd income to client earlier than emit_sound

Exolent[jNr] 04-10-2011 19:38

Re: Reliable client_cmd
 
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"); }

ConnorMcLeod 04-11-2011 05:38

Re: Reliable client_cmd
 
Quote:

Originally Posted by PRoSToTeM@ (Post 1447451)
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.

PRoSToTeM@ 04-11-2011 06:40

Re: Reliable client_cmd
 
Quote:

Originally Posted by ConnorMcLeod (Post 1447604)
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

ConnorMcLeod 04-11-2011 06:46

Re: Reliable client_cmd
 
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.


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

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