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

[ES] Saber cuanto tiempo lleva conectado


  
 
 
Thread Tools Display Modes
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 07-04-2010 , 18:34   Re: [ES] Saber cuanto tiempo lleva conectado
#11

Quote:
Originally Posted by Soilder View Post
Lo podes hacer porfavor alucard? que no se como hacerlo :S o alguna otra persona que sepa como hacerlo
Ejemplo:
Code:
#include <amxmodx> #define PLUGIN  "Played Time" #define AUTHOR  "Alucard" #define VERSION "0.0.1" #define TASK_ID_PLAYED 1337 public plugin_init()     register_plugin(PLUGIN, VERSION, AUTHOR); public client_connect(id)     set_task(random_float(8.0, 15.0), "ShowTimePlayed", TASK_ID_PLAYED + id); public client_disconnect(id)     remove_task(TASK_ID_PLAYED + id); public ShowTimePlayed(taskid) {     new id = taskid - TASK_ID_PLAYED;         new iHours, iMinutes, iSeconds;     iSeconds = get_user_time(id, 1);     iMinutes = iSeconds / 60;     iHours = iMinutes / 60;         client_print(id, print_chat, "Ehhh loco, jugaste %d:%d:%d, larga un poco el game pA", iHours, iMinutes, iSeconds); }
__________________
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^
capostrike93
Veteran Member
Join Date: Feb 2009
Location: adios y??
Old 07-05-2010 , 03:01   Re: [ES] Saber cuanto tiempo lleva conectado
#12

Quote:
Originally Posted by Alucard^ View Post
Ejemplo:
Code:
#include <amxmodx> #define PLUGIN  "Played Time" #define AUTHOR  "Alucard" #define VERSION "0.0.1" #define TASK_ID_PLAYED 1337 public plugin_init()     register_plugin(PLUGIN, VERSION, AUTHOR); public client_connect(id)     set_task(random_float(8.0, 15.0), "ShowTimePlayed", TASK_ID_PLAYED + id); public client_disconnect(id)     remove_task(TASK_ID_PLAYED + id); public ShowTimePlayed(taskid) {     new id = taskid - TASK_ID_PLAYED;         new iHours, iMinutes, iSeconds;     iSeconds = get_user_time(id, 1);     iMinutes = iSeconds / 60;     iHours = iMinutes / 60;         client_print(id, print_chat, "Ehhh loco, jugaste %d:%d:%d, larga un poco el game pA", iHours, iMinutes, iSeconds); }
igual todo lo que han puesto esta mal...

llevo 90 segundos (1 minuto y medio..)

el resultado seria

Ehhh loco, jugaste 0:1:90, larga un poco el game pA

debe hacerlo haci

PHP Code:
#include <amxmodx>

#define PLUGIN    "New Plugin"
#define AUTHOR    "Capostrike93"
#define VERSION    "First Release"

public plugin_init()
    
register_plugin(PLUGINVERSIONAUTHOR);

public 
client_disconnect(id)
{    
    new 
h,m,get_user_time(id1);
    if(
s>59)
    {
        
m=s/60;
        
s-=m*60;
        if(
m>59)
        {
            
h=m/60;
            
m-=h*60;
        }
    }
    
    
client_print(0print_chat"El jugador que se fue (xD?) estubo en linea %d Hora(s),%d Minuto(s),%d Segundo(s)"hms);

__________________
capostrike93 is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 07-05-2010 , 04:17   Re: [ES] Saber cuanto tiempo lleva conectado
#13

Quote:
Originally Posted by capostrike93 View Post
igual todo lo que han puesto esta mal...
No o.o

Quote:
Originally Posted by fezh View Post
PHP Code:
new iSeconds get_user_timeid);
new 
iMinutes iSeconds 60;
new 
iHours iMinutes 60
Esto esta bien, obtiene lo que tiene que obtener (minutos, segunods y horas)... solo que claro, no hay ningun chequeo si tiene menos de 60 segundos u horas... pero, emmm no seria mejor hacer un floatround y redondear para abajo?
__________________
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^
Good
BANNED
Join Date: May 2010
Location: Argentina, Mendoza
Old 07-05-2010 , 05:30   Re: [ES] Saber cuanto tiempo lleva conectado
#14

Muy Flashero el plugin eh!, me sirve muchisimo...
Good is offline
capostrike93
Veteran Member
Join Date: Feb 2009
Location: adios y??
Old 07-05-2010 , 18:36   Re: [ES] Saber cuanto tiempo lleva conectado
#15

Quote:
Originally Posted by Alucard^ View Post
No o.o



Esto esta bien, obtiene lo que tiene que obtener (minutos, segunods y horas)... solo que claro, no hay ningun chequeo si tiene menos de 60 segundos u horas... pero, emmm no seria mejor hacer un floatround y redondear para abajo?
no entendiste mmm

mira

supongamos q llevo 90 segundos en el server..

new iSeconds = get_user_time( id, 1 );
new iMinutes = iSeconds / 60;
new iHours = iMinutes / 60;

