Raised This Month: $ Target: $400
 0% 

Customize HUD + Country + City + Ping


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
UltraOn
New Member
Join Date: Sep 2023
Old 09-03-2023 , 14:03   Customize HUD + Country + City + Ping
Reply With Quote #1

Hello friends, I have the code of a plugin where I would like to implement in the HUD the country in full, city and ping of the player against the server.

Could anyone help to improve this code?

Another cool thing would also be to improve the HUD font and put it in white.
Attached Thumbnails
Click image for larger version

Name:	Captura de Tela 2023-09-03 às 14.00.11.jpg
Views:	59
Size:	25.8 KB
ID:	201488  
Attached Files
File Type: amxx csr_patentes_csgo.amxx (23.5 KB, 11 views)
File Type: sma Get Plugin or Get Source (csr_patentes_csgo.sma - 42 views - 59.2 KB)
File Type: zip csr_patentes_csgo (2).zip (37.6 KB, 20 views)
UltraOn is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 09-03-2023 , 14:37   Re: Customize HUD + Country + City + Ping
Reply With Quote #2

the code is a mess but if you understand coding follow this
Code:
enum _:displayCountry{     ip[MAX_NAME_LENGTH]     city[45],     country[45],     ping,     loss } new player_info[MAX_PLAYERS + 1][displayCountry] public xClientPutInServer(id) {     get_user_ip(id, player_info[id][ip], charsmax(player_info[][ip]), 1)         if (geoip_country_ex(player_info[id][ip], player_info[id][country], charsmax(player_info[][country])))     {         geoip_city(player_info[id][ip], player_info[id][city], charsmax(player_info[][city]))     } } public xHudInfo(id) {     static country_text[128]     if (player_info[id][city][0] != EOS)         copy(country_text, charsmax(country_text), player_info[id][city])     if (player_info[id][country][0] != EOS)         add(country_text, charsmax(country_text), "%s%s | %d", player_info[id][city][0] != EOS ? ", " : "", player_info[id][city], player_info[id][ping])     ShowSyncHudMsg(id, xMsgSync[0], "..^n%s", .., country_text) }
__________________

Last edited by bigdaddy424; 09-03-2023 at 14:38. Reason: : at ?
bigdaddy424 is offline
UltraOn
New Member
Join Date: Sep 2023
Old 09-03-2023 , 16:02   Re: Customize HUD + Country + City + Ping
Reply With Quote #3

Quote:
Originally Posted by bigdaddy424 View Post
the code is a mess but if you understand coding follow this
Code:
enum _:displayCountry{     ip[MAX_NAME_LENGTH]     city[45],     country[45],     ping,     loss } new player_info[MAX_PLAYERS + 1][displayCountry] public xClientPutInServer(id) {     get_user_ip(id, player_info[id][ip], charsmax(player_info[][ip]), 1)         if (geoip_country_ex(player_info[id][ip], player_info[id][country], charsmax(player_info[][country])))     {         geoip_city(player_info[id][ip], player_info[id][city], charsmax(player_info[][city]))     } } public xHudInfo(id) {     static country_text[128]     if (player_info[id][city][0] != EOS)         copy(country_text, charsmax(country_text), player_info[id][city])     if (player_info[id][country][0] != EOS)         add(country_text, charsmax(country_text), "%s%s | %d", player_info[id][city][0] != EOS ? ", " : "", player_info[id][city], player_info[id][ping])     ShowSyncHudMsg(id, xMsgSync[0], "..^n%s", .., country_text) }

Friend, thank you very much for your support and collaboration, unfortunately I am from infrastructure and I do not handle programming very well, if it is not asking too much and being able to share an updated sma with your idea would be incredible.

Thank you very much!!!
UltraOn 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 06:47.


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