AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   how do i get hostname? (https://forums.alliedmods.net/showthread.php?t=170763)

enjoi. 10-28-2011 16:37

how do i get hostname?
 
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?

drekes 10-28-2011 19:33

Re: how do i get hostname?
 
"hostname" is a cvar.
So you handle it with pcvars like usual.

Emp` 10-28-2011 21:35

Re: how do i get hostname?
 
If you use get_user_name with 0 for the player it will give you the hostname.

Backstabnoob 10-29-2011 08:23

Re: how do i get hostname?
 
Also don't forget that the string size should be greater than 32 (what is the hostname's char limit, btw?)

drekes 10-29-2011 10:06

Re: how do i get hostname?
 
Quote:

Originally Posted by Emp` (Post 1585347)
If you use get_user_name with 0 for the player it will give you the hostname.

Interesting...

Bugsy 10-29-2011 10:15

Re: how do i get hostname?
 
This is stated in funcwiki, not in description but down in comments.

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

Napoleon_be 10-29-2011 10:57

Re: how do i get hostname?
 
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)



fysiks 10-29-2011 13:19

Re: how do i get hostname?
 
Quote:

Originally Posted by Napoleon_be (Post 1585692)
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.

Napoleon_be 10-29-2011 14:43

Re: how do i get hostname?
 
Quote:

Originally Posted by fysiks (Post 1585807)
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.

drekes 10-29-2011 15:02

Re: how do i get hostname?
 
Quote:

Originally Posted by Napoleon_be (Post 1585872)
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.


All times are GMT -4. The time now is 14:19.

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