Compiling my script doesn't show any output
#1

When I compile it freezes for a few seconds and then it shows this

Reply
#2

What were you doing before trying to compile it?
There might be something wrong with that script.
Reply
#3

I will link to my previous post which maybe an appropriate answer to this.
http://forum.sa-mp.com/showpost.php?...93&postcount=6
Reply
#4

Quote:
Originally Posted by CalvinC
Посмотреть сообщение
What were you doing before trying to compile it?
There might be something wrong with that script.
This has been happening just after I started working on a moneybag system, this is what I added:

http://pastebin.com/p7jDnDCn

I also added a moneybag variable to my players enum to save it with y_ini but there can't be anything wrong with that since I did them all the same and they work fine
Reply
#5

It doesn't stuck , if your script has more coding , then it takes time for reading and giving out the result , compliling
Reply
#6

pawn Код:
forward createMBag(x, y, z, position[]);
public createMBag();
Should be
pawn Код:
forward createMBag(Float:x, Float:y, Float:z, position[]);
public createMBag(Float:x, Float:y, Float:z, position[])
First, you didn't add parameters to the public, only the forward.
Second, you need to use floats for coordinates, or numbers that has decimals, and as well i removed the semicolon.

EDIT: Same with the MoneyBag public you created, remove the semicolon, only the forward needs it.
Reply
#7

Quote:
Originally Posted by CalvinC
Посмотреть сообщение
pawn Код:
forward createMBag(x, y, z, position[]);
public createMBag();
Should be
pawn Код:
forward createMBag(Float:x, Float:y, Float:z, position[]);
public createMBag(Float:x, Float:y, Float:z, position[])
First, you didn't add parameters to the public, only the forward.
Second, you need to use floats for coordinates, or numbers that has decimals, and as well i removed the semicolon.

EDIT: Same with the MoneyBag public you created, remove the semicolon, only the forward needs it.
I thought that was the problem when I read your reply, but after I fixed it it still won't compile.
Reply
#8

Many problems:

Код:
new mBag = 0;
new mBagLoc[50] = "Nowhere";
new mBagPickup;
 
public OnGameModeInit()
{
    Moneybag();
    return 1;
}
 
forward Moneybag();
public Moneybag()
{
    new 
        pos = random(42)
    ;

    if (pos <= 5)
    { 
        switch (pos)
        {
            case 0: createMBag(265.6487,2561.8484,16.3672, "Abandoned Airport");
            case 1: createMBag(185.7434,2548.7910,16.5096, "Abandoned Airport");
        }
    }
    return 1;
}
 
forward createMBag(x, y, z, position[]);
public createMBag(x, y, z, position[])
{
    new string[128];
    mBagPickup = CreatePickup(1550, 2, x, y, z, 0);
    strmid(mBagLoc, position, 0, strlen(position), sizeof (position));
    format(string, sizeof(string), "{3B7A57}[{A4C639}MoneyBag{3B7A57}] {568203}The moneybag has been hidden at {87A96B}%s{568203}! Find it for a reward.", mBagLoc);
    return 1;
}
Reply
#9

Quote:
Originally Posted by Ralfie
Посмотреть сообщение
Many problems:

Код:
new mBag = 0;
new mBagLoc[50] = "Nowhere";
new mBagPickup;
 
public OnGameModeInit()
{
    Moneybag();
    return 1;
}
 
forward Moneybag();
public Moneybag()
{
    new 
        pos = random(42)
    ;

    if (pos <= 5)
    { 
        switch (pos)
        {
            case 0: createMBag(265.6487,2561.8484,16.3672, "Abandoned Airport");
            case 1: createMBag(185.7434,2548.7910,16.5096, "Abandoned Airport");
        }
    }
    return 1;
}
 
forward createMBag(x, y, z, position[]);
public createMBag(x, y, z, position[])
{
    new string[128];
    mBagPickup = CreatePickup(1550, 2, x, y, z, 0);
    strmid(mBagLoc, position, 0, strlen(position), sizeof (position));
    format(string, sizeof(string), "{3B7A57}[{A4C639}MoneyBag{3B7A57}] {568203}The moneybag has been hidden at {87A96B}%s{568203}! Find it for a reward.", mBagLoc);
    return 1;
}
Most things you pointed out are just things to simplify my code and do not fix any errors that haven't been shown before.

That being said, the script still doesn't compile.
Reply
#10

Increase the length of string. It happened to me before because of this. However, there can be other things causing this.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)