Raised This Month: $ Target: $400
 0% 

Player status


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Caldeum
Senior Member
Join Date: Jul 2010
Location: United Kingdom
Old 08-17-2012 , 16:15   Player status
Reply With Quote #1

Anyone can help? Why doesn't work this?

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

public PlayerName;
new 
g_status_sync;
new 
g_friend33 ];

public 
plugin_init()
{
    
register_plugin("CS Misc. Stats""0.1""AMXX Dev Team")
    
register_event("StatusValue""setTeam""be""1=1")
    
register_event("StatusValue""showStatus""be""1=2""2!0")
    
register_event("StatusValue""hideStatus""be""1=1""2=0")
    
    
g_status_sync CreateHudSyncObj();
}

public 
setTeam(id)
    
g_friend[id] = read_data(2)

public 
showStatus(id)
{
    if(!
is_user_bot(id) && is_user_connected(id) && PlayerName
    {
        new 
name[32], pid read_data(2)
    
        
get_user_name(pidname31)
        new 
color1 0color2 0
    
        
if (get_user_team(pid) == 1)
            
color1 255
        
else
            
color2 255
        
        
if (g_friend[id] == 1)    // friend
        
{
            new 
clipammowpnid get_user_weapon(pidclipammo)
            new 
wpnname[32]
        
            if (
wpnid)
                
xmod_get_wpnname(wpnidwpnname31)
        
            
set_hudmessage(color150color2, -1.00.6010.013.00.010.01, -1)
            
ShowSyncHudMsg(idg_status_sync"%s -- %d HP / %d AP / %s"nameget_user_health(pid), get_user_armor(pid), wpnname)
        } else {
            
set_hudmessage(color150color2, -1.00.6010.013.00.010.01, -1)
            
ShowSyncHudMsg(idg_status_sync"%s"name)
        }
    }
}

public 
hideStatus(id)
{
    if (
PlayerName)
        
ClearSyncHud(idg_status_sync)

__________________
Of all the things I lost, I miss my brain the most.
Caldeum is offline
Torge
Veteran Member
Join Date: Oct 2011
Old 08-17-2012 , 16:18   Re: Player status
Reply With Quote #2

I can compile it fine.

Could you tell us your problems?
Torge is offline
Caldeum
Senior Member
Join Date: Jul 2010
Location: United Kingdom
Old 08-17-2012 , 16:37   Re: Player status
Reply With Quote #3

Doesn't show status in game.
__________________
Of all the things I lost, I miss my brain the most.

Last edited by Caldeum; 08-17-2012 at 16:37.
Caldeum is offline
DoviuX
Senior Member
Join Date: Jun 2009
Location: Lithuania
Old 08-18-2012 , 06:19   Re: Player status
Reply With Quote #4

What does this function do ?
PHP Code:
public PlayerName
Try this:
PHP Code:
#include <amxmodx>
#include <csx>

new g_status_sync;
new 
g_friend33 ];

public 
plugin_init()
{
    
register_plugin("CS Misc. Stats""0.1""AMXX Dev Team")
    
register_event("StatusValue""setTeam""be""1=1")
    
register_event("StatusValue""showStatus""be""1=2""2!0")
    
register_event("StatusValue""hideStatus""be""1=1""2=0")
    
    
g_status_sync CreateHudSyncObj();
}

public 
setTeam(id)
    
g_friend[id] = read_data(2)

public 
showStatus(id)
{
    if(!
is_user_bot(id) && is_user_connected(id)) 
    {
        new 
name[32], pid read_data(2)
    
        
get_user_name(pidname31)
        new 
color1 0color2 0
    
        
if (get_user_team(pid) == 1)
            
color1 255
        
else
            
color2 255
        
        
if (g_friend[id] == 1)    // friend
        
{
            new 
clipammowpnid get_user_weapon(pidclipammo)
            new 
wpnname[32]
        
            if (
wpnid)
                
xmod_get_wpnname(wpnidwpnname31)
        
            
set_hudmessage(color150color2, -1.00.6010.013.00.010.01, -1)
            
ShowSyncHudMsg(idg_status_sync"%s -- %d HP / %d AP / %s"nameget_user_health(pid), get_user_armor(pid), wpnname)
        } else {
            
set_hudmessage(color150color2, -1.00.6010.013.00.010.01, -1)
            
ShowSyncHudMsg(idg_status_sync"%s"name)
        }
    }
}

public 
hideStatus(id)
    
ClearSyncHud(idg_status_sync); 

Last edited by DoviuX; 08-18-2012 at 06:22.
DoviuX is offline
Send a message via Skype™ to DoviuX
OnePL
BANNED
Join Date: May 2012
Location: GB
Old 08-18-2012 , 23:57   Re: Player status
Reply With Quote #5

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

new hudg_friend[33]

public 
plugin_init() {
    
register_plugin("Player Status""1.0""OnePL"
    
    
register_event("StatusValue""set_team""be""1=1")
    
register_event("StatusValue""player_status""be""1=2""2!0")
    
register_event("StatusValue""player_status""be""1=1""2=0")
    
    
hud CreateHudSyncObj()
}

public 
set_team(idg_friend[id] = read_data(2)

public 
player_status(id) {
    new 
type read_data(1)
    switch(
type) {
        case(
1): ClearSyncHud(idhud)
        case(
2): {
            if(
is_user_alive(id)) {
                new 
pid read_data(2)
                new 
nick[32]; get_user_name(pidnick31)
                new 
clipammowpnname[32], wpnid get_user_weapon(pidclipammo)

                if(
wpnidxmod_get_wpnname(wpnidwpnname31)

                
set_hudmessage(25550255, -1.00.6010.013.00.010.01, -1)

                if(
g_friend[id]) ShowSyncHudMsg(idhud"%s -- %d HP / %d AP / %s"nickget_user_health(pid), get_user_armor(pid), wpnname)
                else 
ShowSyncHudMsg(idhud"%s"nick)
            }
        }
    }
    return 
PLUGIN_CONTINUE


Last edited by OnePL; 08-18-2012 at 23:59. Reason: PHP Tag
OnePL is offline
Send a message via ICQ to OnePL Send a message via AIM to OnePL Send a message via Yahoo to OnePL Send a message via Skype™ to OnePL
Reply


Thread Tools
Display Modes

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 05:53.


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