Raised This Month: $ Target: $400
 0% 

have something need to help,about judge death


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
etet
Junior Member
Join Date: Aug 2008
Old 10-20-2010 , 05:41   have something need to help,about judge death
Reply With Quote #1

if i want this plugin change to at player dead show server information,not original set,wt code i need changed ?

sorry for my bad english

thx a loot

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

new hud_rgbhud_xhud_yhud_effects,maxplayers,hudsynccurr_uptime[22], g_round 1;

public 
plugin_init() {
    
register_plugin("Server Side Info","1.6","xakintosh")
    
    
hud_rgb register_cvar"srv_hud_rgb""0 255 0" )
    
hud_x register_cvar"srv_hud_x""0.11" )
    
hud_y register_cvar"srv_hud_y""0.00" )
    
hud_effects register_cvar"srv_hud_effects""0" )
    
hudsync CreateHudSyncObj()
    
maxplayers get_maxplayers()
    
    
register_dictionary("srv_info.txt");
    
    
set_task(0.1"Fwd_StartFrame"1""0"b")
    
set_task(0.1"check_uptime"___"b")
    
    
register_forward(FM_StartFrame"Fwd_StartFrame")
    
register_event("HLTV""event_newround""a""1=0""2=0");
}
public 
event_newround() {
    
g_round++
}

public 
Fwd_StartFrame(id) {
    new 
timestring[31]
    
get_time("%H:%M:%S",timestring,8)
    
    static 
Float:GameTimeFloat:FramesPer 0.0
    
static Float:Fps
    
    GameTime 
get_gametime()
    
    if(
FramesPer >= GameTime)
        
Fps += 1.0;
    else {
        
FramesPer FramesPer 1.0
        
for( new id 1id <= maxplayersid++ ) { 
            
            new 
ip[42],redgreenblue
            
new const admins GetTotalAdmins()
            new 
timeleft get_timeleft()
            
            
get_hud_color(redgreenblue)
            
get_user_ip(0ip311)
            
            
set_hudmessage(red,green,blue,get_pcvar_float(hud_x),get_pcvar_float(hud_y),get_pcvar_num(hud_effects),6.0,1.0)
            
ShowSyncHudMsg(id,hudsync,"|* --------------------* %L *-------------------- *|^n|* %L",id,"INFO",id,"REST",timeleft 60timeleft 60,timestring,Fps,ip,curr_uptime,get_user_frags(id),get_user_deaths(id),admins,g_round)
        }
        
Fps 0.0
    
}
}
get_hud_color(&r, &g, &b) {
    new 
color[20]
    
    static 
red[5], green[5], blue[5]
    
    
get_pcvar_string(hud_rgbcolorcharsmax(color))
    
    
parse(colorredcharsmax(red), greencharsmax(green), bluecharsmax(blue))
    
str_to_num(red)
    
str_to_num(green)
    
str_to_num(blue)
}
static 
GetTotalAdmins() {
    new 
iPlayers[32],iNum,Admins
    get_players
(iPlayers,iNum)
    
    for(new 
Count;Count iNum;Count++)
        if(
is_user_admin(iPlayers[Count]))
        
Admins++
        
    return 
Admins
}
public 
check_uptime() {
    new 
Float:ft Float:engfunc(EngFunc_Time)
    new 
it floatround(ft)
    new 
= (it 60) % 60
    
new = (it 3600) % 24
    
new it 86400
    
    format
(curr_uptime21"%id:%ih:%im"dhm)


Last edited by etet; 10-20-2010 at 07:11.
etet is offline
Old 10-20-2010, 08:23
etet
This message has been deleted by Exolent[jNr]. Reason: Don't bump until 2 weeks have passed since last post.
naven
Veteran Member
Join Date: Jun 2008
Location: Poland, Cieszyn
Old 10-20-2010 , 15:42   Re: have something need to help,about judge death
Reply With Quote #2

PHP Code:
public Fwd_StartFrame(id) { 
Replace with
Code:
public Fwd_StartFrame(id) { if(!(is_user_alive(id)){
Don't forget about adding closing brace at the end of function.
__________________
naven.com.pl
"At the end of the day, there are always going to be mental disorders and people who cause violence for no other reason than the fact that they're fucked up and lost. And all we can do is try to learn from it." Corey Taylor.
naven is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-20-2010 , 15:44   Re: have something need to help,about judge death
Reply With Quote #3

Quote:
Originally Posted by N A V E N View Post
PHP Code:
public Fwd_StartFrame(id) { 
Replace with
Code:
public Fwd_StartFrame(id) { if(!(is_user_alive(id)){
Don't forget about adding closing brace at the end of function.
That's wrong.
FM_StartFrame doesn't even pass a player id, so the original id is always 0.
He should check inside the loop.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
naven
Veteran Member
Join Date: Jun 2008
Location: Poland, Cieszyn
Old 10-20-2010 , 16:10   Re: have something need to help,about judge death
Reply With Quote #4

Quote:
FM_StartFrame doesn't even pass a player id, so the original id is always 0.
So the whole
Quote:
Fwd_StartFrame(id)
id is incorrect?
edit: I didn't notice that it is never used.
__________________
naven.com.pl
"At the end of the day, there are always going to be mental disorders and people who cause violence for no other reason than the fact that they're fucked up and lost. And all we can do is try to learn from it." Corey Taylor.
naven is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 10-20-2010 , 16:19   Re: have something need to help,about judge death
Reply With Quote #5

Quote:
Originally Posted by N A V E N View Post
So the whole

id is incorrect?
edit: I didn't notice that it is never used.
It will work fine in compilation and run-time, but the id is not a valid parameter for FM_StartFrame so it will always never have a value (0 for null).

http://www.amxmodx.org/funcwiki.php?go=module&id=16
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Reply



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 10:23.


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