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

[ES] if por nombre


  
 
 
Thread Tools Display Modes
Author Message
Ciio
Veteran Member
Join Date: Oct 2009
Location: Arica, Chile
Old 11-14-2010 , 14:04   [ES] if por nombre
#1

hola, hace tiempo que no me metia a pawn xd
y necesito 2 cosas..

1.- Casi siempre los if son asi..

PHP Code:
public if(id)
{
    if (!(
get_user_flags(id) & ADMIN_KICK))
    {
        return 
PLUGIN_HANDLED
    
}
    
    
si(id)
    return 
PLUGIN_HANDLED

Queria ver como hacerlo por nombre, osea reemplazando el flag admin kick.
osea si se llama por ejemplo "player1" tenga acceso a "si(id)".

2.- Si el jugador llamado "player1" esta inactivo por 3 minutos lo kickee automaticamente, solo quiero que el eso aga efecto en el "player1"

Espero me ayan entendido y puedan ayudarme , gracias.. ah, cualquier consulta avisenme porfa.
__________________
Ciio is offline
Send a message via MSN to Ciio
Manu127
Veteran Member
Join Date: Jul 2010
Location: Argentina
Old 11-14-2010 , 14:09   Re: [ES] if por nombre
#2

PHP Code:
public if(id)
{
    new 
Nombre[32]
    
get_user_name(idNombre31)
    
    if( 
equal(Nombre,"Manu")
    {
        
// code..
    
}

Puede ser asi?
Manu127 is offline
Send a message via MSN to Manu127 Send a message via Skype™ to Manu127
Javivi
AlliedModders Donor
Join Date: Dec 2008
Old 11-14-2010 , 14:28   Re: [ES] if por nombre
#3

Toma, te pego esto de un plugin privado mio.

PHP Code:
#include < amxmodx >
#include < fakemeta >

public plugin_init( )
    
register_plugin"ASDF""FDSA""Javivi" )
    
public 
client_putinserverid )
{
    static 
Name33 ]; get_user_nameidNamecharsmaxName ) )
    
    if( 
equalName"player1" ) )
        
set_task5.0"CheckAFK"id 1234 __"b" )
}

public 
client_disconnectid )
    
remove_taskid 1234 )

public 
CheckAFKid )
{
    
id -= 1234
    
    
if( is_user_aliveid ) )
    {
        static 
Float:AFK_TIMERAFK_TIMER get_gametime() - 180.0 // El tiempo en segundos
        
static Float:LastMovementLastMovement get_pdata_floatid124 // 124 = OFFSET_LAST_MOVEMENT
        
        
if( AFK_TIMER >= LastMovement )
            
client_cmdid"echo No puedes estar AFK mas de 3 minutos; disconnect" )
    }

__________________

Last edited by Javivi; 11-14-2010 at 15:10.
Javivi is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 11-14-2010 , 14:44   Re: [ES] if por nombre
#4

El AFK te corre bien?

Porque habia visto algo de un bug y blabla. Me enrrede viendo este thread: http://forums.alliedmods.net/showthread.php?t=134744
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
Javivi
AlliedModders Donor
Join Date: Dec 2008
Old 11-14-2010 , 14:51   Re: [ES] if por nombre
#5

Si, llevo usandolo desde septiembre y me funciona bien.
__________________

Last edited by Javivi; 11-14-2010 at 15:17.
Javivi is offline
Ciio
Veteran Member
Join Date: Oct 2009
Location: Arica, Chile
Old 11-14-2010 , 14:53   Re: [ES] if por nombre
#6

muchas gracias javivi

gracias manu
__________________

Last edited by Ciio; 11-14-2010 at 15:18.
Ciio is offline
Send a message via MSN to Ciio
shinoda
Spanish Moderator
Join Date: Nov 2009
Location: ag_crossfire
Old 11-14-2010 , 14:57   Re: [ES] if por nombre
#7

Javivi, te falto remover el task
__________________
Oh hell no this shit is awesome !!!
shinoda is offline
Send a message via MSN to shinoda Send a message via Skype™ to shinoda
Javivi
AlliedModders Donor
Join Date: Dec 2008
Old 11-14-2010 , 15:10   Re: [ES] if por nombre
#8

Ya actualize y le aņadi taskid. Se me olvido copiar esa parte :p...
__________________
Javivi is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 11-14-2010 , 18:46   Re: [ES] if por nombre
#9

Quote:
Originally Posted by Javivi View Post
Si, llevo usandolo desde septiembre y me funciona bien.
Alfin un AFK decente :B

Lo usare.. Gracias
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
DJHD!
Veteran Member
Join Date: Dec 2009
Location: Santiago, Chile
Old 11-14-2010 , 19:11   Re: [ES] if por nombre
#10

Quote:
Originally Posted by meTaLiCroSS View Post
Alfin un AFK decente :B

Lo usare.. Gracias
Que buena ahora no haran trampa con la exp en tu server ajsjas ()
__________________
Quote:
Originally Posted by XINLEI View Post
Porque rocccos trata de ser el metalicross que nunca va a poder ser.
DJHD! is offline
Send a message via MSN to DJHD!
 



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 12:35.


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