array index out of bounds (variable "pInfo")
#1

Hello dear samp members. I need some help with falowing code and errors..

pawn Код:
(1134) : error 008: must be a constant expression; assumed zero
(1140 -- 1141) : error 032: array index out of bounds (variable "pInfo")
(1146) : error 032: array index out of bounds (variable "pInfo")
pawn Код:
public OnPlayerEditAttachedObject( playerid, response, pInfo[playerid][indextoy], pInfo[playerid][modelidtoy], pInfo[playerid][boneid],
                                   pInfo[playerid][fOffsetX], pInfo[playerid][fOffsetY], pInfo[playerid][fOffsetZ],
                                   pInfo[playerid][fRotX], pInfo[playerid][fRotY], pInfo[playerid][fRotZ],
                                   pInfo[playerid][fScaleX], pInfo[playerid][fScaleY], pInfo[playerid][fScaleZ] )//THIS LINE!!!!!!!
{
    new debug_string[256+1];
    format(debug_string,256,"SetPlayerAttachedObject(playerid,%d,%d,%d,%f,%f,%f,%f,%f,%f,%f,%f,%f)",//THIS LINE!!!
        pInfo[playerid][indextoy],pInfo[playerid][modelidtoy],pInfo[playerid][boneid],pInfo[playerid][fOffsetX],pInfo[playerid][fOffsetY],pInfo[playerid][fOffsetZ],pInfo[playerid][fRotX],pInfo[playerid][fRotY],pInfo[playerid][fRotZ],pInfo[playerid][fScaleX],pInfo[playerid][fScaleY],pInfo[playerid][fScaleZ]);//THIS LINE!!!!

    print(debug_string);
    //SendClientMessage(playerid, 0xFFFFFFFF, debug_string);

    SetPlayerAttachedObject(playerid,pInfo[playerid][indextoy],pInfo[playerid][modelidtoy],
    pInfo[playerid][boneid],pInfo[playerid][fOffsetX],pInfo[playerid][fOffsetY],
    pInfo[playerid][fOffsetZ],pInfo[playerid][fRotX],pInfo[playerid][fRotY],pInfo[playerid][fRotZ],
    pInfo[playerid][fScaleX],pInfo[playerid][fScaleY],pInfo[playerid][fScaleZ]);
    SendClientMessage(playerid, 0xFFFFFFFF, "You finished editing an attached object"); //THIS LINE

    return 1;
}
Thank you for your help with best regards Scrillex.
Reply
#2

What the hell is this? You're not supposed to replace any function headers ...
Reply
#3

Yeah I thought is it possible to set it to...

pInfo[playerid][fScaleY] = fScaleY;
Reply
#4

Not with the actual function headers, set them inside the function.
Reply
#5

pawn Код:
public OnPlayerEditAttachedObject( playerid, response, index, modelid, boneid,
                                   Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ,
                                   Float:fRotX, Float:fRotY, Float:fRotZ,
                                   Float:fScaleX, Float:fScaleY, Float:fScaleZ)
{
    new debug_string[256+1];
    format(debug_string,256,"SetPlayerAttachedObject(playerid,%d,%d,%d,%f,%f,%f,%f,%f,%f,%f,%f,%f)",
        pInfo[playerid][indextoy],pInfo[playerid][modelidtoy],pInfo[playerid][boneidtoy],pInfo[playerid][fOffsetXx],pInfo[playerid][fOffsetYy],pInfo[playerid][fOffsetZz],pInfo[playerid][fRotXx],pInfo[playerid][fRotYy],pInfo[playerid][fRotZz],pInfo[playerid][fScaleXx],pInfo[playerid][fScaleYy],pInfo[playerid][fScaleZz]);

    print(debug_string);
    //SendClientMessage(playerid, 0xFFFFFFFF, debug_string);

    SetPlayerAttachedObject(playerid,pInfo[playerid][indextoy],pInfo[playerid][modelidtoy],
    pInfo[playerid][boneidtoy],pInfo[playerid][fOffsetXx],pInfo[playerid][fOffsetYy],
    pInfo[playerid][fOffsetZz],pInfo[playerid][fRotXx],pInfo[playerid][fRotYy],pInfo[playerid][fRotZz],
    pInfo[playerid][fScaleXx],pInfo[playerid][fScaleYy],pInfo[playerid][fScaleZz]);
    SendClientMessage(playerid, 0xFFFFFFFF, "You finished editing an attached object");

    return 1;
}
Now what I need to do is make thease function to pInfo right :
pawn Код:
index, modelid, boneid,
Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ,
Float:fRotX, Float:fRotY, Float:fRotZ,
Float:fScaleX, Float:fScaleY, Float:fScaleZ
Reply
#6

Now everything works.. but I cant edit slot ..... Maybe some one can help me.. Used attachment filter script... Help me out pls.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)