Author Topic: PlayerDir();  (Read 2339 times)

0 Members and 1 Guest are viewing this topic.

Offline ghg

  • Camper
  • ***
  • Posts: 411
  • Village Idiot
PlayerDir();
« on: February 13, 2008, 11:29:21 am »
Script Name: PlayerDir();
Script Description:
A incredibly simple function to return the player direction as an integer to allow for movement calculations etc.
Inspired by: http://forums.soldat.pl/index.php?topic=24320.0
It isn't anything diffult to code or essential but it was the first working function I've made so far.
Original Author(s): ghg/Gradius, inspired by Avarax (obviously I don't give a damn what you do with it due to it's simplicity)
Core Version: 263
Code:

Code: [Select]
function PlayerDir(ID: Byte): integer;
begin
 if(GetPlayerStat(ID,'Direction')='>') then begin
  Result := 1;
 end else begin
  Result := -1;
 end;
end;
-=Gradius wuz you=-

Offline xmRipper

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 742
    • Personal
Re: PlayerDir();
« Reply #1 on: February 14, 2008, 06:22:05 am »
Simple script.
Co-Founder / CTO @ Macellan
Founder Turkish Soldat Community

Offline Boblekonvolutt

  • Soldier
  • **
  • Posts: 222
  • "YOU are a CAR."
Re: PlayerDir();
« Reply #2 on: February 14, 2008, 07:57:23 am »
Good things come in small packages.

Oh yeah, you don't really have to have begin/end for that, you could do
Code: [Select]
function PlayerDir(ID: Byte): Integer;
begin
  if GetPlayerStat(ID, 'Direction') = '>' then
    Result := 1
  else
    Result := -1;
end;

Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: PlayerDir();
« Reply #3 on: February 14, 2008, 08:28:33 am »
Thats just logic, not really worth posting unless you think scripters were born with brain damage

Offline chutem

  • Veteran
  • *****
  • Posts: 1119
Re: PlayerDir();
« Reply #4 on: February 15, 2008, 03:32:01 am »
^^ damn you're harsh...
1NK3FbdNtH6jNH4dc1fzuvd4ruVdMQABvs

Offline ghg

  • Camper
  • ***
  • Posts: 411
  • Village Idiot
Re: PlayerDir();
« Reply #5 on: February 15, 2008, 08:55:49 am »
It's true. I'm not really bothered either way.
-=Gradius wuz you=-

Offline Boblekonvolutt

  • Soldier
  • **
  • Posts: 222
  • "YOU are a CAR."
Re: PlayerDir();
« Reply #6 on: February 15, 2008, 09:41:11 am »
So it's settled then, you think all scripters were born with brain damage? :D

But really, there's should be a sticky or something where people could post short stuff like this.

Offline danmer

  • Camper
  • ***
  • Posts: 466
  • crabhead
Re: PlayerDir();
« Reply #7 on: February 16, 2008, 04:28:32 am »
So it's settled then, you think all scripters were born with brain damage? :D

But really, there's should be a sticky or something where people could post short stuff like this.
the problem is that people who need this will come up with it in seconds. And people who can't come up with it either don't need it, or won't be able to use it properly anyway [retard]

Offline Boblekonvolutt

  • Soldier
  • **
  • Posts: 222
  • "YOU are a CAR."
Re: PlayerDir();
« Reply #8 on: February 16, 2008, 09:02:06 pm »
And then there are people who just haven't thought of it...