seria igual que..

new iSeconds = 90;
new iMinutes = 90 / 60;
new iHours = 1 / 60;

por lo que el resultado seria

iSeconds = 90;
iMinutes = 1;
iHours = 0;

y el mensaje dirķa q lleva 1 minuto con 90 segundos lo cual esta mal.. ya que lleva 1 minuto y 30 segundos.. revisa mi code y veras la diferencia..
__________________
capostrike93 is offline
gladius
Veteran Member
Join Date: Jul 2008
Location: Santiago, Chile
Old 07-05-2010 , 19:09   Re: [ES] Saber cuanto tiempo lleva conectado
#16

el mio es mas simple

PHP Code:
#include <amxmodx>

#define PLUGIN    "New Plugin"
#define AUTHOR    "Capostrike93"
#define VERSION    "First Release"

public plugin_init()
    
register_plugin(PLUGINVERSIONAUTHOR);

public 
client_disconnect(id)
{    
    static 
Name[32]
    static 
TiempoHorasMinutosSegundos
    
    get_user_name
(idNamecharsmax(Name))
    
    
Tiempo get_user_time(id1)
    
Horas Minutos 60
    Minutos 
Tiempo 60
    Segundos 
Tiempo - ( 60 Minutos )

    
client_print(0print_chat"El jugador %s estubo en linea %s%d Hora%s, %s%d Minuto%s y %s%d Segundo%s"Name
    (
Horas 10 "0" ""), (Horas == "" "s"), 
    (
Minutos 10 "0" ""), (Minutos == "" "s"), 
    (
Segundos 10 "0" ""), (Segundos == "" "s"))

__________________
Proyects
Kreedz Chile Mod [100%] (Fixing some details).

gladius is offline
Send a message via MSN to gladius Send a message via Skype™ to gladius
capostrike93
Veteran Member
Join Date: Feb 2009
Location: adios y??
Old 07-05-2010 , 19:10   Re: [ES] Saber cuanto tiempo lleva conectado
#17

Quote:
Originally Posted by gladius View Post
el mio es mas simple

PHP Code:
#include <amxmodx>

#define PLUGIN    "New Plugin"
#define AUTHOR    "Capostrike93"
#define VERSION    "First Release"

public plugin_init()
    
register_plugin(PLUGINVERSIONAUTHOR);

public 
client_disconnect(id)
{    
    static 
Name[32]
    static 
TiempoHorasMinutosSegundos
    
    get_user_name
(idNamecharsmax(Name))
    
    
Tiempo get_user_time(id1)
    
Horas Tiempo 60
    Minutos 
Tiempo 60
    Segundos 
Tiempo - ( 60 Minutos )

    
client_print(0print_chat"El jugador %s estubo en linea %s%d Hora%s, %s%d Minuto%s y %s%d Segundo%s"Name
    (
Horas 10 "0" ""), (Horas == "" "s"), 
    (
Minutos 10 "0" ""), (Minutos == "" "s"), 
    (
Segundos 10 "0" ""), (Segundos == "" "s"))


esto es lo peor de este tema, todo mal...

el mio es el que deben usar..
__________________
capostrike93 is offline
gladius
Veteran Member
Join Date: Jul 2008
Location: Santiago, Chile
Old 07-05-2010 , 19:12   Re: [ES] Saber cuanto tiempo lleva conectado
#18

hazme el favor de probarlo y decirme si no funciona, porque mi kzmod no estaria funcionando entonces...

ya habia corregido lo del Horas, cuando lo quoteaste
__________________
Proyects
Kreedz Chile Mod [100%] (Fixing some details).

gladius is offline
Send a message via MSN to gladius Send a message via Skype™ to gladius
capostrike93
Veteran Member
Join Date: Feb 2009
Location: adios y??
Old 07-05-2010 , 19:14   Re: [ES] Saber cuanto tiempo lleva conectado
#19

Quote:
Originally Posted by gladius View Post
hazme el favor de probarlo y decirme si no funciona, porque mi kzmod no estaria funcionando entonces...
esta mas que evidente que lo acabas de hacer.. primero que nada por los defines de autor version etc.. que fue un copy del code mio y metiste $%$&$% tuyas..

y mas evidente que es una $%·$ sin ofender. pero esta mal

simplemente mira

Horas = Tiempo / 60
Minutos = Tiempo / 60
Segundos = Tiempo - ( 60 * Minutos )

wtf!!! ??
__________________
capostrike93 is offline
gladius
Veteran Member
Join Date: Jul 2008
Location: Santiago, Chile
Old 07-05-2010 , 19:15   Re: [ES] Saber cuanto tiempo lleva conectado
#20

2da vez que te lo dire, ya lo corregi antes de que lo quotearas.(no se como decirlo xD)

EDIT: es broma que te enoja lo de los define?, si copie tu code y cambie lo del code del tiempo.
__________________
Proyects
Kreedz Chile Mod [100%] (Fixing some details).

gladius is offline
Send a message via MSN to gladius Send a message via Skype™ to gladius
 



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 13:30.


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