SA-MP Forums Archive
Compiling my script doesn't show any output - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Compiling my script doesn't show any output (/showthread.php?tid=568454)



Compiling my script doesn't show any output - Sellize - 22.03.2015

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




Re: Compiling my script doesn't show any output - CalvinC - 22.03.2015

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


Re: Compiling my script doesn't show any output - Gammix - 22.03.2015

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


Re: Compiling my script doesn't show any output - Sellize - 22.03.2015

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


Re: Compiling my script doesn't show any output - fuckingcruse - 22.03.2015

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


Re: Compiling my script doesn't show any output - CalvinC - 22.03.2015

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.


Re: Compiling my script doesn't show any output - Sellize - 22.03.2015

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.


Re: Compiling my script doesn't show any output - Evocator - 22.03.2015

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;
}



Re: Compiling my script doesn't show any output - Sellize - 23.03.2015

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.


Re: Compiling my script doesn't show any output - De4dpOol - 23.03.2015

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