Raised This Month: $ Target: $400
 0% 

How to set user to VIP only in scorebar


Post New Thread Reply   
 
Thread Tools Display Modes
vato loco [GE-S]
Veteran Member
Join Date: Oct 2006
Location: Germany
Old 02-22-2009 , 09:32   Re: How to set user to VIP only in scorebar
Reply With Quote #11

tell us what you exactly want.
do want everybody is vip in scorboard or only admins ???
or do you want to have a vip.ini with steamid's for vip player.
__________________
vato loco [GE-S] is offline
Lukass
Junior Member
Join Date: Dec 2008
Old 02-22-2009 , 09:43   Re: How to set user to VIP only in scorebar
Reply With Quote #12

i tested only

public client_connect(id) {
if(vips[id] == 1) {

fm_set_user_scoreattrib(id,4);

}

}

But it's not working.

//EDIT: Yes, i want to admins get this feature.

Last edited by Lukass; 02-22-2009 at 09:48.
Lukass is offline
Lukass
Junior Member
Join Date: Dec 2008
Old 02-22-2009 , 09:52   Re: How to set user to VIP only in scorebar
Reply With Quote #13

And it's working only for CT`s, but i need to this work on both.
Lukass is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 02-22-2009 , 09:55   Re: How to set user to VIP only in scorebar
Reply With Quote #14

Try that :

Code:
      #include <amxmodx>     #include <amxmisc>         #define SCOREATTRIB_VIP  ( 1 << 2 )     #define MAX_CLIENTS  32     #define TEAM_CT      2         new bool:g_IsAdmin[ MAX_CLIENTS + 1 ];         public plugin_init()     {         register_plugin( "Admin VIP", "1.0.0", "Arkshine" )         register_message( get_user_msgid( "ScoreAttrib" ), "Message_ScoreAttrib" );     }         public client_putinserver( PlayerId )     {         g_IsAdmin[ PlayerId ] = bool:is_user_admin( PlayerId );     }     public Message_ScoreAttrib( const MsgId, const MsgType, const MsgDest )     {         static PlayerId;                 if ( g_IsAdmin[ ( PlayerId = get_msg_arg_int( 1 ) ) ] && !get_msg_arg_int( 2 ) && get_user_team( PlayerId ) == TEAM_CT )         {             set_msg_arg_int( 2, ARG_BYTE, SCOREATTRIB_VIP );         }     }

This should work only for CT.

Last edited by Arkshine; 02-22-2009 at 09:57.
Arkshine is offline
vato loco [GE-S]
Veteran Member
Join Date: Oct 2006
Location: Germany
Old 02-22-2009 , 09:56   Re: How to set user to VIP only in scorebar
Reply With Quote #15

here an example
i'm not sure but it's not workin for terro only when you in ct team you can see
that the terro's has the vip tag in scorebord

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plugin"
#define VERSION "1.0"
#define AUTHOR "Author"

#define VIP_LEVEL ADMIN_KICK

new vips[33]

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("ResetHUD","resethud","be")
}

public 
client_putinserver(id)
{
    if(
access(id,VIP_LEVEL))
    {
        
vips[id] = true
    
}
}

public 
client_disconnect(id
{
    if( 
vips[id] )
    {
        
vips[id] = false
    
}
}

public 
resethud(id)
{
    if( 
vips[id] )
    {
        
set_user_scoreattrib(id,4)
    }
}

stock set_user_scoreattrib(id,attrib=0)
{
    
message_begin(2,get_user_msgid("ScoreAttrib"),{0,0,0},0);
    
write_byte(id);
    
write_byte(attrib);
    
message_end();

__________________

Last edited by vato loco [GE-S]; 02-22-2009 at 10:13.
vato loco [GE-S] is offline
Lukass
Junior Member
Join Date: Dec 2008
Old 02-22-2009 , 10:53   Re: How to set user to VIP only in scorebar
Reply With Quote #16

Thank you all for help. Now i'm using vato loco [GE-S]'s example, and it works okay.
Lukass is offline
boss
New Member
Join Date: Feb 2009
Old 02-26-2009 , 03:01   Re: How to set user to VIP only in scorebar
Reply With Quote #17

Quote:
Originally Posted by vato loco [GE-S] View Post
here an example
i'm not sure but it's not workin for terro only when you in ct team you can see
that the terro's has the vip tag in scorebord

PHP Code:
/* Plugin generated by AMXX-Studio */
 
#include <amxmodx>
#include <amxmisc>
 
#define PLUGIN "New Plugin"
#define VERSION "1.0"
#define AUTHOR "Author"
 
#define VIP_LEVEL ADMIN_KICK
 
new vips[33]
 
public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
 
    
register_event("ResetHUD","resethud","be")
}
 
public 
client_putinserver(id)
{
    if(
access(id,VIP_LEVEL))
    {
        
vips[id] = true
    
}
}
 
public 
client_disconnect(id
{
    if( 
vips[id] )
    {
        
vips[id] = false
    
}
}
 
public 
resethud(id)
{
    if( 
vips[id] )
    {
        
set_user_scoreattrib(id,4)
    }
}
 
stock set_user_scoreattrib(id,attrib=0)
{
    
message_begin(2,get_user_msgid("ScoreAttrib"),{0,0,0},0);
    
write_byte(id);
    
write_byte(attrib);
    
message_end();

How to make that this code work for both teams - CT's and T's ?
boss is offline
vato loco [GE-S]
Veteran Member
Join Date: Oct 2006
Location: Germany
Old 02-26-2009 , 05:59   Re: How to set user to VIP only in scorebar
Reply With Quote #18

Quote:
Originally Posted by vato loco [GE-S] View Post
when you in ct team you can see
that the terro's has the vip tag in scorebord
i think more is not possible
__________________
vato loco [GE-S] is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 02-26-2009 , 08:52   Re: How to set user to VIP only in scorebar
Reply With Quote #19

I'm using this.
Code:
#include <amxmodx>   #define FLAG_VIP ADMIN_LEVEL_A   new g_ScoreAttrib;   public plugin_init()         register_event("CurWeapon", "WeaponChange", "be", "1=1");   public plugin_cfg()         g_ScoreAttrib = get_user_msgid("ScoreAttrib");   public WeaponChange(Client)         if (is_user_alive(Client) && (get_user_flags(Client) & FLAG_VIP))                 set_task(0.1, "SetVIP", Client);   public SetVIP(Client) {         if (is_user_alive(Client) && !user_has_weapon(Client, CSW_C4))         {                 message_begin(MSG_ALL, g_ScoreAttrib);                 write_byte(Client);                 write_byte(4);                 message_end();         } }
Alive CTs, dead Ts will see admin Ts as VIPs, unless admin T has C4.
__________________

Last edited by hleV; 02-26-2009 at 08:55.
hleV is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 02-26-2009 , 09:34   Re: How to set user to VIP only in scorebar
Reply With Quote #20

why curweapon and not spawn event?
Owyn is offline
Send a message via ICQ to Owyn
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 16:54.


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