Mensajes: 169
Temas: 22
Registro en: Feb 2020
Reputación:
8
07/02/2020, 10:54 PM
(Última modificación: 07/02/2020, 10:58 PM por El Abuelo. Edited 4 times in total.)
Hola que tal, me veo obligado a consultar con vosotros que seguramente sepan del tema. La cuestion es que en un sv tengo el plugin +grab (podes mover jugadores) la cuestion es que solo quiero que tengan acceso ciertos admin, no todos, a lo que fui a la carpeta cmdaccess y trate de realizarlo de ahi pero no sucedio. LO QUE DEBO BLOQUEAR SERIA EL (bind "TECLA" +grab)
como se puede ver en azul el primero esta bien bloquea que no puedan escribir ese comando en consola pero sigue funcionando el +grab. y el segundo claramente no funciona pero seria lo que quiero bloquear.
aclaro que los admins con flag "a" si pueden usarlo, los que no les saque la "a" en la carpeta users.
les dejo url para que vean lo que realice.
HAGAN CLICK AQUI ABAJO
[/url]
Desde ya muchas gracias, atte El Abuelo
Mensajes: 791
Temas: 84
Registro en: Sep 2016
Reputación:
6
Modificale la flag con la cual le das el +grab y solo dale la flag a los que vos quieras.
Mensajes: 169
Temas: 22
Registro en: Feb 2020
Reputación:
8
(12/02/2020, 01:11 AM)Ballers escribió: Modificale la flag con la cual le das el +grab y solo dale la flag a los que vos quieras.
Creo que es lo que hice pero no funciono, fijate la imagen que subi abajo de todo esta en azul. como deberia ponerlo para que realmente bloquee el bind "tecla" +grab? :/
Mensajes: 1,148
Temas: 82
Registro en: May 2015
Reputación:
8
12/02/2020, 04:56 PM
(Última modificación: 12/02/2020, 04:58 PM por Nelo. Edited 1 time in total.)
Código PHP: public grab_toggle( id, level, cid ) { if(~get_user_flags(id) & ADMIN_RESERVATION) return PLUGIN_HANDLED
if( !client_data[id][GRABBED] ) grab( id, level, cid ) else unset_grabbed( id ) return PLUGIN_HANDLED }
Código PHP: public grab( id, level, cid ) { if(~get_user_flags(id) & ADMIN_RESERVATION) return PLUGIN_HANDLED
if( !cmd_access( id, level, cid, 1 ) || !get_pcvar_num( p_enabled ) ) return PLUGIN_HANDLED if ( !client_data[id][GRABBED] ) client_data[id][GRABBED] = -1 screenfade_in( id ) return PLUGIN_HANDLED }
Código PHP: public force_grab(id, level, cid) { if(~get_user_flags(id) & ADMIN_RESERVATION) return PLUGIN_HANDLED
if( !cmd_access( id, level, cid, 1 ) || !get_pcvar_num( p_enabled ) ) return PLUGIN_HANDLED
new arg[33] read_argv( 1, arg, 32 )
new targetid = cmd_target( id, arg, 1 ) if( is_grabbed( targetid, id ) ) return PLUGIN_HANDLED if( !is_user_alive( targetid ) ) { client_print( id, print_console, "[AMXX] %L", id, "COULDNT" ) return PLUGIN_HANDLED } //Safe to tp target to aim spot? new Float:tmpvec[3], Float:orig[3], Float:torig[3], Float:trace_ret[3] new bool:safe = false, i get_view_pos( id, orig ) tmpvec = vel_by_aim( id, get_pcvar_num( p_min_dist ) ) for( new j = 1; j < 11 && !safe; j++ ) { torig[0] = orig[0] + tmpvec[i] * j torig[1] = orig[1] + tmpvec[i] * j torig[2] = orig[2] + tmpvec[i] * j traceline( tmpvec, torig, id, trace_ret ) if( get_distance_f( trace_ret, torig ) ) break engfunc( EngFunc_TraceHull, torig, torig, 0, HULL_HUMAN, 0, 0 ) if ( !get_tr2( 0, TR_StartSolid ) && !get_tr2( 0, TR_AllSolid ) && get_tr2( 0, TR_InOpen ) ) safe = true } //Still not safe? Then find another safe spot somewhere around the grabber pev( id, pev_origin, orig ) new try[3] orig[2] += 2 while( try[2] < 3 && !safe ) { for( i = 0; i < 3; i++ ) switch( try[i] ) { case 0 : torig[i] = orig[i] + ( i == 2 ? 80 : 40 ) case 1 : torig[i] = orig[i] case 2 : torig[i] = orig[i] - ( i == 2 ? 80 : 40 ) } traceline( tmpvec, torig, id, trace_ret ) engfunc( EngFunc_TraceHull, torig, torig, 0, HULL_HUMAN, 0, 0 ) if ( !get_tr2( 0, TR_StartSolid ) && !get_tr2( 0, TR_AllSolid ) && get_tr2( 0, TR_InOpen ) && !get_distance_f( trace_ret, torig ) ) safe = true try[0]++ if( try[0] == 3 ) { try[0] = 0 try[1]++ if( try[1] == 3 ) { try[1] = 0 try[2]++ } } } if( safe ) { set_pev( targetid, pev_origin, torig ) set_grabbed( id, targetid ) screenfade_in( id ) } else client_print( id, print_chat, "[AMXX] %L", id, "COULDNT" )
return PLUGIN_HANDLED }
Mensajes: 169
Temas: 22
Registro en: Feb 2020
Reputación:
8
(12/02/2020, 04:56 PM)Nelo escribió: Código PHP: public grab_toggle( id, level, cid ) { if(~get_user_flags(id) & ADMIN_RESERVATION) return PLUGIN_HANDLED
if( !client_data[id][GRABBED] ) grab( id, level, cid ) else unset_grabbed( id ) return PLUGIN_HANDLED }
Código PHP: public grab( id, level, cid ) { if(~get_user_flags(id) & ADMIN_RESERVATION) return PLUGIN_HANDLED
if( !cmd_access( id, level, cid, 1 ) || !get_pcvar_num( p_enabled ) ) return PLUGIN_HANDLED if ( !client_data[id][GRABBED] ) client_data[id][GRABBED] = -1 screenfade_in( id ) return PLUGIN_HANDLED }
Código PHP: public force_grab(id, level, cid) { if(~get_user_flags(id) & ADMIN_RESERVATION) return PLUGIN_HANDLED
if( !cmd_access( id, level, cid, 1 ) || !get_pcvar_num( p_enabled ) ) return PLUGIN_HANDLED
new arg[33] read_argv( 1, arg, 32 )
new targetid = cmd_target( id, arg, 1 ) if( is_grabbed( targetid, id ) ) return PLUGIN_HANDLED if( !is_user_alive( targetid ) ) { client_print( id, print_console, "[AMXX] %L", id, "COULDNT" ) return PLUGIN_HANDLED } //Safe to tp target to aim spot? new Float:tmpvec[3], Float:orig[3], Float:torig[3], Float:trace_ret[3] new bool:safe = false, i get_view_pos( id, orig ) tmpvec = vel_by_aim( id, get_pcvar_num( p_min_dist ) ) for( new j = 1; j < 11 && !safe; j++ ) { torig[0] = orig[0] + tmpvec[i] * j torig[1] = orig[1] + tmpvec[i] * j torig[2] = orig[2] + tmpvec[i] * j traceline( tmpvec, torig, id, trace_ret ) if( get_distance_f( trace_ret, torig ) ) break engfunc( EngFunc_TraceHull, torig, torig, 0, HULL_HUMAN, 0, 0 ) if ( !get_tr2( 0, TR_StartSolid ) && !get_tr2( 0, TR_AllSolid ) && get_tr2( 0, TR_InOpen ) ) safe = true } //Still not safe? Then find another safe spot somewhere around the grabber pev( id, pev_origin, orig ) new try[3] orig[2] += 2 while( try[2] < 3 && !safe ) { for( i = 0; i < 3; i++ ) switch( try[i] ) { case 0 : torig[i] = orig[i] + ( i == 2 ? 80 : 40 ) case 1 : torig[i] = orig[i] case 2 : torig[i] = orig[i] - ( i == 2 ? 80 : 40 ) } traceline( tmpvec, torig, id, trace_ret ) engfunc( EngFunc_TraceHull, torig, torig, 0, HULL_HUMAN, 0, 0 ) if ( !get_tr2( 0, TR_StartSolid ) && !get_tr2( 0, TR_AllSolid ) && get_tr2( 0, TR_InOpen ) && !get_distance_f( trace_ret, torig ) ) safe = true try[0]++ if( try[0] == 3 ) { try[0] = 0 try[1]++ if( try[1] == 3 ) { try[1] = 0 try[2]++ } } } if( safe ) { set_pev( targetid, pev_origin, torig ) set_grabbed( id, targetid ) screenfade_in( id ) } else client_print( id, print_chat, "[AMXX] %L", id, "COULDNT" )
return PLUGIN_HANDLED }
Desde ya agradezco tu respuesta, ahora debo colocar todo esto en el sma del grab, o hacer un sma y compilarlo como un plugin nuevo? Disculpen si parece tonta mi pregunta, es que estoy aprendiendo
Mensajes: 1,148
Temas: 82
Registro en: May 2015
Reputación:
8
reemplaza las funciones en el sma del grab y compila, te estoy dejando las funciones completas solo tenes que reemplazarlas
Mensajes: 169
Temas: 22
Registro en: Feb 2020
Reputación:
8
(14/02/2020, 03:30 PM)Nelo escribió: reemplaza las funciones en el sma del grab y compila, te estoy dejando las funciones completas solo tenes que reemplazarlas
Muchas gracias, funciono!
|