AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Scoreboard Sprite-Icons for each Player in NS (https://forums.alliedmods.net/showthread.php?t=46727)

Silencer123 11-01-2006 07:25

Scoreboard Sprite-Icons for each Player in NS
 
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!

schnitzelmaker 11-01-2006 10:07

Re: Scoreboard Sprite-Icons for each Player in NS
 
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, }

Silencer123 11-01-2006 10:14

Re: Scoreboard Sprite-Icons for each Player in NS
 
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. :?

schnitzelmaker 11-01-2006 12:29

Re: Scoreboard Sprite-Icons for each Player in NS
 
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

Silencer123 11-01-2006 13:39

Re: Scoreboard Sprite-Icons for each Player in NS
 
Thanks, so, do I have to use return, or not?

schnitzelmaker 11-01-2006 14:30

Re: Scoreboard Sprite-Icons for each Player in NS
 
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 }

Silencer123 11-02-2006 08:45

Re: Scoreboard Sprite-Icons for each Player in NS
 
Quote:

Originally Posted by schnitzelmaker (Post 398265)
Returns are only to return something from one function to another function

:idea:

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


All times are GMT -4. The time now is 04:54.

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