insufficient memory error -
legodude - 12.03.2010
i have this error:
Код:
C:\Documents and Settings\Administrator\Mijn documenten\samp server\server\filterscripts\ferry.pwn(47) : fatal error 103: insufficient memory
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Error.
with this code:
Код:
#define FILTERSCRIPT
#include <a_samp>
forward SFleave();
forward BSleave();
new ferry;
new float:x, float:y, float:z;
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Ferry FS by [LD]Legodude");
print("--------------------------------------\n");
SetTimer("BSleave",60000,false);
{
ferry = CreateObject(5154, -2619.0974121094, 1591.0662841797, 0.75, 0, 0, 0);
}
{
CreateObject(16502, -2472.865234375, 2208.8151855469, 3, 0, 0, 270.22497558594);
CreateObject(16502, -2472.8400878906, 2195.4497070313, 3, 0, 0, 89.730041503906);
CreateObject(16502, -2473.03125, 2199.3112792969, -0.75, 0, 0, 89.725341796875);
CreateObject(6189, -2620.6528320313, 1513.111328125, -11.026691436768, 1.9849853515625, 0, 0);
}
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public SFleave();
{
MoveObject(ferry, -2482.6381835938, 2189.7939453125, 0.75, 5.00);
}
public BSleave();
{
MoveObject(ferry, -2619.0974121094, 1591.0662841797, 0.75, 5.00);
}
public OnObjectMoved(objectid)
{
GetObjectPos(objectid, x, y, z);
if
{
(x == -2482.6381835938)
SetTimer("SFleave",60000,false);
}
else
{
SetTimer("BSleave",60000,false);
}
return 1;
}
how to fix it

?
Re: insufficient memory error -
Torran - 12.03.2010
I have 1 and only one thing to say,
Learn to code.
There are ALOT of stuff wrong with your code
Re: insufficient memory error -
aircombat - 12.03.2010
ok as torran said , u have many errors many wrong brackets etc..
Re: insufficient memory error -
shady91 - 12.03.2010
pawn Код:
#define FILTERSCRIPT
#include <a_samp>
forward SFleave();
forward BSleave();
new ferry;
new float:x, float:y, float:z;
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Ferry FS by [LD]Legodude");
print("--------------------------------------\n");
SetTimer("BSleave",60000,false);
ferry = CreateObject(5154, -2619.0974121094, 1591.0662841797, 0.75, 0, 0, 0);
CreateObject(16502, -2472.865234375, 2208.8151855469, 3, 0, 0, 270.22497558594);
CreateObject(16502, -2472.8400878906, 2195.4497070313, 3, 0, 0, 89.730041503906);
CreateObject(16502, -2473.03125, 2199.3112792969, -0.75, 0, 0, 89.725341796875);
CreateObject(6189, -2620.6528320313, 1513.111328125, -11.026691436768, 1.9849853515625, 0, 0);
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
public SFleave();
{
MoveObject(ferry, -2482.6381835938, 2189.7939453125, 0.75, 5.00);
}
public BSleave();
{
MoveObject(ferry, -2619.0974121094, 1591.0662841797, 0.75, 5.00);
}
the part i removed was coded very wrong tell me what you want it to be like were they must be what timer to set and ill show you how it should be.
how to fix it

?
Re: insufficient memory error -
legodude - 14.03.2010
i want it to be like if the object has stopped moving and the coord = -2619.0974121094
then it shud set the timer SFleave
and if the coord = -2482.6381835938
then it shud set the timer BSleave
Re: insufficient memory error -
legodude - 14.03.2010
FIXED!!
i had to do the brackets a bit different indeed
Re: insufficient memory error -
Donny_k - 14.03.2010
OnObjectMoved.
You don't need timers for things like this dude, just compare the id (objectid) with your objects id and then use a toggle (variable).
Example of the callback in use:
pawn Код:
if ( !Arrived ) MoveObject( myObject, ....... //destination
else MoveObject( myObject, ...... //origin
Arrived = !Arrived; //boolean toggle