Raised This Month: $ Target: $400
 0% 

SEMICLIP


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 05-20-2020 , 17:56   Re: SEMICLIP
Reply With Quote #1

Quote:
Originally Posted by Cirovic View Post
That works only on ENEMY player, i cant get info on TEAMMATE BECAUSE OF SEMICLIP !!!!!!
This is what you want enjoy
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

#define NAME "show teammate's health"
#define VERSION "1.3.2"
#define AUTHOR "MrAbdoO"

new g_max_playersg_sync_creat_statustextg_sync_creat_list

new bool:g_teammate[33]

new 
cvar_plugin_on
new cvar_status_on

public plugin_init()
{
    
register_plugin(NAMEVERSIONAUTHOR)
    
    
RegisterHam(Ham_Spawn"player""player_spawn"1)
    
    
register_clcmd("say /health""clcmd_health")
    
    
register_event("StatusValue""show_teammate_head""be""1=2""2!0")
    
register_event("StatusValue""set_team""be""1=1")
    
    
cvar_plugin_on register_cvar("stm_on""1")
    
cvar_status_on register_cvar("stm_st_on""1")
    
    
g_max_players get_maxplayers()
    
g_sync_creat_statustext CreateHudSyncObj()
    
g_sync_creat_list CreateHudSyncObj()
}

public 
clcmd_health(client)
{
    if (!
get_pcvar_num(cvar_plugin_on))
    {
        
client_print(clientprint_chat"[AMXX]: Show Teammate's health was off.")
        return 
PLUGIN_HANDLED
    
}
    
show_health(client)
    return 
PLUGIN_CONTINUE
}

public 
player_spawn(client)
{
    
remove_task(client)
    if (
is_user_alive(client) && get_pcvar_num(cvar_plugin_on))
    {
        
set_task(1.0"show_health"client)
    }
}

public 
show_health(client)
{
    static 
message[1024];
    static 
name[32];
    
    new 
healthidlen;
    
    
len format(messagecharsmax(message), "The teammate's health:^n");
    for (
id 1id <= g_max_playersid++)
    {
        if (
id != client && is_user_connected(id) && cs_get_user_team(id) == cs_get_user_team(client))
        {
            
health get_user_health(id);
            
get_user_name(idname31);
            
len += format(message[len], charsmax(message) - len"%-22.22s: %d^n"namehealth);
        }
    }
    
set_hudmessage(10020000.050.3500.025.00.10.22);
    
ShowSyncHudMsg(clientg_sync_creat_listmessage);
}

public 
set_team(id)
    
g_teammate[id] = bool:(read_data(2) == 1);

public 
show_teammate_health(id)
{
    if (!
get_pcvar_num(cvar_plugin_on))
        return 
PLUGIN_HANDLED
    
if(!is_user_bot(id) && is_user_connected(id) && get_pcvar_num(cvar_status_on))
    {
        static 
name[32]
        
        new 
pid read_data(2)
        new 
red 0blue 0
        
        
if (cs_get_user_team(pid) == CS_TEAM_T)
            
red 255
        
else if(cs_get_user_team(pid) == CS_TEAM_CT)
            
blue 255
        
        get_user_name
(pidnamecharsmax(name))
        new 
health get_user_health(pid)
        if (
g_teammate[id])
        {
            
set_hudmessage(red50blue, -1.00.6010.010.60.010.018)
            
ShowSyncHudMsg(idg_sync_creat_statustext"Friend:%s -- health:%d"namehealth)
        }
        else {
            
set_hudmessage(red50blue, -1.00.6010.010.60.010.018)
            
ShowSyncHudMsg(idg_sync_creat_statustext"Enemy:%s -- health:%d"namehealth)
        }
    }
    return 
PLUGIN_CONTINUE
}

public 
client_disconnect(client)
{
    
remove_task(client)

Supremache is offline
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 09:00.


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