SA-MP Forums Archive
Strange Errors - 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: Strange Errors (/showthread.php?tid=464527)



Strange Errors - seanny - 17.09.2013

From what I can see, this piece of code looks perfectly fine:

pawn Код:
stock PlayAnim(playerid, animlib[], animname[], Float:fDelta, loop, lockx, locky, freeze, time, forcesync = 0)//Line 5135
{
    ApplyAnimation(playerid, animlib, animname, fDelta, loop, lockx, locky, freeze, time, forcesync);
    if(loop == 1)
    {
        g_iPlayerUsingLoopingAnim[playerid] = 1;
        TextDrawShowForPlayer(playerid,AnimationTextdraw);
        SetTimerEx("HideAnimText", 5000, false, "i", playerid);
    }
}
But the compiler says otherwise:

Quote:
Originally Posted by Pawn Compiler
C:\Users\Shaun\Desktop\Scripting\Scripting\gamemod es\hrp.pwn(2175) : warning 224: indeterminate array size in "sizeof" expression (symbol "")
C:\Users\Shaun\Desktop\Scripting\Scripting\gamemod es\hrp.pwn(2179) : warning 224: indeterminate array size in "sizeof" expression (symbol "")
C:\Users\Shaun\Desktop\Scripting\Scripting\gamemod es\hrp.pwn(5135) : error 001: expected token: "-string end-", but found "-identifier-"
C:\Users\Shaun\Desktop\Scripting\Scripting\gamemod es\hrp.pwn(5135) : error 029: invalid expression, assumed zero
C:\Users\Shaun\Desktop\Scripting\Scripting\gamemod es\hrp.pwn(5135) : error 010: invalid function or declaration
C:\Users\Shaun\Desktop\Scripting\Scripting\gamemod es\hrp.pwn(5135 -- 5138) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.



Re: Strange Errors - EiresJason - 17.09.2013

Show us the line when you use 'PlayAnim'.


Re: Strange Errors - Konstantinos - 17.09.2013

It's probably something caused by line 5134.


Re: Strange Errors - EiresJason - 17.09.2013

I think it's because he might have used
pawn Код:
sizeof(animlib), sizeof(animname)
wherever he called PlayAnim.


Re: Strange Errors - Konstantinos - 17.09.2013

Quote:
Originally Posted by EiresJason
Посмотреть сообщение
I think it's because he might have used
pawn Код:
sizeof(animlib), sizeof(animname)
wherever he called PlayAnim.
pawn Код:
stock PlayAnim( ...)//Line 5135
pawn Код:
(2175) : warning 224: indeterminate array size in "sizeof" expression (symbol "")
(2179) : warning 224: indeterminate array size in "sizeof" expression (symbol "")
You look at the wrong lines.


Re: Strange Errors - EiresJason - 17.09.2013

Oh yeah; I thought they all were from the same line xD


Re: Strange Errors - seanny - 17.09.2013

Quote:
Originally Posted by EiresJason
Посмотреть сообщение
Show us the line when you use 'PlayAnim'.
pawn Код:
CMD:sit(playerid, params[])
{
    new animid;
    if(sscanf(params,"d",animid)) return SendClientMessage(playerid, COLOR_WHITE, "{33CCFF}USAGE{FFFFFF}: /sit [1-14]");
    switch(animid)
    {
        case 1: PlayAnim(playerid, "BEACH", "bather", 4.0, 1, 0, 0, 0, 0);
        case 2: PlayAnim(playerid, "BEACH", "Lay_Bac_Loop", 4.0, 1, 0, 0, 0, 0);
        case 3: PlayAnim(playerid, "BEACH", "ParkSit_W_loop", 4.0, 1, 0, 0, 0, 0);
        case 4: PlayAnim(playerid, "BEACH", "SitnWait_loop_W", 4.0, 1, 0, 0, 0, 0);
        case 5: PlayAnim(playerid, "BEACH", "ParkSit_M_loop", 4.0, 1, 0, 0, 0, 0);
        case 6: PlayAnim(playerid, "PED", "SEAT_down", 4.0, 0, 1, 1, 1, 0);
        case 7: PlayAnim(playerid, "MISC", "SEAT_LR", 4.0, 0, 1, 1, 1, 0);
        case 8: PlayAnim(playerid, "MISC", "Seat_talk_01", 4.0, 0, 1, 1, 1, 0);
        case 9: PlayAnim(playerid, "MISC", "Seat_talk_02", 4.0, 0, 1, 1, 1, 0);
        case 10: PlayAnim(playerid, "MISC", "SEAT_watch", 4.0, 0, 1, 1, 1, 0);
        case 11: PlayAnim(playerid, "PED", "SEAT_idle", 4.0, 0, 1, 1, 1, 0);
        case 12: PlayAnim(playerid, "PED", "SEAT_up", 4.0, 0, 1, 1, 1, 0);
        case 13: PlayAnim(playerid, "FOOD", "FF_Sit_Eat3", 4.0, 1, 0, 0, 0, 0);
        case 14: PlayAnim(playerid, "FOOD", "FF_Sit_Eat2", 4.0, 1, 0, 0, 0, 0);
        default: SendClientMessage(playerid, COLOR_WHITE, "{33CCFF}USAGE{FFFFFF}: /sit [1-14]");
    }
    return 1;
}

