Author Topic: Player name into Console.  (Read 761 times)

0 Members and 1 Guest are viewing this topic.

Offline BRADEN

  • Camper
  • ***
  • Posts: 319
Player name into Console.
« on: June 07, 2008, 03:09:13 pm »
So let's say for example on the tenth kill of each player, his name appears in the console. But how do I get the player name and put it in the console text? Obviously the code below doesn't work, but shows you what I want to do.

WriteConsole(0,'(GetPlayerStat(Killer,'name')) is PWNING!',$EEFFFFFF)
« Last Edit: June 07, 2008, 03:11:55 pm by BRADEN »

Death is the solution to all problems. No man; no problem.
-Joseph Stalin

Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: Player name into Console.
« Reply #1 on: June 07, 2008, 03:29:51 pm »
WriteConsole(0,GetPlayerStat(Killer,'name')+' is PWNING!',$EEFFFFFF)

You use '+ and +' to indicate a break in your string input.

Offline CurryWurst

  • Camper
  • ***
  • Posts: 265
    • Soldat Global Account System
Re: Player name into Console.
« Reply #2 on: June 07, 2008, 03:44:52 pm »
Try this code:

WriteConsole(0, GetPlayerStat(Killer,'Name') + ' is PWNING!', $EEFFFFFF);

Note:
-------

Only use single quotation marks if the enlcosed content is presentable as string.

Be sure that you're using a suitable procedure or rather function for this code, otherwise you will get a compile error.
For example this one:

procedure OnPlayerKill(Killer, Victim: byte;Weapon: string);
Soldat Global Account System: #soldat.sgas @ quakenet

Offline BRADEN

  • Camper
  • ***
  • Posts: 319
Re: Player name into Console.
« Reply #3 on: June 07, 2008, 04:04:44 pm »
Thanks a lot you guys. :)

Death is the solution to all problems. No man; no problem.
-Joseph Stalin