ItsMods

Full Version: How to get a players XUID printed on screen
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have tryed many things in "OnPlayerConnect()":

PHP Code:
self iPrintLnBold(self.guid); 
also tried self.xuid, self getxuid, self getguid, etc. Also tried with the setText rather than iprintlnbold.

If somebody could test something and give me/explain to me how the code works it would be great, I keep getting "struct is not an entity" error.
Code:
iprintln(self.name+" xuid is "+ self getxuid());
Add this in onplayerspawned()
\status in console.
(06-12-2011, 10:57)met94 Wrote: [ -> ]
Code:
iprintln(self.name+" xuid is "+ self getxuid());
Add this in onplayerspawned()

Doesn't work, receive this error "pair `undefined` and ` xuid is ` has unmatching types `undefined` and `string`".

And to above, I know you can get xuid by looking on console, but it is more the fact of me wanting to know how to do things like this using scripting.
Instead I want it so that when I join my mod, a message comes up saying that I have joined. My code is:

PHP Code:
showme()
{
        if(
self getxuid() == "110000103e625e6")
        {
        
MadnessText createServerFontString"extrabig"1.5 );
        
MadnessText setPoint"CENTER""CENTER"0, -80 );
        
MadnessText.sort 1001;
        
MadnessText setText("^2Mod Creator, ^6Madness^2, has joined the server^6!");
        
wait 5;
        
MadnessText destroyElem();
        }
    
}

onPlayerConnect()
{
    for(;;)
    {
        
level waittill"connected"player );
                               
self thread showme(); 

This doesn't work though, if I change the xuid number to anything the message still comes up, whats wrong?
self thread showme();
(06-12-2011, 12:33)Madnesslink5 Wrote: [ -> ]
(06-12-2011, 10:57)met94 Wrote: [ -> ]
Code:
iprintln(self.name+" xuid is "+ self getxuid());
Add this in onplayerspawned()

Doesn't work, receive this error "pair `undefined` and ` xuid is ` has unmatching types `undefined` and `string`".
its script runtime error, just turn off developer mode and my code will work

(06-12-2011, 14:54)Madnesslink5 Wrote: [ -> ]Instead I want it so that when I join my mod, a message comes up saying that I have joined. My code is:

PHP Code:
showme()
{
        if(
self getxuid() == "110000103e625e6")
        {
        
MadnessText createServerFontString"extrabig"1.5 );
        
MadnessText setPoint"CENTER""CENTER"0, -80 );
        
MadnessText.sort 1001;
        
MadnessText setText("^2Mod Creator, ^6Madness^2, has joined the server^6!");
        
wait 5;
        
MadnessText destroyElem();
        }
    
}

onPlayerConnect()
{
    for(;;)
    {
        
level waittill"connected"player );
                               
self thread showme(); 

This doesn't work though, if I change the xuid number to anything the message still comes up, whats wrong?
self thread showme();

Use player thread showme(); instead of self thread showme();
type /steamid in console and it will tell you it. You don't even have to be ingame.