Author Topic: show some stats, need help  (Read 558 times)

0 Members and 1 Guest are viewing this topic.

Offline D_J_S_

  • Major(1)
  • Posts: 45
  • Teamed flag runnerS???
show some stats, need help
« on: December 23, 2007, 07:21:57 pm »
i need help on my script because i cant run my own dedicated server to test scripts, so is this script correct?
Code: [Select]
function OnPlayerCommand(ID: Byte; Text: string): boolean;
begin
    if Text = '/stats' begin
  WriteConsole(ID,('your name is '+inttostr(GetPlayerStat(ID,name)));'duh',;$FFFFFFFF);
  WriteConsole(ID,('your health is '+inttostr(GetPlayerStat(ID,health)));,;$FFFFFFFF);
  WriteConsole(ID,('your vest is '+inttostr(GetPlayerStat(ID,vest)));,;$FFFFFFFF);
  WriteConsole(ID,('your kills are '+inttostr(GetPlayerStat(ID,kills)));,;$FFFFFFFF);
    end;
end;
its supposed to show the player name, health, vest and kills to come up like this for example(if your a hax0r):
your name is happy learner hacker
your health is -9999
your vest is 0
your kills are 23432

thanks.
note: ive only just started scripting yestersay :P
I can't stop playing soldat :(
My in game name: StarShot LightStream
All !commands must !DIEE!!!!!!!!!!!!!!!!

Offline Toumaz

  • Veteran
  • *****
  • Posts: 1906
Re: show some stats, need help
« Reply #1 on: December 23, 2007, 07:26:57 pm »
Proper code should be:

Code: [Select]
function OnPlayerCommand(ID: Byte; Text: string): boolean;
begin
    if Text = '/stats' then begin
        WriteConsole(ID,'your name is '+GetPlayerStat(ID,'name'),$FFFFFFFF);
        WriteConsole(ID,'your health is '+inttostr(GetPlayerStat(ID,'health')),$FFFFFFFF);
        WriteConsole(ID,'your vest is '+inttostr(GetPlayerStat(ID,'vest')),$FFFFFFFF);
        WriteConsole(ID,'your kills are '+inttostr(GetPlayerStat(ID,'kills')),$FFFFFFFF);
    end;
end;

Offline D_J_S_

  • Major(1)
  • Posts: 45
  • Teamed flag runnerS???
Re: show some stats, need help
« Reply #2 on: December 23, 2007, 07:32:47 pm »
ok thanks
I can't stop playing soldat :(
My in game name: StarShot LightStream
All !commands must !DIEE!!!!!!!!!!!!!!!!