PDA

View Full Version : Question Name stealer, nbsp



The Acid
12-02-2009, 05:42 AM
Im trying to steal the names of the other players on the server, the code works fine but I need some help with adding a non-breaking space at the end of the name instead of a dot. Simply compiling with the character already there will give me an ugly square after my name.


if (cVarMan.var_namestealer == 1)
{
// Get the player info of the current target.
Hook.Engine->GetPlayerInfo(index, &pinfo);

// The StrFormat is just a macro to make the handling of strings simpler.
Hook.Engine->ClientCmd(Hook.Useful->StrFormat("name \"%s.\"\n", pi.name));
}

Basicly this takes the name of the player I want to steal, changes my name to his and adds a dot at the end. I want to avoid the dot and add a nbsp at the end (ALT + 255).

The problem is that I am not sure on how to add a nbsp to a string in C++, so I was hoping (I know) that someone here have a bit more knowledge of C/C++ than me, who could help.

Its probaly simple and im just retarded and can't figure it out :eek2:

Wille
12-02-2009, 07:40 AM
Probably something like \x255

The Acid
12-02-2009, 08:25 AM
I am using your method with the \x255 (\xff in C++) and I still get the square instead of an invisible character, it works fine if I print it in a console, but not as a name.

D3D8
12-02-2009, 09:12 AM
I believe ~ ~~ still works in source engine.

Wille
12-02-2009, 09:32 AM
Oh, yeah of course \xff. :)

DontBitch
12-02-2009, 09:45 AM
I am using your method with the \x255 (\xff in C++) and I still get the square instead of an invisible character, it works fine if I print it in a console, but not as a name.

yah, me too. done month ago some trys and i got the squares too. i also tried to get some letters like "ö" and "ü" on my menu to draw but again just squares. it fails at the ClientCMD, too. so fail on autosay, too.

syntroniks
12-02-2009, 09:51 AM
0x07 does not print for me on steam, although I am running XP without any fancy language packs. I hear the situation is different for newer/more fully featured computers.

% % may work as well

The Acid
12-02-2009, 10:24 AM
I believe ~ ~~ still works in source engine.

That just gives you the (1) infront of the name, already tried :)



% % may work as well

Same as above.

syntroniks
12-02-2009, 10:38 AM
Well I have one more suggestion for you, see if you can (instead of execing name "name") use setinfo name instead. good luck

DontBitch
12-02-2009, 10:57 AM
That just gives you the (1) infront of the name, already tried :)


Nop. That works. Doing it since years like this. But still want it to do with 0xff or smth like that.

Poumix
12-02-2009, 11:01 AM
\xA0

DontBitch
12-02-2009, 11:07 AM
\xA0

i THINK i tried this aswell but it didnt work. but maybe i am remembering it wrong. do you know if this works or did you gave us just an other sign for the space sign which is not rly hard to find?

D3D8
12-02-2009, 11:28 AM
That just gives you the (1) infront of the name, already tried :)




Same as above.
That is weird because after I posted that I tried it and it worked fine for me...I played for almost 2 hours and it was blank everytime I used a namestealer.

wav
12-02-2009, 11:34 AM
\xC2\xA0

The Acid
12-02-2009, 11:35 AM
That is weird because after I posted that I tried it and it worked fine for me...I played for almost 2 hours and it was blank everytime I used a namestealer.

Im using ~ ~~ and its working now, I don't know what the problem was but a retry and it worked :D

syntroniks
12-02-2009, 03:02 PM
\xC2\xA0

Whatever that happens to be, I'll try it - thanks

DontBitch
12-02-2009, 03:19 PM
did a little quick test with \xA0 but came again a sqaure on the menu. but didnt try further.

WaRPiG
12-02-2009, 06:49 PM
Try whatever Alt + 0160 comes out to. I dont know the \x04 shit... so... yea. Or listen to wav, he seems to know more...

sb
12-03-2009, 04:55 AM
When I was still using a namestealer I had alt+255 just in an ASCII form which seemed to work fine, not sure if it still does though

DontBitch
12-03-2009, 08:19 AM
When I was still using a namestealer I had alt+255 just in an ASCII form which seemed to work fine, not sure if it still does though

they all does BUT only if you typ that manually into the console or playername field. but its not working if you draw something or send something with alt+255 or \xA0 or whatever ....

sb
12-04-2009, 05:11 AM
they all does BUT only if you typ that manually into the console or playername field. but its not working if you draw something or send something with alt+255 or \xA0 or whatever ....

Nope, it worked fine in a coded namestealer. Again, I'm not sure if it works any more. I remember the only issue with my old namestealer was that it changed name too often, and the engine would start delaying the changes after a while