Raised This Month: $51 Target: $400
 12% 

need help with zp lvl code


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
shady101
Member
Join Date: Nov 2014
Location: USA
Old 12-24-2015 , 01:48   need help with zp lvl code
Reply With Quote #1

So the code i have makes a prefix for players , showing their levels, resets, sresets before their name
example : [level 500] [Reset 5] [Sreset 3] Player: chat


the prefix itself is Green, playername is team color, and the chat is regular color
what i wanted to do was have the same prefix for admins except make admin names White, and their chat green no matter which team they're on
even if name color cant be changed to white or grey, if admin chat is green while dead and alive, and while dead both admins and regular players have [Dead] prefix , that'd be good
Code:
public HookSay(id)
{
    static message[190]
    read_args(message, charsmax(message))
    remove_quotes(message)
   
    if (equal(message, ""))
    return PLUGIN_HANDLED;
   
    if (is_user_alive(id) && (get_user_flags(id) & ADMIN_IMMUNITY))
        zp_colored_print(0, "^x04[-Level %d] [-Reset %d] [-SReset %d]^x02 %s^x01^x04: %s", g_level[id], g_reset[id], g_grandreset[id], g_playername[id], message)
    else
        zp_colored_print(0, "^x04[Dead]^x02 %s^x04 : %s", g_playername[id], message)
    if (is_user_alive(id))
		zp_colored_print(0, "^x04[-Level %d] [-Reset %d] [-SReset %d]^x03 %s^x01 : %s", g_level[id], g_reset[id], g_grandreset[id], g_playername[id], message)
	else
		zp_colored_print(0, "^x04[Dead]^x03 %s^x01 : %s", g_playername[id], message)
	
	return PLUGIN_HANDLED;

}
thats the code, yet so far this is what it looks like : http://images.akamai.steamuserconten...A96FEBE343E58/
and for normal players it looks like this
http://puu.sh/m6VdO/7c33a782bc.jpg

and i have tried plugins with admin prefix, they make the plugin's own prefix ( Levels, Resets , Sresets ) go away and be replaced by [Admin] instead, and thats not what i wanted
i have also tried admin chat colors and it had no effect at all. im not really a coder much so if anyone can help me out with it i'd really appretiate it

Last edited by shady101; 12-24-2015 at 05:52.
shady101 is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 12-24-2015 , 16:56   Re: need help with zp lvl code
Reply With Quote #2

PHP Code:
public HookSay(id)
{
    static 
message[190]
    
read_args(messagecharsmax(message))
    
remove_quotes(message)
   
    if (
equal(message""))
    return 
PLUGIN_HANDLED;
   
    if (
is_user_alive(id))
        
zp_colored_print(0"^x04%s[-Level %d] [-Reset %d] [-SReset %d]^x02 %s^x01 : %s",(get_user_flags(id) & ADMIN_IMMUNITY) ? "[ADMIN]" "" ,g_level[id], g_reset[id], g_grandreset[id], g_playername[id], message)
    else
        
zp_colored_print(0"^x04%s[Dead]^x03 %s^x01 : %s", (get_user_flags(id) & ADMIN_IMMUNITY) ? "ADMIN" ""g_playername[id], message)
    
    return 
PLUGIN_HANDLED;


This should put [ADMIN] in front of the message.
From the edit i understood that you wanted this.
siriusmd99 is offline
shady101
Member
Join Date: Nov 2014
Location: USA
Old 12-25-2015 , 23:07   Re: need help with zp lvl code
Reply With Quote #3

Quote:
Originally Posted by siriusmd99 View Post
PHP Code:
public HookSay(id)
{
    static 
message[190]
    
read_args(messagecharsmax(message))
    
remove_quotes(message)
   
    if (
equal(message""))
    return 
PLUGIN_HANDLED;
   
    if (
is_user_alive(id))
        
zp_colored_print(0"^x04%s[-Level %d] [-Reset %d] [-SReset %d]^x02 %s^x01 : %s",(get_user_flags(id) & ADMIN_IMMUNITY) ? "[ADMIN]" "" ,g_level[id], g_reset[id], g_grandreset[id], g_playername[id], message)
    else
        
zp_colored_print(0"^x04%s[Dead]^x03 %s^x01 : %s", (get_user_flags(id) & ADMIN_IMMUNITY) ? "ADMIN" ""g_playername[id], message)
    
    return 
PLUGIN_HANDLED;


This should put [ADMIN] in front of the message.
From the edit i understood that you wanted this.



oh no, i just wanted The admin Name to be Grey/White color, and admin chat to be green
and when player or admin is dead, have the [dead] prefix

i do NOT want [admin] prefix like that

Last edited by shady101; 12-25-2015 at 23:50.
shady101 is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 12-26-2015 , 09:46   Re: need help with zp lvl code
Reply With Quote #4

PHP Code:
public HookSay(id)
{
    static 
message[190]
    
read_args(messagecharsmax(message))
    
remove_quotes(message)
   
    if (
equal(message""))
    return 
PLUGIN_HANDLED;
   
    if (
get_user_flags(id) & ADMIN_IMMUNITY){
         if(
is_user_alive(id))
           
zp_colored_print(0"^x04[-Level %d] [-Reset %d] [-SReset %d]^x01 %s^x04: %s",    g_level[id], g_reset[id], g_grandreset[id], g_playername[id], message)
         else
        
zp_colored_print(0"^x04[Dead]^x01 %s^x04 : %s"g_playername[id], message)
    }else{
         if (
is_user_alive(id))
        
zp_colored_print(0"^x04[-Level %d] [-Reset %d] [-SReset %d]^x03 %s^x01 : %s"g_level[id], g_reset[id], g_grandreset[id], g_playername[id], message)
    else
        
zp_colored_print(0"^x04[Dead]^x03 %s^x01 : %s"g_playername[id], message)
    }
    return 
PLUGIN_HANDLED;


Last edited by siriusmd99; 12-26-2015 at 09:47.
siriusmd99 is offline
shady101
Member
Join Date: Nov 2014
Location: USA
Old 12-27-2015 , 00:45   Re: need help with zp lvl code
Reply With Quote #5

Quote:
Originally Posted by siriusmd99 View Post
PHP Code:
public HookSay(id)
{
    static 
message[190]
    
read_args(messagecharsmax(message))
    
remove_quotes(message)
   
    if (
equal(message""))
    return 
PLUGIN_HANDLED;
   
    if (
get_user_flags(id) & ADMIN_IMMUNITY){
         if(
is_user_alive(id))
           
zp_colored_print(0"^x04[-Level %d] [-Reset %d] [-SReset %d]^x01 %s^x04: %s",    g_level[id], g_reset[id], g_grandreset[id], g_playername[id], message)
         else
        
zp_colored_print(0"^x04[Dead]^x01 %s^x04 : %s"g_playername[id], message)
    }else{
         if (
is_user_alive(id))
        
zp_colored_print(0"^x04[-Level %d] [-Reset %d] [-SReset %d]^x03 %s^x01 : %s"g_level[id], g_reset[id], g_grandreset[id], g_playername[id], message)
    else
        
zp_colored_print(0"^x04[Dead]^x03 %s^x01 : %s"g_playername[id], message)
    }
    return 
PLUGIN_HANDLED;

thank u so much sir
shady101 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 22:05.


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