Raised This Month: $32 Target: $400
 8% 

A code suggestion


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MagNNusS
Member
Join Date: May 2018
Location: World of Bushi
Old 10-18-2018 , 09:44   A code suggestion
Reply With Quote #1

Hi..
I am trying to make a special hud for my public server, but the problem is I cannot make it, there are some unknown codes to me.
I wan't to make some thing like this
PHP Code:
ShowSyncHudMsg(idsyncObj"Player Status: ON | Admin Ship Rank: %s"/// - Shows admin rank. 
I searched on google already everywhere, but I cannot find the code.
If someone show me the code or explain me how to create it, I would be really happy
Regards.
__________________
Just an impractical signature
nothing to see here.
MagNNusS is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 10-18-2018 , 10:02   Re: A code suggestion
Reply With Quote #2

You are searching for code
Post in Request section.
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM
Ghosted is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 10-19-2018 , 07:07   Re: A code suggestion
Reply With Quote #3

Quote:
Originally Posted by Ghosted View Post
You are searching for code
Post in Request section.
Wrong again. This is the correct place to ask this kind of question. He is asking how to create, not somebody else to create it for him.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 10-19-2018 , 07:16   Re: A code suggestion
Reply With Quote #4

First of all you need a variable or a native that returns the information you need, so you can later display it.
Something like this
PHP Code:
ShowSyncHudMsg(idsyncObj"Player Status: ON | Admin Ship Rank: %s"g_szAdminRank[id]) 
__________________
edon1337 is offline
E1_531G
Senior Member
Join Date: Dec 2017
Old 10-19-2018 , 07:28   Re: A code suggestion
Reply With Quote #5

You must have rank list:
PHP Code:
new g_RankName[][] =
{
    
"Admiral",
    
"General",
    
etc...

and enum (with the same size):
PHP Code:
enum
{
   
Rank_Admiral 0,
   
Rank_General,
   
etc...

Global array to store player's rank:
PHP Code:
new g_AdminRank[MAX_PLAYERS+1
Set the rank:
PHP Code:
g_AdminRank[id] = Rank_General 
Print the rank:
PHP Code:
ShowSyncHudMsg(idsyncObj"Player Status: ON | Admin Ship Rank: %s"g_RankName[g_AdminRank[id]]) /// - Shows admin rank. 
Simplified form to understand:
PHP Code:
new rank g_AdminRank[id]
new 
Rank[32]
copyRankcharsmax(Rank), g_RankName[rank] )

ShowSyncHudMsg(idsyncObj"Player Status: ON | Admin Ship Rank: %s"Rank/// - Shows admin rank. 
or
PHP Code:
new rank g_AdminRank[id]

ShowSyncHudMsg(idsyncObj"Player Status: ON | Admin Ship Rank: %s"g_RankName[rank]) /// - Shows admin rank. 
__________________
My English is A0
E1_531G is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 10-19-2018 , 07:41   Re: A code suggestion
Reply With Quote #6

Quote:
Originally Posted by OciXCrom View Post
Wrong again. This is the correct place to ask this kind of question. He is asking how to create, not somebody else to create it for him.
He wants code aka plugin in this case, he was searching for it and wants both type hudmessages in it. And after testing will decide which to keep. So you are wrong not me.

I see in this code
ShowSyncHudMsg(id, syncObj, "Player Status: ON | Admin Ship Rank: %s")
Theres %s which is not formatted, this guy really wants plugin than part of the code.
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM

Last edited by Ghosted; 10-19-2018 at 07:43.
Ghosted is offline
MagNNusS
Member
Join Date: May 2018
Location: World of Bushi
Old 10-21-2018 , 05:25   Re: A code suggestion
Reply With Quote #7

Quote:
Originally Posted by E1_531G View Post
You must have rank list:
PHP Code:
new g_RankName[][] =
{
    
"Admiral",
    
"General",
    
etc...

and enum (with the same size):
PHP Code:
enum
{
   
Rank_Admiral 0,
   
Rank_General,
   
etc...

Global array to store player's rank:
PHP Code:
new g_AdminRank[MAX_PLAYERS+1
Set the rank:
PHP Code:
g_AdminRank[id] = Rank_General 
Print the rank:
PHP Code:
ShowSyncHudMsg(idsyncObj"Player Status: ON | Admin Ship Rank: %s"g_RankName[g_AdminRank[id]]) /// - Shows admin rank. 
Simplified form to understand:
PHP Code:
new rank g_AdminRank[id]
new 
Rank[32]
copyRankcharsmax(Rank), g_RankName[rank] )

ShowSyncHudMsg(idsyncObj"Player Status: ON | Admin Ship Rank: %s"Rank/// - Shows admin rank. 
or
PHP Code:
new rank g_AdminRank[id]

ShowSyncHudMsg(idsyncObj"Player Status: ON | Admin Ship Rank: %s"g_RankName[rank]) /// - Shows admin rank. 
Thank you, you helped me a'lot
__________________
Just an impractical signature
nothing to see here.
MagNNusS 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 02:08.


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