Raised This Month: $32 Target: $400
 8% 

[CSGO] Hud & armor plugin


Post New Thread Reply   
 
Thread Tools Display Modes
vortex.
AlliedModders Donor
Join Date: Jan 2017
Location: OnGameFrame()
Old 04-16-2017 , 09:32   Re: [CSGO] Hud & armor plugin
Reply With Quote #11

Please, show
__________________
vortex. is offline
MBf
Member
Join Date: Aug 2016
Old 04-21-2017 , 02:26   Re: [CSGO] Hud & armor plugin
Reply With Quote #12

Hello,

Can there be 2 or more messages to change the round?

Thank you.

Quote:
Originally Posted by Franc1sco View Post
You create a new CreateTimer every "round start" without kill the previous timer, so it will accumulated (Memory leak issue).


The code should be:
Spoiler
__________________
PLAY.ACEARENA.RO
WWW.ACEARENA.RO
MBf is offline
vortex.
AlliedModders Donor
Join Date: Jan 2017
Location: OnGameFrame()
Old 04-28-2017 , 12:17   Re: [CSGO] Hud & armor plugin
Reply With Quote #13

PHP Code:
SetHudTextParams(XY5.0RGBA00.10.10.1); 
Change variables. And you can use it.
__________________
vortex. is offline
MBf
Member
Join Date: Aug 2016
Old 05-02-2017 , 10:44   Re: [CSGO] Hud & armor plugin
Reply With Quote #14

Quote:
Originally Posted by vortex. View Post
PHP Code:
SetHudTextParams(XY5.0RGBA00.10.10.1); 
Change variables. And you can use it.
Can I add 3 messages below?
I do not really understand at all ...

Thank you.
Code:
#include <sourcemod>  
#include <cstrike>  

public Plugin myinfo =  
{  
    name = "HUD",  
    author = "Nevvy",  
    description = "",  
    version = "",  
    url = "Nevvy.pl"  
};  

public OnPluginStart()  
{  
    CreateTimer(5.0, HUD, _, TIMER_REPEAT);  
}  

public Action HUD(Handle timer)  
{  
    for (new i = 1; i <= MaxClients; i++)  
    {  
        if (IsClientInGame(i))  
        {  
            SetHudTextParams(-1.0, 0.1, 5.0, 255, 255, 255, 255, 0, 0.1, 0.1, 0.1);  
            ShowHudText(i, 5, "Oldcs.1TAP.Ro");  
        }  
    }  
}
__________________
PLAY.ACEARENA.RO
WWW.ACEARENA.RO
MBf is offline
vortex.
AlliedModders Donor
Join Date: Jan 2017
Location: OnGameFrame()
Old 05-02-2017 , 15:36   Re: [CSGO] Hud & armor plugin
Reply With Quote #15

Yes, you should use different coordinates.
__________________
vortex. is offline
Sw33T3R
AlliedModders Donor
Join Date: Mar 2014
Old 05-03-2017 , 08:03   Re: [CSGO] Hud & armor plugin
Reply With Quote #16

Quote:
Originally Posted by vortex. View Post
Yes, you should use different coordinates.
And different text channel
Code:
https://developer.valvesoftware.com/wiki/Game_text
Sw33T3R is offline
Papero
Veteran Member
Join Date: Aug 2016
Location: Italy
Old 05-03-2017 , 10:50   Re: [CSGO] Hud & armor plugin
Reply With Quote #17

For the second request, try this, not tested but should work:
PHP Code:




#define TAG "Oldcs.1TAP.Ro" /* <------------  !Put the tag here! */



#pragma semicolon 1
#pragma newdecls required

#define PLUGIN_AUTHOR "Hexah"
#define PLUGIN_VERSION "2.00"


public Plugin myinfo 
{
    
name "GiveArmourTag"
    
author PLUGIN_AUTHOR
    
description "Give an armour to all players with a certain tag"
    
version PLUGIN_VERSION
    
url "https://forums.alliedmods.net/showthread.php?t=296082"
};


public 
void OnPluginStart()
{
    
HookEvent("round_start"OnRoundStart);
}

public 
void OnRoundStart(Event event, const char[] namebool dontbroadcast)
{
    for (
int i 1<= MaxClientsi++)
    {
        if (
CheckTag(i))
            
SetEntProp(iProp_Send"m_ArmorValue"100);
    }
}

bool CheckTag(int client)
{
    
char sName[32];
    if (!
IsClientInGame(client))
        return 
false;
    
    
GetClientName(clientsNamesizeof(sName));
    
    if ((
StrContains(sNameTAG)) != -1)
    {
        return 
true;
    }
    return 
false;

__________________
My Plugins
SPCode


Steam: hexer504
Telegram: Hexah
Discord: Hexah#6903

If you like my work you can donate here!
Papero is offline
sHoC
Senior Member
Join Date: Nov 2015
Location: Italy
Old 05-04-2017 , 15:51   Re: [CSGO] Hud & armor plugin
Reply With Quote #18

Quote:
Originally Posted by Papero View Post
For the second request, try this, not tested but should work:
PHP Code:




#define TAG "Oldcs.1TAP.Ro" /* <------------  !Put the tag here! */



#pragma semicolon 1
#pragma newdecls required

#define PLUGIN_AUTHOR "Hexah"
#define PLUGIN_VERSION "2.00"


public Plugin myinfo 
{
    
name "GiveArmourTag"
    
author PLUGIN_AUTHOR
    
description "Give an armour to all players with a certain tag"
    
version PLUGIN_VERSION
    
url "https://forums.alliedmods.net/showthread.php?t=296082"
};


public 
void OnPluginStart()
{
    
HookEvent("round_start"OnRoundStart);
}

public 
void OnRoundStart(Event event, const char[] namebool dontbroadcast)
{
    for (
int i 1<= MaxClientsi++)
    {
        if (
CheckTag(i))
            
SetEntProp(iProp_Send"m_ArmorValue"100);
    }
}

bool CheckTag(int client)
{
    
char sName[32];
    if (!
IsClientInGame(client))
        return 
false;
    
    
GetClientName(clientsNamesizeof(sName));
    
    if ((
StrContains(sNameTAG)) != -1)
    {
        return 
true;
    }
    return 
false;

ty dude
__________________
sHoC is offline
MBf
Member
Join Date: Aug 2016
Old 05-06-2017 , 08:36   Re: [CSGO] Hud & armor plugin
Reply With Quote #19

Quote:
Originally Posted by Sw33T3R View Post
And different text channel
Code:
https://developer.valvesoftware.com/wiki/Game_text
Can you help me, please?
I do not know how to change, add 3 messages ...
__________________
PLAY.ACEARENA.RO
WWW.ACEARENA.RO

Last edited by MBf; 05-06-2017 at 08:37.
MBf is offline
qiuhaian
Senior Member
Join Date: Nov 2009
Old 05-09-2017 , 04:01   Re: [CSGO] Hud & armor plugin
Reply With Quote #20

Quote:
Originally Posted by MBf View Post
Can you help me, please?
I do not know how to change, add 3 messages ...
use this

https://forums.alliedmods.net/showthread.php?t=248314
qiuhaian 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:50.


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