Hello There, Guest! Login or Register


I could use some help
#1
Hi,

As I'm a beginning scripter, I just wanted to try to make an object move with a cmd, well I tried to script it, but it keeps giving me errors. And I can't find where I'm wrong.

Code:
// Credits goto Matthias Van Eeghem aka GTA_Rules
// DO NOT Edit or release without permission

#include <a_samp>
#define FILTERSCRIPT
#if defined FILTERSCRIPT
new Pirateship;

public OnFilterScriptInit()
{
        print("\n--------------------------------------");
        print(" [FS] Pirateship by Matthias");
        print("--------------------------------------\n");
        Pirateship = CreateObject(8493, 1908.9828, 543.4374, -0.4981,8, 0.0000, 0.0000, 0.0000);
        return 1;
}

public OnFilterScriptExit()
{
        return 1;
}

#else
#endif

public OnPlayerCommandText(playerid, cmdtext[])
{
        if (strcmp(cmdtext, "/shipup", true)==0)
       {
      MoveObject (Pirateship,1908.9828, 543.4374, -0.4981,8,0.5);
      SendClientMessage(playerid, 0x000000F, "Ship going up");
      return 1;
       }
          return 0;
}

It keeps giving me these errors:

Code:
C:\Users\Matthias\Desktop\ship.pwn(14) : warning 202: number of arguments does not match definition
C:\Users\Matthias\Desktop\ship.pwn(30) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664              Copyright (c) 1997-2006, ITB CompuPhase


2 Warnings.

I hope somebody can help me.

Thanks

bye : w
Reply
#2
Line 14:
Code:
Pirateship = CreateObject(8493, 1908.9828, 543.4374, -0.4981,8, 0.0000, 0.0000, 0.0000);

CreateObject has 7 parameters. Presuming the 5th parameter, "8" is a mistake, try:

Code:
Pirateship = CreateObject(8493, 1908.9828, 543.4374, -0.4981, 0.0000, 0.0000, 0.0000);

Line 30:

MoveObject (Pirateship,1908.9828, 543.4374, -0.4981,8,0.5);

Again, with the MoveObject statement, there appears to be an extra param in there, being 8. MoveObject only has 5 params. Presuming its another mistake, remove the 8 and it's fixed ;)
Reply
#3
Thanks Jay it worked indeed :), ty for your help
Reply
#4
I would just like to add that if you want to add and see your objects ingame you will need to create a filterscript to add/delete objects from you server.
Reply
#5
(01-29-2009, 11:57 PM)Philip link Wrote: I would just like to add that if you want to add and see your objects ingame you will need to create a filterscript to add/delete objects from you server.

Why are you stating the obvious?

Thats like saying "At night its dark"
Reply
#6
(01-29-2009, 11:57 PM)Philip link Wrote: I would just like to add that if you want to add and see your objects ingame you will need to create a filterscript to add/delete objects from you server.
Thanks but I knew that xD
Reply