Raised This Month: $ Target: $400
 0% 

Scoreboard Sprite-Icons for each Player in NS


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Silencer123
Veteran Member
Join Date: Jul 2006
Old 11-01-2006 , 07:25   Scoreboard Sprite-Icons for each Player in NS
Reply With Quote #1

How do I do a Scoreboard Sprite-Icon for each Player in NS?
I searched the whole Forums. I found Plugins and looked at the
Source Code but I did not find out how to. Please help me!
__________________
EAT YOUR VEGGIES
Silencer123 is offline
schnitzelmaker
Senior Member
Join Date: Apr 2006
Location: HERE
Old 11-01-2006 , 10:07   Re: Scoreboard Sprite-Icons for each Player in NS
Reply With Quote #2

Here some exaample how to use icons:
http://forums.alliedmods.net/showthread.php?p=53839
http://www.nsmod.org/forums/index.php?showtopic=5390

You need the message "ScoreInfo" for that and set msg_arg 6 to 512 and msg_arg 8 to iconname.
I dont post all code,only the recommmend
Code:
new ICON[33][36];     // icon they should display public plugin_init() {   //...   register_message(get_user_msgid("ScoreInfo"),"hook_scoreinfo"); } public plugin_precache() {   copy(ICON[id],35,"youriconname999")   new short_icon[33];   copy(short_icon,strlen(icon)-3,ICON[id]);//copy the icon without the numbers at end   new szPath[256];   format(szPath,255,"gfx/vgui/640_%s.tga",short_icon);   precache_generic(szPath) } public hook_scoreinfo() {   new id=get_msg_arg_int(1);   set_msg_arg_int(6,ARG_SHORT,512)//need to set to 512 to enable custom icon   set_msg_arg_string(8,ICON[id])//ICON[id] hold the the icon, }
__________________

Last edited by schnitzelmaker; 11-01-2006 at 10:10.
schnitzelmaker is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Old 11-01-2006 , 10:14   Re: Scoreboard Sprite-Icons for each Player in NS
Reply With Quote #3

Ok thanks I'll try it. What about the return Types?
In the Plugin I have here I see return Numbers -1, 0, 4 and 512.
__________________
EAT YOUR VEGGIES
Silencer123 is offline
schnitzelmaker
Senior Member
Join Date: Apr 2006
Location: HERE
Old 11-01-2006 , 12:29   Re: Scoreboard Sprite-Icons for each Player in NS
Reply With Quote #4

The return are for "set_msg_arg_int(6,ARG_SHORT,512)"
There are some default icons, op icon has icon id 4, cd icon has id 32.
So to set a player icon to cd icon :set_msg_arg_int(6,ARG_SHORT,32)

This default icons are used as bitmask from (1<<0)(1) to end (1<<9)(512)
512 is the number to use a custom icon.
Here the default icon ids:
The player's auth status. A bitmask made up of the following constants from the NS SDK:
PLAYERAUTH_NONE = 0,
PLAYERAUTH_DEVELOPER = 1,
PLAYERAUTH_GUIDE = 2,
PLAYERAUTH_SERVEROP = 4,
PLAYERAUTH_PLAYTESTER = 8,
PLAYERAUTH_CONTRIBUTOR = 16,
PLAYERAUTH_CHEATINGDEATH = 32,
PLAYERAUTH_VETERAN = 64,
PLAYERAUTH_BETASERVEROP = 128,
PLAYERAUTH_PENDING = 256,
PLAYERAUTH_CUSTOM = 512,
PLAYERAUTH_UPP_MODE = 16384
__________________

Last edited by schnitzelmaker; 11-01-2006 at 12:40.
schnitzelmaker is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Old 11-01-2006 , 13:39   Re: Scoreboard Sprite-Icons for each Player in NS
Reply With Quote #5

Thanks, so, do I have to use return, or not?
__________________
EAT YOUR VEGGIES
Silencer123 is offline
schnitzelmaker
Senior Member
Join Date: Apr 2006
Location: HERE
Old 11-01-2006 , 14:30   Re: Scoreboard Sprite-Icons for each Player in NS
Reply With Quote #6

NOPE

You only need 512 for custom icons,or a PLAYERAUTH id(1-256) for default icons.

Returns are only to return something from one function to another function:
Code:
public function1() { new test = function2() } public function2() { new test2 = 10 return test2 }
__________________

Last edited by schnitzelmaker; 11-01-2006 at 14:38.
schnitzelmaker is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Old 11-02-2006 , 08:45   Re: Scoreboard Sprite-Icons for each Player in NS
Reply With Quote #7

Quote:
Originally Posted by schnitzelmaker View Post
Returns are only to return something from one function to another function


EDIT (3 years later): Some icons just don't appear - *.tga must be in some special format.
__________________
EAT YOUR VEGGIES

Last edited by Silencer123; 03-17-2009 at 16:35.
Silencer123 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 04:54.


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