Little help with include
#1

I'm getting these errors:

Quote:

C:\Users\James\Desktop\Server\gamemodes\gm.pwn(566 4) : error 017: undefined symbol "SkinOffSet"
C:\Users\James\Desktop\Server\gamemodes\gm.pwn(566 4) : warning 215: expression has no effect
C:\Users\James\Desktop\Server\gamemodes\gm.pwn(566 4) : error 001: expected token: ";", but found "]"
C:\Users\James\Desktop\Server\gamemodes\gm.pwn(566 4) : error 029: invalid expression, assumed zero
C:\Users\James\Desktop\Server\gamemodes\gm.pwn(566 4) : fatal error 107: too many error messages on one

Line:
pawn Код:
SetPlayerAttachedObject(playerid, slot, beret, 2, SkinOffSet[skin][0], SkinOffSet[skin][1], SkinOffSet[skin][2], SkinOffSet[skin][3], SkinOffSet[skin][4], SkinOffSet[skin][5]);
Whole function:
pawn Код:
function PutHatOn(playerid)
{
    new skin, id = random(13), beret, slot = GetEmptySlot(playerid), count;
        skin = (GetPlayerSkin(playerid) - 1);
        PInfo[playerid][oslothat] = slot;
        switch(id)
        {
            case 1:     beret = 18926;
            case 2..10: beret = 18926 + id;
            case 11:    beret = 19099;
                case 12:    beret = 18964;//19098
        }
        do
        {
                if(skin == invalidskins[count]) return SendClientMessage(playerid, red, "» "cyellow"Your skin does not support a hat.");
                count++;
        }
        while(count < sizeof invalidskins);
        if(skin < 0) skin = 0;
        SetPlayerAttachedObject(playerid, slot, beret, 2, SkinOffSet[skin][0], SkinOffSet[skin][1], SkinOffSet[skin][2], SkinOffSet[skin][3], SkinOffSet[skin][4], SkinOffSet[skin][5]);
        return 1;
}

I have this included:
[QUOTE]#include <Hatsoffset>[/QUOTE]

In the include I have this:
[url]http://pastebin.com/TRbTPCey[/url]
Reply
#2

Quote:
Originally Posted by ******
Посмотреть сообщение
https://sampforum.blast.hk/showthread.php?tid=289258

Pages 34 and 63.

Also, I love re-reading pawn-lang.pdf, there's always something I didn't know! I just found out about state variables which have no default value!
I've read it, and I still haven't found out a way to fix :l
Reply
#3

Quote:
Originally Posted by ******
Посмотреть сообщение
Did you go by PDF page number or document page number? The latter essentially starts at -1.
Page number.
Reply
#4

I just noticed that I always used the version of 2007 from pawn-lang.pdf ^^"

Also to speed this up

Quote:
Originally Posted by 34
Notice how the two global variables stack and stackidx are declared as "static" variables; using the keyword static instead of new. Doing this makes the global variables "visible" in that file only. For all other files in a larger project, the symbols stack and stackidx are invisible and they cannot (accidentally) modify the variables. It also allows the other modules to declare their own private variables with these names, so it avoids name clashing.
Quote:
Originally Posted by 63
Static global declarations

A static global variable behaves the same as a normal global variable, except that its scope is restricted to the file that the declaration resides in. To declare a global variable as static, replace the keyword new by static.
Reply
#5

Quote:
Originally Posted by ******
Посмотреть сообщение
Or





That doesn't help in the slightest!
Lmao, my bad, I've read the PDF page

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
I just noticed that I always used the version of 2007 from pawn-lang.pdf ^^"

Also to speed this up
I know, I read that too, I made it "new" instead of static, and I still get the same errors.
Edit: Silly me, I forgot to change a thing aswell, thankssssssssssssssssssssssss <3
God damn it, just double posted! -.-
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)