furniture problem
#1

i got this 2 debugs when i use the furniture system (V1 from sa-mp.com)

pawn Код:
[21:20:11] [debug] Run time error 4: "Array index out of bounds"
[21:20:11] [debug]  Accessing element at index 3092 past array upper bound 99
[21:20:11] [debug] AMX backtrace:
[21:20:11] [debug] #0 000cbb0c in public OnDialogResponse (playerid=0, dialogid=72, response=1, listitem=-1, inputtext[]=@0x00b45ab4 "") at C:\Users\Filip\Desktop\SAMP 0.3Z\TRUNK\FURNITURING\rp.pwn:12879
[21:20:39] [debug] Run time error 4: "Array index out of bounds"
[21:20:39] [debug]  Accessing element at index 3092 past array upper bound 99
[21:20:39] [debug] AMX backtrace:
[21:20:39] [debug] #0 0017bcc4 in public Streamer_OnPlayerEditObject (playerid=0, playerobject=1, objectid=570, response=1, Float:fX=1647.13757, Float:fY=-2329.55200, Float:fZ=13.54688, Float:fRotX=0.00000, Float:fRotY=0.00000, Float:fRotZ=0.00000) at C:\Users\Filip\Desktop\SAMP 0.3Z\TRUNK\FURNITURING\rp.pwn:32186
[21:20:39] [debug] #1 native CallLocalFunction () [00472a10] from samp-server.exe
[21:20:39] [debug] #2 00008cbc in public OnPlayerEditObject (playerid=0, playerobject=1, objectid=570, response=1, Float:fX=1647.13757, Float:fY=-2329.55200, Float:fZ=13.54688, Float:fRotX=0.00000, Float:fRotY=0.00000, Float:fRotZ=0.00000) at C:\Users\Filip\Desktop\SAMP 0.3Z\pawno\include\streamer.inc:383

in this public

//FURNITURE
pawn Код:
public OnPlayerEditObject(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ)
{
    new Float:oldX, Float:oldY, Float:oldZ,Float:oldRotX, Float:oldRotY, Float:oldRotZ;
    GetDynamicObjectPos(objectid, oldX, oldY, oldZ);
    GetDynamicObjectRot(objectid, oldRotX, oldRotY, oldRotZ);
    if(response == EDIT_RESPONSE_FINAL)
    {
        SetDynamicObjectPos(objectid, fX, fY, fZ);
        SetDynamicObjectRot(objectid, fRotX, fRotY, fRotZ);
    //32186 ObjectInfo[editingobject[playerid]][Furx] = fX;
        ObjectInfo[editingobject[playerid]][Fury] = fY;
        ObjectInfo[editingobject[playerid]][Furz] = fZ;
        ObjectInfo[editingobject[playerid]][Furrx] = fRotX;
        ObjectInfo[editingobject[playerid]][Furry] = fRotY;
        ObjectInfo[editingobject[playerid]][Furrz] = fRotZ;
        SendClientMessage(playerid,-1,"Furniture System: You've finished editing object!");
        SaveObjects(editingobject[playerid]);
        editingobject[playerid] = 999;
    }
    if(response == EDIT_RESPONSE_CANCEL)
    {
        SetDynamicObjectPos(editingobject[playerid], oldX, oldY, oldZ);
        SetDynamicObjectRot(editingobject[playerid], oldRotX, oldRotY, oldRotZ);
        SendClientMessage(playerid,-1,"Furniture System: You've canceled editing object!");
        editingobject[playerid] = 999;
    }
}
pawn Код:
case DIALOG_FBUY:
        {
            if(!response)
            {
                usingslot[playerid] = 999;
                DestroyDynamicObject(preview[playerid]);
                preview[playerid] = 0;
                objectmodel[playerid] = 0;
                objectprice[playerid] = 0;
                return 1;
            }
            else if(response)
            {
                if(GetPlayerMoney(playerid) < objectprice[playerid])
                {
                    SendClientMessage(playerid,-1,"You don't have enough money to buy this item!");
                    usingslot[playerid] = 999;
                    DestroyDynamicObject(preview[playerid]);
                    preview[playerid] = 0;
                    objectmodel[playerid] = 0;
                    objectprice[playerid] = 0;
                    return 1;
                }
                new Float:oX,Float:oY,Float:oZ;
                new Float:rX,Float:rY,Float:rZ;
                GetDynamicObjectRot(preview[playerid],rX,rY,rZ);
                new wid = GetPlayerVirtualWorld(playerid);
                new pint = GetPlayerInterior(playerid);
                GetDynamicObjectPos(preview[playerid],oX,oY,oZ);
                FurnitureInfo[playerid][Slot][usingslot[playerid]] = preview[playerid];
            //12879 ObjectInfo[preview[playerid]][Furnid] = preview[playerid];
                ObjectInfo[preview[playerid]][Furmodelid] = objectmodel[playerid];
                ObjectInfo[preview[playerid]][Furx] = oX;
                ObjectInfo[preview[playerid]][Fury] = oY;
                ObjectInfo[preview[playerid]][Furz] = oZ;
                ObjectInfo[preview[playerid]][Furrx] = rX;
                ObjectInfo[preview[playerid]][Furry] = rY;
                ObjectInfo[preview[playerid]][Furrz] = rZ;
                ObjectInfo[preview[playerid]][Furworldid] = wid;
                ObjectInfo[preview[playerid]][Furinteriorid] = pint;
                new str[1024];
                format(str,sizeof(str),"INSERT INTO rp_objects (`fid`,`modelid`,`Furx`,`Fury`,`Furz`,`Furrx`,`Furry`,`Furrz`,`Fworldid`,`Finteriorid`) VALUES ('%d','%d','%f','%f','%f','%f','%f','%f','%d','%d')",preview[playerid],objectmodel[playerid],oX,oY,oZ,rX,rY,rZ,wid,pint);
                mysql_query(str,QUERY_SAVE_FURNITURES,QUERY_SAVE_FURNITURES);
                DestroyDynamicObject(preview[playerid]);
                fobject[preview[playerid]] = CreateDynamicObject(ObjectInfo[preview[playerid]][Furmodelid],ObjectInfo[preview[playerid]][Furx],ObjectInfo[preview[playerid]][Fury],ObjectInfo[preview[playerid]][Furz],ObjectInfo[preview[playerid]][Furrx],ObjectInfo[preview[playerid]][Furry],ObjectInfo[preview[playerid]][Furrz],ObjectInfo[preview[playerid]][Furworldid],ObjectInfo[preview[playerid]][Furinteriorid],-1,50.0);
                preview[playerid] = 0;
                objectmodel[playerid] = 0;
                objectprice[playerid] = 0;
                SendClientMessage(playerid,-1,"Furniture System: You have bought an object!");
                printf("%s", str);
            }
        }
Reply
#2

up !
Reply
#3

upppp
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)