error 017: undefined symbol "bf1"
#1

well guys i'm sorry im requesting alot of scripting helps recently but who doesn't make mistakes.

my error is
Код:
E:\GAMES\Omar\SA-MP Tools & Servers\SA-MP Servers\being\filterscripts\Untitledtesting.pwn(208) : error 017: undefined symbol "bf1"
E:\GAMES\Omar\SA-MP Tools & Servers\SA-MP Servers\being\filterscripts\Untitledtesting.pwn(218) : warning 217: loose indentation
E:\GAMES\Omar\SA-MP Tools & Servers\SA-MP Servers\being\filterscripts\Untitledtesting.pwn(218) : error 017: undefined symbol "bf12"
line 208

pawn Код:
if(pickupid == bf1 || pickupid == bf2 ||
line 218

pawn Код:
if(pickupid == bf12) return SetPlayerAttachedObject(playerid, 1, 1210, 1, Float:42, Float:913, Float:0, Float:0, Float:0, Float:0, Float:52, Float:0, Float:0, 0, 0);
it says undefined symbol "bf12" and "bf1" and yes i did

pawn Код:
new bf1;
          new bf12;
and when i do
pawn Код:
#define bf1
                             #define bf12
nothing happens aswell. please i need help

thanks in advance
Reply
#2

its
pawn Код:
new bf1,bf2;
not a define!

Also make sure they are public and outside of any callback or if you only need them in the callback then above the first usage of the pickup
Reply
#3

i'm doing

pawn Код:
new bf1;
new bf2;
new bf3;
new bf4;
new bf5;
new bf6;
new bf7;
new bf8;
new bf9;
new bf10;
new bf11;
new bf12;
new bf13;
new bf14;
new bf15;
new bf16;
new bf17;
new bf18;
new bf19;
on top if the
PHP код:
public OnFilterScriptInit() 
and i couldn't understand what your saying please sir help me.
Reply
#4

If you haven't defined them globally then you're doing it wrong. I was reading your problem and I saw the conditional check you posted:
pawn Код:
if(pickupid == bf1 || pickupid == bf2 ||
Which must be:
pawn Код:
if((pickupid == bf1) || (pickupid == bf2))
I also saw another thing you posted:
pawn Код:
if(pickupid == bf12) return SetPlayerAttachedObject(playerid, 1, 1210, 1, Float:42, Float:913, Float:0, Float:0, Float:0, Float:0, Float:52, Float:0, Float:0, 0, 0);
I am not really sure why you are adding the "Float:" with numbers. Are you making a library? Anyway if you aren't then you should be doing this:
pawn Код:
SetPlayerAttachedObject(playerid, 1, 1210, 1, 42, 913, 0, 0, 0, 0, 52, 0, 0, 0, 0);
Reply
#5

no ACI it didn't work it gave me another errors

here is all my OnPlayerPickupPickup(playerid, pickupid)

pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{

if(pickupid == bf1 || pickupid == bf2 ||
       pickupid == bf3 || pickupid == bf4 ||
       pickupid == bf5 || pickupid == bf6 ||
       pickupid == bf7 || pickupid == bf8 ||
       pickupid == bf9 || pickupid == bf10||
       pickupid == bf11 || pickupid == bf13 ||
       pickupid == bf14 || pickupid == bf15 ||
       pickupid == bf16 || pickupid == bf17 ||
       pickupid == bf18 || pickupid == bf19) return SetPlayerAttachedObject(playerid, 1, 1210, 1, Float:0, Float:450, Float:0, Float:0, Float:0, Float:0, Float:0, Float:0, Float:0, 0, 0);

    if(pickupid == bf12) return SetPlayerAttachedObject(playerid, 1, 1210, 1, Float:0, Float:450, Float:0, Float:0, Float:0, Float:0, Float:0, Float:0, Float:0, 0, 0);

    return 1;
}
and the Floats doesn't give errors so no problem in Floats
Reply
#6

Try using an array instead of doing that.

pawn Код:
new gPI[20];
Note that if you set the number of elements to 19, then the actual image in the memory will be 18 slots. So for 20 will be 19 slots.
Reply
#7

i can't understand what you're saying
what
pawn Код:
new gP|[20];
to do with anything ?
Reply
#8

I am saying you to create an array with any name. I gave you an example "gPI" with 20 elements. You can use them instead of the 19 variables you created.

I can show you a example (not tested):
pawn Код:
main()
{
    new ACI[20]; // It has 20 slots. (Counting from 0 to 19)
    ACI[5] = 9;   // Set the fifth slot (OR row for having a basic concept) to hold a number 9
    if(ACI[5] == 9) // If ACI with with row or slot 5 is holding 9 then:
        print("ACI[5] is 9");
}
Reply
#9

ACI i did it but it adds nothing like i didn't did anything anyone please help ?
Reply
#10

Quote:
Originally Posted by Omar55555
Посмотреть сообщение
i'm doing

pawn Код:
new bf1;
new bf2;
new bf3;
new bf4;
new bf5;
new bf6;
new bf7;
new bf8;
new bf9;
new bf10;
new bf11;
new bf12;
new bf13;
new bf14;
new bf15;
new bf16;
new bf17;
new bf18;
new bf19;
on top if the
PHP код:
public OnFilterScriptInit() 
and i couldn't understand what your saying please sir help me.
If I understand correctly, you've created these variables INSIDE OnFilterScriptInit()?
Like this?
pawn Код:
public OnFilterScriptInit()
{
    new bf1;
    new bf2;
    new bf3;
    new bf4;
    new bf5;
    new bf6;
    new bf7;
    new bf8;
    new bf9;
    new bf10;
    new bf11;
    new bf12;
    new bf13;
    new bf14;
    new bf15;
    new bf16;
    new bf17;
    new bf18;
    new bf19;
}
If you did that, those variables only exist for OnFilterScriptInit.
When the script has finished loading, the function has been executed and exited and those variables are destroyed.
Put them outside the function.
pawn Код:
new bf1;
new bf2;
new bf3;
new bf4;
new bf5;
new bf6;
new bf7;
new bf8;
new bf9;
new bf10;
new bf11;
new bf12;
new bf13;
new bf14;
new bf15;
new bf16;
new bf17;
new bf18;
new bf19;

public OnFilterScriptInit()
{
    // Other code here
}
And as suggested, this is a horrible way to use them.
Just create an array
pawn Код:
new bf[20];
Then you can access them like this:
pawn Код:
if(pickupid == bf[12]) return SetPlayerAttachedObject(playerid, 1, 1210, 1, Float:42, Float:913, Float:0, Float:0, Float:0, Float:0, Float:52, Float:0, Float:0, 0, 0);
It would be easier to add new values in case you need more.
If you wanna go to 100 of those, you need to add 80 new variables. That's a lot.
With the array, you only need to increase the number between the [] from 20 to 100 and you're done.
Reply


Forum Jump:


Users browsing this thread: