How can I output the player name?

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Pvt.Mapper

How can I output the player name?

Post by Pvt.Mapper »

Hi.
I'm making class system in MOHAA.

it's use a "local.myclass = #", 1 = soldier, 2 = Medic, 3 = engineer...

so it must print the name and class.

iprintlnbold_noloc "****(player name) be the Medic."

maybe it 's "local.player.name", but cant output my name...

HELP!! :(
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

player numbers

Post by tltrude »

Have you tried using $player1, $player2, etc..? For multiplay it might be $allied.player1 or $axis.player1. Try looking at the console during a multiplayer game and ask someone to type a message. Good luck.
Tom Trude,

Image
obersturmfuhrer
Lance Corporal
Posts: 13
Joined: Sun Jul 07, 2002 12:50 pm
Location: Orlando, Florida & Augsburg, Germany
Contact:

Post by obersturmfuhrer »

I think I fiqured it out but I havent tried it:

$player.name
Oops, I threw the pin instead of the grenade!
Author of "The Last Castle" map
ScorpioMidget
Lance Corporal
Posts: 21
Joined: Thu Jun 13, 2002 9:57 am
Location: Notts, UK
Contact:

Post by ScorpioMidget »

Did u ever get this sorted out ?

Coz i've tried numerous ways to do it, but had no luck so far.
ScorpioMidget
Still has a soft spot for Mohaa.
obersturmfuhrer
Lance Corporal
Posts: 13
Joined: Sun Jul 07, 2002 12:50 pm
Location: Orlando, Florida & Augsburg, Germany
Contact:

Post by obersturmfuhrer »

Duncan,
I haven't even tried it yet. I've been busy working on the geometry for my new map. I'll try it tonight and see what I come up with and let ya know.
Oops, I threw the pin instead of the grenade!
Author of "The Last Castle" map
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

I think the following will work to find out the current player's name, but I don't know how to output the name of an other player on a server:

local.playername = getcvar(name)

This line of code inputs the in-game 'name' variable.
ScorpioMidget
Lance Corporal
Posts: 21
Joined: Thu Jun 13, 2002 9:57 am
Location: Notts, UK
Contact:

Post by ScorpioMidget »

i tried that ages ago but it only returns the name of the player on the server :-(
ScorpioMidget
Still has a soft spot for Mohaa.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

I'm afraid it's not really helpful either, but anyway. I tried some things with MOHAA and will found out that if you type

rcon status

in your console that you can get a list of player names, scores etc. But you must know and set the rcon password first. Sadly, I don't think you could use any 'getcvar' tricks on it to put a player's name to a variable.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Why can't I edit my posts on this forum? Just found out I made some grammar error. :( :)
Post Reply