CMD:gesture(playerid, params[])
{
    if(GetPlayerState(playerid) != 1) return SendClientMessage(playerid, COLOR_GREY, "You can only use this animation while on foot.");
    new iAnimID;
    if(sscanf(params, "d", iAnimID))
    {
        SendClientMessage(playerid, COLOR_GRAD1, "{33CCFF}USAGE{FFFFFF}: /gesture [1-15]");
        return 1;
    }
    switch(iAnimID)
    {
        case 1: PlayAnim(playerid, "GHANDS", "gsign1", 4.0, 0, 0, 0, 0, 0, 1);
        case 2: PlayAnim(playerid, "GHANDS", "gsign1LH", 4.0, 0, 0, 0, 0, 0, 1);
        case 3: PlayAnim(playerid, "GHANDS", "gsign2", 4.0, 0, 0, 0, 0, 0, 1);
        case 4: PlayAnim(playerid, "GHANDS", "gsign2LH", 4.0, 0, 0, 0, 0, 0, 1);
        case 5: PlayAnim(playerid, "GHANDS", "gsign3", 4.0, 0, 0, 0, 0, 0, 1);
        case 6: PlayAnim(playerid, "GHANDS", "gsign3LH", 4.0, 0, 0, 0, 0, 0, 1);
        case 7: PlayAnim(playerid, "GHANDS", "gsign4", 4.0, 0, 0, 0, 0, 0, 1);
        case 8: PlayAnim(playerid, "GHANDS", "gsign4LH", 4.0, 0, 0, 0, 0, 0, 1);
        case 9: PlayAnim(playerid, "GHANDS", "gsign5", 4.0, 0, 0, 0, 0, 0, 1);
        case 10: PlayAnim(playerid, "GHANDS", "gsign5", 4.0, 0, 0, 0, 0, 0, 1);
        case 11: PlayAnim(playerid, "GHANDS", "gsign5LH", 4.0, 0, 0, 0, 0, 0, 1);
        case 12: PlayAnim(playerid, "GANGS", "Invite_No", 4.0, 0, 0, 0, 0, 0, 1);
        case 13: PlayAnim(playerid, "GANGS", "Invite_Yes", 4.0, 0, 0, 0, 0, 0, 1);
        case 14: PlayAnim(playerid, "GANGS", "prtial_gngtlkD", 4.0, 0, 0, 0, 0, 0, 1);
        case 15: PlayAnim(playerid, "GANGS", "smkcig_prtl", 4.0, 0, 0, 0, 0, 0, 1);
        default: SendClientMessage(playerid, COLOR_GRAD1, "{33CCFF}USAGE{FFFFFF}: /gesture [1-15]");
    }
    return 1;
}

CMD:rap(playerid, params[])
{
    if(GetPlayerState(playerid) != 1) return SendClientMessage(playerid, COLOR_GREY, "You can only use this animation while on foot.");
    new iAnimID;
    if(sscanf(params, "d", iAnimID))
    {
        SendClientMessage(playerid, COLOR_GRAD1, "{33CCFF}USAGE{FFFFFF}: /rap [1-3]");
        return 1;
    }
    switch(iAnimID)
    {
        case 1: PlayAnim(playerid, "RAPPING", "RAP_A_Loop", 4.0, 1, 0, 0, 0, 0, 1);
        case 2: PlayAnim(playerid, "RAPPING", "RAP_B_Loop", 4.0, 1, 0, 0, 0, 0, 1);
        case 3: PlayAnim(playerid, "RAPPING", "RAP_C_Loop", 4.0, 1, 0, 0, 0, 0, 1);
        default: SendClientMessage(playerid, COLOR_GRAD1, "{33CCFF}USAGE{FFFFFF}: /rap [1-3]");
    }
    return 1;
}

CMD:facepalm(playerid, params[])
{
    PlayAnim(playerid, "MISC", "plyr_shkhead",4.1,0,1,1,0,0);
    return 1;
}

CMD:bomb(playerid, params[])
{
    if(GetPlayerState(playerid) != 1) return SendClientMessage(playerid, COLOR_LIGHTRED, "* You can only use this animation while on foot.");
    ClearAnimations(playerid);
    PlayAnim(playerid, "BOMBER", "BOM_Plant", 4.0, 0, 0, 0, 0, 0); // Place Bomb
    return 1;
}



Re: Strange Errors - EiresJason - 17.09.2013

I'm not really sure; it works on mine when i compile it.

Maybe your g_iPlayerUsingLoopingAnim is causing the problem.


Re: Strange Errors - seanny - 17.09.2013

So I'm guessing that it is compiler stupidity?


Re: Strange Errors - Konstantinos - 17.09.2013

Quote:
Originally Posted by seanny
Посмотреть сообщение
So I'm guessing that it is compiler stupidity?
Nope.

About the warning 224: indeterminate array size in "sizeof" expression (symbol "")

When the parameter is array [] and you do sizeof, the compiler gives the warning.

Show us the lines 2175, 2179 which shows the warnings to solve them.

Also show us the lines 5134 - 5139 which is the rest of the errors.