Raised This Month: $ Target: $400
 0% 

Pinfo change rounds with steamid


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
HLM
Senior Member
Join Date: Apr 2008
Location: C:\WINDOWS\System32
Old 06-17-2009 , 17:51   Pinfo change rounds with steamid
Reply With Quote #1

I am trying to make Pinfo more of an admin query tool so my admins can get a little more info from a user (without having to go into console, then go to hlsw, etcetera)

I basically want to change the rounds section with the players steamID I dont know where or how to begin on doing this..

can I get some help??

(original)
PHP Code:
/*
 *  Comments: 
 *        Displays player information. For Example...
 *        First Nick is the very first nick they had when their profile was created.
 *        Time Played is total time person has played on your server. Not just their current session.
 *        [ FIRST NICK: OneEyed ][ CONNECTS: 152 ][ ROUNDS: 25 ][ TIME PLAYED: 2 Days 3 Hrs 52 Mins ]
 *
 *    Note:
 *        Plugin is self-sufficient, just compile and add to plugins.ini / plugin folder and your set.
 *        All player data will be saved into pinfo.vault @ amxmodx/data/vault folder.
 *
 *    Chat Command:
 *        !info name        - Typed in chat.  If no name specified, returns your own info.
 *        
 *  Version :     2.0
 *    Requires:    AMXX 1.70+ and NVAULT module
 *    Gametype:     CS/NS/DOD
 *
 *    Author:        OneEyed
 *    Date:        01-23-2006
 *    Email:        [email protected]
 *    IRC:        #modns (gamesurge.net) 
 *
 *     Tested :
 *        WIN32 Tested and Approved! LINUX untested.
 * 
 *  Credits: 
 *       voogru - He used it on his server (I sorta replicated it)
 * 
 *    Change Log:
 *        v2.0 - Updated plugin to use nVault instead of *.ini file.
 *        v1.1 - Fixed to update played time at round end/map change, no more looped task.
 * 
 */

//---------------------------------------------------------------------------------------------
//-------------------DO NOT EDIT BELOW---------------------------------------------------------
#include <amxmodx>
#include <amxmisc>
#include <nvault>

new Float:g_onlinetime[33]
new 
maxplayers

new Vault
static const VAULTNAME[] = "pinfo"

static const TITLE[] = "PInfo"
static const VERSION[] = "2.0"
static const AUTHOR[] = "OneEyed"
//---------------------------------------------------------------------------------------------------
public plugin_init() 
{
    
register_plugin(TITLEVERSIONAUTHOR)
    
register_cvar(TITLE,VERSION,FCVAR_SERVER)    //plugin displays as cvar for HLSW or whatever
    
    
maxplayers get_maxplayers()
    
register_clcmd("say","handle_say")
    
    new 
modname[32]
    
get_modname(modname,31)
    
    if(
equali("cstrike",modname))
        
register_event("SendAudio","EndofRound","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw"
    else if(
equali("ns",modname))
        
register_event("GameStatus""EndofRound""ab""1=2")
    else if(
equali("dod",modname))
        
register_event("RoundState","EndofRound","a","1=3","1=4")
}
//---------------------------------------------------------------------------------------------------
public plugin_end() {    //update user on map change but not 2 times
    
new Float:gametime get_gametime()
    for(new 
id=1;id<=maxplayers;id++)
        if( 
is_user_connected(id) )
            
updateUser(id00floatround(gametime g_onlinetime[id]))
}
//---------------------------------------------------------------------------------------------------
public EndofRound() {
    new 
Float:gametime get_gametime()
    for(new 
id=1;id<=maxplayers;id++)
        if( 
is_user_connected(id) && !is_user_bot(id)) {
            
updateUser(id10floatround(gametime g_onlinetime[id]))
            
g_onlinetime[id] = gametime
        
}
}
//---------------------------------------------------------------------------------------------------
public client_putinserver(id) {
    if(
is_user_connected(id) && !is_user_bot(id)) {
        
updateUser(id010)
        
g_onlinetime[id] = get_gametime() - 3.0
    
}
}
//---------------------------------------------------------------------------------------------------
public client_disconnect(id) {
    if(!
is_user_bot(id))
        
updateUser(id00floatround(get_gametime()-g_onlinetime[id]))
    
g_onlinetime[id] = 0.0
}
//---------------------------------------------------------------------------------------------------
public handle_say(id) {
    new 
said[192]
    
read_args(said,191)
    
remove_quotes(said)
    if( (
containi(said"!info") != -1) ) {
        new 
info[7]
        new 
name[34]
        new 
data[2]
        
data[0] = id
        
        parse
(saidinfo6name33)
        if(
equali(info"!info"))
            if(
equal(name[0],"")) {
                
data[1] = id
                set_task
(0.1"printUserInfo"iddata2)
            }
            else
            {
                
data[1] = cmd_target(id,name,2// Don't block access...
                
if(data[1]) 
                    
set_task(0.1"printUserInfo"iddata2)
                else 
                    
client_print(id,print_chat,"[PInfo] - There is no player with that name.")    
            }
    }
    return 
PLUGIN_CONTINUE
}
//---------------------------------------------------------------------------------------------------
updateUser(idroundsconnectstime) {
    
    
Vault nvault_openVAULTNAME )
    if(
Vault == INVALID_HANDLE)
       
server_print("Error opening nVault file: %s",VAULTNAME)
    else 
    {
        new 
steamid[32], playerinfo[4][32// "FIRSTNICK"  "ROUNDS" "CONNECTIONS" "TOTALTIME"
        
new key[32], val[511], TimeStamp

        get_user_authid
(id,steamid,31)
        
format(key,32,"%s",steamid)

        if( 
nvault_lookup(Vaultkeyval510TimeStamp) ) 
        {
            
parse(valplayerinfo[0], 31playerinfo[1], 31playerinfo[2], 31playerinfo[3], 31)
            new 
update[511]
            
rounds += str_to_numplayerinfo[1] )
            
connects += str_to_numplayerinfo[2] )
            
time += str_to_numplayerinfo[3] )
            
format(update,510,"^"%s^" %i %i %i",playerinfo[0], roundsconnectstime)
            
nvault_set(Vaultkeyupdate)
        }
        else 
        {
            new 
update[511], name[32]
            
get_user_name(idname31)
            
format(update,510,"^"%s^" %i %i %i",name,0,1,0)
            
nvault_set(Vaultkeyupdate)
        }
        
nvault_close(Vault)
    }
}
//---------------------------------------------------------------------------------------------------
public printUserInfo(userids[]) 

    new 
