Raised This Month: $ Target: $400
 0% 

[ES] Como detecto si un player tiene sonido o no?


  
 
 
Thread Tools Display Modes
Author Message
razorX2
BANNED
Join Date: Jun 2010
Old 06-20-2010 , 13:17   [ES] Como detecto si un player tiene sonido o no?
#1

Bueno, tengo una pregunta.. ahy algun code para detectar si un player tiene sonido o no ?. Y tambien para saber las coordenadas en donde esta el player, en el mapa. Ej: X=300 Z=280.

Si me pueden ayudar grax
razorX2 is offline
apuu
BANNED
Join Date: Oct 2009
Location: Argentina
Old 06-20-2010 , 13:40   Re: [ES] Como detecto si un player tiene sonido o no?
#2

PHP Code:
new Floatorigen[3]
get_user_origin(idorigen)
origen[0// x
origen[1// y
origen[2// z 

Last edited by apuu; 06-20-2010 at 14:37.
apuu is offline
fezh
Veteran Member
Join Date: Dec 2008
Location: BANNED
Old 06-20-2010 , 14:12   Re: [ES] Como detecto si un player tiene sonido o no?
#3

No era X Y Z?
__________________
"There is no knowledge, that is not power"
fezh is offline
apuu
BANNED
Join Date: Oct 2009
Location: Argentina
Old 06-20-2010 , 14:31   Re: [ES] Como detecto si un player tiene sonido o no?
#4

puede ser
apuu is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 06-20-2010 , 14:34   Re: [ES] Como detecto si un player tiene sonido o no?
#5

Code:
/*   *       This program is free software; you can redistribute it and/or modify it *       under the terms of the GNU General Public License as published by the *       Free Software Foundation; either version 2 of the License, or (at *       your option) any later version. * *       This program is distributed in the hope that it will be useful, but *       WITHOUT ANY WARRANTY; without even the implied warranty of *       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *       General Public License for more details. * *       You should have received a copy of the GNU General Public License *       along with this program; if not, write to the Free Software Foundation, *       Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <amxmodx> #define PLUGIN  "Chequear sonido" #define AUTHOR  "Alucard" #define VERSION "0.0.1" public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR); } public client_putinserver(id) {     query_client_cvar(id, "volume", "HookClientVolume");         set_task(3.0, "TaskAnnounceVolume", id); } public HookClientVolume(id, const szCvar[], const szValue[]) {     if(is_user_connected(id) )     {         new iLen = strlen(szValue);             for(new i = 0; i < iLen; i++)         {             if(szValue[i] != 0)             {                 static szName[32];                 get_user_name(id, szName, 31);                                 client_print(0, print_chat, "El player %s tiene sonido (%s)", szName, szValue);                 return;             }         }     } }

@ apuu

Creo que el orden de las coordenadas esta mal... si no me equivoco el orden correcto es: x, y, z
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...

Last edited by Alucard^; 06-20-2010 at 14:57.
Alucard^ is offline
Send a message via Skype™ to Alucard^
apuu
BANNED
Join Date: Oct 2009
Location: Argentina
Old 06-20-2010 , 14:37   Re: [ES] Como detecto si un player tiene sonido o no?
#6

ok edito gracias a los 2
apuu is offline
fezh
Veteran Member
Join Date: Dec 2008
Location: BANNED
Old 06-20-2010 , 14:56   Re: [ES] Como detecto si un player tiene sonido o no?
#7

Code:
#include <amxmodx> // No se usan defines para declarar strings. new const PLUGIN[ ] = "Chequear sonido"; new const AUTHOR[ ] = "Alucard"; new const VERSION[ ] = "0.0.1"; public plugin_init() {     register_plugin( PLUGIN, VERSION, AUTHOR ); } // Habias escrito client_pustinserver public client_putinserver(id) {     query_client_cvar( id, "volume", "Client_Cvar_Result" ); } // Cambie el nombre de esto por que no estas hookeando nada, // solamente chequeas el valor de la cvar. public Client_Cvar_Result( id, const szCvar[ ], const szValue[ ] ) {     new szName[ 32 ];     get_user_name( id, szName, 31 );     client_print( 0, print_chat, "El player %s %stiene sonido.", szName, szValue[ 0 ] == '0' ? "no " : "" ); }
__________________
"There is no knowledge, that is not power"
fezh is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 06-20-2010 , 15:04   Re: [ES] Como detecto si un player tiene sonido o no?
#8

@ fezh

1. Lo de los defines no creo que sea un problema, no se bien el motivo por el cual no usan strings en defines, pero dudo que haya un problema en hacerlo en el nombre del plugin, author y la version... nunca me corrigieron eso ni siquiera en los plugins aprobados por lo que dudo que sea algo a tomar en cuenta ><.

De todas formas me quedo la duda... por que no se debe usar strings en defines? lei una vez sobre eso pero no me acuerdo.

2. client_pustinserver(id)... jaja si, le pifie =p ahi lo corregi.

3. Sigo creyendo que Hookear esta bien, de todas formas sigue siendo lo mismo pero... Hookear viene de enganchar, obtener, tomar, etc no? desde mi punto de vista ahi estas obteniendo X informacion de X cvar... realmente no creo que este mal usado ese nombre, pero bleh, da lo mismo.

4. Yo uso 0.76666666 de sonido, al simplificar el codigo como lo hiciste me tomaria como que no tengo sonido, cuando en realidad si lo tengo. Y te aseguro que no soy el unico q lo debe usar asi... 0.7666 periodico, se dice que es el mejor sonido para que no se buguee a veces los pasos y demas...
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
fezh
Veteran Member
Join Date: Dec 2008
Location: BANNED
Old 06-20-2010 , 15:08   Re: [ES] Como detecto si un player tiene sonido o no?
#9

Quote:
Originally Posted by Alucard^ View Post
1. Lo de los defines no creo que sea un problema, no se bien el motivo por el cual no usan strings en defines, pero dudo que haya un problema en hacerlo en el nombre del plugin, author y la version... nunca me corrigieron eso ni siquiera en los plugins aprobados por lo que dudo que sea algo a tomar en cuenta ><.
Quote:
Originally Posted by Exolent[jNr] View Post
1. Don't use #define for strings. Use new const instead.
http://www.google.com.ar/search?hl=e...=&oq=&gs_rfai=

Quote:
Originally Posted by Alucard^ View Post
3. Sigo creyendo que Hookear esta bien, de todas formas sigue siendo lo mismo pero... Hookear viene de enganchar, obtener, tomar, etc no? desde mi punto de vista ahi estas obteniendo X informacion de X cvar... realmente no creo que este mal usado ese nombre, pero bleh, da lo mismo.
Hookear es atrapar.

Quote:
Originally Posted by Alucard^ View Post
4. Yo uso 0.76666666 de sonido, al simplificar el codigo como lo hiciste me tomaria como que no tengo sonido, cuando en realidad si lo tengo. Y te aseguro que no soy el unico q lo debe usar asi... 0.7666 periodico, se dice que es el mejor sonido para que no se buguee a veces los pasos y demas...
Code:
client_print( 0, print_chat, "El player %s %stiene sonido.", szName, str_to_float( szValue ) > 0.0 ? "" : "no " );
__________________
"There is no knowledge, that is not power"

Last edited by fezh; 06-20-2010 at 15:17.
fezh is offline
apuu
BANNED
Join Date: Oct 2009
Location: Argentina
Old 06-20-2010 , 15:19   Re: [ES] Como detecto si un player tiene sonido o no?
#10

claro pero tendira que poner el volume 0, osea no es la mejor forma. asi lo entiendo yo
apuu is offline
 



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 01:03.


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