Raised This Month: $ Target: $400
 0% 

ScoreAttrib


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CyberMaN
Junior Member
Join Date: Mar 2009
Old 03-24-2009 , 10:34   ScoreAttrib
Reply With Quote #1

Hello there,

My name is James, and I am new at amxmodx coding. Now, I would like to ask a question. I am working to get a small thing running, show VIP in the scoreboard. I linked myself to:

http://www.amxmodx.org/funcwiki.php?go=func&id=202

And to someone's code containing:
PHP Code:
stock cs_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();

with a comment of (1<<2) means VIP.

Well, I can't get it to work out, I've tried using about 5 other plugins to see if their side worked, but I just can't see it on the scoreboard. And everything works wonderfully on the server, no problems with the plugins loading.

Thanks in advance for any help offered,
James.
CyberMaN is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-24-2009 , 11:01   Re: ScoreAttrib
Reply With Quote #2

The code was written by ConnorMcLeod, slightly edited.

http://forums.alliedmods.net/showthread.php?t=80069

According to the below thread, if you are a terrorist and VIP, you cannot see the VIP next to your name but others can. If you are a CT then you and others can see it.

http://forums.alliedmods.net/showthread.php?t=70840

Below I made it apply VIP to myself just to show how you can do it. You will need to modify it to apply on particular players.

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

#define PLUGIN "Rank1 -> VIP"
#define AUTHOR "ConnorMcLeod"
#define VERSION "0.0.2"

#define SCOREATTRIB_VIP            (1<<2)

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_message(get_user_msgid("ScoreAttrib"), "Message_ScoreAttrib")
}

public 
Message_ScoreAttrib(osef2talifeosef3talifeosef4talife)
{
    new 
id get_msg_arg_int(1)

    if( 
id == get_user_index("bugsy") && !get_msg_arg_int(2) )
    {
            
set_msg_arg_int(2ARG_BYTESCOREATTRIB_VIP)
    }

__________________

Last edited by Bugsy; 03-24-2009 at 11:57.
Bugsy is offline
CyberMaN
Junior Member
Join Date: Mar 2009
Old 03-24-2009 , 11:18   Re: ScoreAttrib
Reply With Quote #3

Thank you very very much, Bugsy. Short and neat, just the way it should be.

Everything in order to get me started is in there, thanks again.

+1 Karma for the quick reply and the correct solution, and please feel free to PM me if there is anything I can do for you.

Regards,
James.

P.S: To verify/debate everything said about how it works, here's the deal:

CT -> You can see VIP, CT's can see VIP, T's can't see VIP, Spectators can see VIP.
T -> You can't see VIP, others CAN'T(!) see VIP.

I'll try to see if I can change it, good luck to me.

Last edited by CyberMaN; 03-24-2009 at 11:28.
CyberMaN is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-24-2009 , 21:38   Re: ScoreAttrib
Reply With Quote #4

I just found this in my files, it has a fm_cs_set_user_vip() function among other useful function. It will be a bit easier to set on a player than using what I posted above.
Attached Files
File Type: inc fm_cstrike.inc (20.4 KB, 490 views)
__________________
Bugsy 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:01.


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