id userids[0]
    new 
playerid userids[1]
    
    
Vault nvault_openVAULTNAME )
    if(
Vault == INVALID_HANDLE)
       
server_print("Error opening nVault file: %s",VAULTNAME)
    else 
    {
        new 
steamid[32], playerinfo[4][64// "FIRSTNICK" "ROUNDS" "CONNECTIONS" "TOTALTIME"
        
new key[32], val[511], TimeStamptext[512]
        
        
get_user_authid(playerid,steamid,31)
        
format(key,32,"%s",steamid)
        
        if( 
nvault_lookup(Vaultkeyval510TimeStamp) ) 
        {
            
parse(valplayerinfo[0], 63playerinfo[1], 63playerinfo[2], 63playerinfo[3], 63)

            new 
Float:gametime get_gametime()
            new 
onlinetime floatroundgametime g_onlinetime[playerid] )
            new 
ptime str_to_num(playerinfo[3]) + onlinetime
            
new days ptime 86400
            
new hours = (ptime 3600) % 24
            
new minutes = (ptime 60) % 60
            
new seconds ptime 60
            
new totaltime[64]
            new 
sday[16], shr[16], smin[16], ssec[16]
            
            
format(sday,15,"%i Day%s ",days, (days==1?"s":""))
            
format(shr,15,"%i Hr%s ",hours, (hours==1?"s":""))
            
format(smin,15,"%i Min%s ",minutes, (minutes==1?"s":""))
            
format(ssec,15,"%i Sec%s ",seconds, (seconds==1?"s":""))
            
format(totaltime63"%s%s%s%s", (days >= sday:""), (hours >= shr:""), smin, (hours==ssec:""))
            
format(text,511,"[ FIRST NICK: %s ][ CONNECTS: %s ][ ROUNDS: %s ][ TIME PLAYED: %s ]",playerinfo[0],playerinfo[2],playerinfo[1],totaltime)
            
client_print(id,print_chat,"%s",text)
            
            
nvault_close(Vault)
            
            
updateUser(playerid00onlinetime)
            
g_onlinetime[playerid] = gametime
        
}
    }
    return 
PLUGIN_HANDLED

I am configuring this for team fortress classic, which doesnt use rounds at all, so that can be completely removed, the only problem is I dont even know how to simply make a plugin that will make the server say hello

can someone help me please?
__________________
+|- KARMA Respectively

HLM 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 15:43.


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