AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   hud (https://forums.alliedmods.net/showthread.php?t=173449)

jackas 12-05-2011 10:26

hud
 
can anyone edit this plugin ...that show permanent hud when connected?
PHP Code:

#include <amxmodx>
#include <nvault>

new g_NvID;

public 
plugin_init()
    {
    
    
g_NvID nvault_open("timepvault");
}

public 
plugin_end()
    {
    
nvault_close(g_NvID);
}

public 
client_disconnect(id)
    {
    new 
sztimep[8];
    new 
szAuthID[35];
    new 
itimep;
    new 
ts;
    
    
get_user_authid(idszAuthID34);
    
    if( !
nvault_lookupg_NvIDszAuthID sztimep ts ) )
        {
        
//Users first disconnect
        
format(sztimep7"%d" get_user_time(id1) );
        
nvault_setg_NvID szAuthID sztimep);  
    }
    else
    {
        
//All other disconnects
        
itimep str_to_num(sztimep) + get_user_time(id1);
        
format(sztimep7"%d" itimep );
        
nvault_setg_NvID szAuthID sztimep);
    }
}

public 
cmd_Distimep(id)
    {
    new 
szTime[8];
    new 
szAuthID[35];
    new 
ts;
    new 
name[32]
    
    new 
iCurTime get_user_timeid );
    new 
iTotalTime 0;
    
    
get_user_authid(idszAuthID34);
    
get_user_name(idname31);
    
    if( 
nvault_lookup(g_NvIDszAuthID szTime7ts) )
        
iTotalTime str_to_num(szTime);
    
    
set_hudmessage(2001000, -1.00.3200.01.00.00.04)  
    
show_hudmessage(id"time: %d minute(s).^nfinal time: %d minute(s)", (iCurTime 60), ((iCurTime iTotalTime) / 60));
    
    
set_task(1.0"cmd_Distimep"id)



Erox902 12-05-2011 12:33

Re: hud
 
I don't think it's possible to give someone a hudmessege when they connect, since they're actually still not in the game.
But if you search in scripting help for permanent hud, I'm sure you'll get way more info than you actually need.

tuty 12-05-2011 12:42

Re: hud
 
when connected

pacheco 12-05-2011 12:50

Re: hud
 
PHP Code:

set_hudmessage(2001000, -1.00.3200.01.00.00.04

->
PHP Code:

set_hudmessage(2001000, -1.00.3200.01.00.00.099999999

??

Erox902 12-05-2011 12:54

Re: hud
 
Quote:

Originally Posted by tuty (Post 1608215)
when connected

when connected can't be caught afaik.

kotinha 12-05-2011 13:09

Re: hud
 
use the forward client_putinserver() ?

tuty 12-05-2011 15:27

Re: hud
 
Quote:

Originally Posted by Erox902 (Post 1608223)
when connected can't be caught afaik.

jesus christ man, he want when player is on damn server, i think =))

Erox902 12-05-2011 16:59

Re: hud
 
Quote:

Originally Posted by tuty (Post 1608289)
jesus christ man, he want when player is on damn server, i think =))

jesus christ man, there ain't no event for when player is on damn server.:avast:
Quote:

Originally Posted by kotinha (Post 1608228)
use the forward client_putinserver() ?

I'm not sure but I've heard that even this can get called before player actually is on server. :shock:

I would've given them at the spawn event, round start log event or team join event( if there is one? ).

But like I said before, search for permanent hud in scripting help and in requests.
You should always search first:nono: I found 24 threads just here in requests section alone.

jackas 12-05-2011 17:29

Re: hud
 
1 Attachment(s)
Quote:

Originally Posted by tuty (Post 1608215)
when connected

Yes, when connected ...No client side commands...Show directly to everyone when connected...

eg :

jackas 12-05-2011 17:31

Re: hud
 
Quote:

Originally Posted by Erox902 (Post 1608322)
jesus christ man, there ain't no event for when player is on damn server.:avast:
I'm not sure but I've heard that even this can get called before player actually is on server. :shock:

I would've given them at the spawn event, round start log event or team join event( if there is one? ).

But like I said before, search for permanent hud in scripting help and in requests.
You should always search first:nono: I found 24 threads just here in requests section alone.

I tried alot from my side...but i failed..any help from ur side will be appreciate :)


All times are GMT -4. The time now is 20:55.

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