Raised This Month: $ Target: $400
 0% 

how do i get hostname?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
enjoi.
Veteran Member
Join Date: Mar 2011
Old 10-28-2011 , 16:37   how do i get hostname?
Reply With Quote #1

trying to make a plugin so when you type .need 1-13 it will put in the hostname at the end [ Need 1 ] so how do I get the hostname to change?
__________________
Block Maker v6.0 []
Point Slay v3.0 []
Contact [ PM ]
enjoi. is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 10-28-2011 , 19:33   Re: how do i get hostname?
Reply With Quote #2

"hostname" is a cvar.
So you handle it with pcvars like usual.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 10-28-2011 , 21:35   Re: how do i get hostname?
Reply With Quote #3

If you use get_user_name with 0 for the player it will give you the hostname.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 10-29-2011 , 08:23   Re: how do i get hostname?
Reply With Quote #4

Also don't forget that the string size should be greater than 32 (what is the hostname's char limit, btw?)
Backstabnoob is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 10-29-2011 , 10:06   Re: how do i get hostname?
Reply With Quote #5

Quote:
Originally Posted by Emp` View Post
If you use get_user_name with 0 for the player it will give you the hostname.
Interesting...
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-29-2011 , 10:15   Re: how do i get hostname?
Reply With Quote #6

This is stated in funcwiki, not in description but down in comments.

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

Last edited by Bugsy; 10-29-2011 at 10:15.
Bugsy is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 10-29-2011 , 10:57   Re: how do i get hostname?
Reply With Quote #7

you can try this wich worked for me before:

PHP Code:
public function(id)
{
new 
szName[33]; get_user_name(idszNamecharsmax(szName))
client_print(idprint_chat"Welcome to %s, %s"idszName)

__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Old 10-29-2011, 10:58
Arkshine
This message has been deleted by Arkshine. Reason: nvm
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-29-2011 , 13:19   Re: how do i get hostname?
Reply With Quote #8

Quote:
Originally Posted by Napoleon_be View Post
you can try this wich worked for me before:

PHP Code:
public function(id)
{
new 
szName[33]; get_user_name(idszNamecharsmax(szName))
client_print(idprint_chat"Welcome to %s, %s"idszName)

umm . . . no.
__________________
fysiks is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 10-29-2011 , 14:43   Re: how do i get hostname?
Reply With Quote #9

Quote:
Originally Posted by fysiks View Post
umm . . . no.
umm . . . yes.
It actually works for me ;). ID = server saying the text, that's why it will name the sender of the written text.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 10-29-2011 , 15:02   Re: how do i get hostname?
Reply With Quote #10

Quote:
Originally Posted by Napoleon_be View Post
umm . . . yes.
It actually works for me ;). ID = server saying the text, that's why it will name the sender of the written text.
Using %s with an integer value won't give right results.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Old 10-29-2011, 15:06
.Dare Devil.
This message has been deleted by .Dare Devil.. Reason: ------------------------------------------
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 14:19.


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