Author Topic: Spawning objects, what am I doing wrong?  (Read 741 times)

0 Members and 1 Guest are viewing this topic.

Offline Live4Pie

  • Major(1)
  • Posts: 2
Spawning objects, what am I doing wrong?
« on: December 01, 2007, 04:17:13 pm »
Hi, I've been having difficulty spawning a predator pack near the the player when he types in '/stealth'

Here's my code so far :

function OnPlayerCommand(ID: Byte; Text: string): boolean;
begin
Result := false;
if Text = '/stealth' then
   begin
   SpawnObject(GetPlayerStat(ID,'x'),GetPlayerStat(ID,'y'),20);
   WriteConsole(ID,'Stealth mode acquired',$EE81FAA1);
   end
else
   begin
   WriteConsole(ID,'Unrecognized command',$EE81FAA1);
   end;
end;

When I type in /stealth, I receive the confirmation message, yet no predator pack.

Any help would be appreciated.
« Last Edit: December 01, 2007, 08:49:31 pm by Live4Pie »
There are three types of people in the world : those who can count and those who can't.

Offline urraka

  • Soldat Developer
  • Flagrunner
  • ******
  • Posts: 703
Re: Spawning objects, what am I doing wrong?
« Reply #1 on: December 01, 2007, 04:36:20 pm »
Replace GetPlayerStat(1, with GetPlayerStat(ID,
urraka

Offline Live4Pie

  • Major(1)
  • Posts: 2
Re: Spawning objects, what am I doing wrong?
« Reply #2 on: December 01, 2007, 05:15:18 pm »
Ty for the input. However, the kit still won't spawn, even after the modifications.
I updated the code up top for the change you reccomended.

There are three types of people in the world : those who can count and those who can't.