SelectObject does this to some players?
#1

https://www.youtube.com/watch?v=sBys...annel=BenJones

It makes the interior disappear for a second and then comes back.




Could someone kindly assist?

pawn Код:
public OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ)
{
    printf("Player %d selected object %d", playerid, objectid);
    if(type > 0)
    {
        return SendClientMessage(playerid, COLOUR_GREY, "You cannot edit this object.");
    }
    return 1;
}
public OnPlayerSelectDynamicObject(playerid, objectid, modelid, Float:x, Float:y, Float:z)
{
    new fnid;
    for(new f = 1; f < MAX_FURNI; f++)
    {
        if(FurniObject[f] == objectid)
        {
            fnid = f;
        }
    }
    if(FurniSQLID[fnid] < 1)return SendClientMessage(playerid, COLOUR_GREY, "You cannot edit this object.");
    if(DeletingFurni[playerid] == 0)
    {
        new furni;
        for(new i = 1; i < MAX_FURNI; i++)
        {
            if(FurniObject[i] == objectid && objectid > 0)
            {
                furni = i;
                break;
            }
        }
        if(AdminLevel[playerid] < 1 && FurniOwner[furni] != PlayerSQLID[playerid])return SendClientMessage(playerid, COLOUR_GREY, "You cannot edit this item.");
        FurniSQLSent[playerid] = furni;
        EditDynamicObject(playerid, furni);
    }
    else if(DeletingFurni[playerid] == 1)
    {
        new id;
        for(new a = 1; a < MAX_FURNI; a++)
        {
            if(FurniObject[a] == objectid && objectid > 0)
            {
                id = a;
                break;
            }
        }
        new query[128];
        format(query, sizeof(query), "DELETE FROM `furniture` WHERE `id` = %d", FurniSQLID[id]);
        mysql_tquery(dbHandle, query, "", "");
        DestroyDynamicObject(FurniObject[id]);
        HoldingFurni[playerid] = 0;
        FurniObject[id] = -1;
        FurniSQLID[id] = -1;
        FurniX[id] = -1;
        FurniY[id] = -1;
        FurniZ[id] = -1;
        FurniVW[id] = -1;
        FurniInt[id] = -1;
        FurniCode[id] = -1;
    }
    return 1;
}
pawn Код:
CMD:editfurni(playerid, params[])
{
    if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");
    SelectObject(playerid);
    return 1;
}
Reply
#2

Still not resolved.
Reply
#3

Is the rest of the interior mapped as well, or is that an original interior? Didn't see much of it.

If it's a mapping, it could be (for whatever reason) that the Streamer re-creates all objects. However I don't see any code above that would force this, except it deletes an incorrect objectid.

If it's an original interior, check your interior ID when this happens. Looks like it changes. Maybe another script that changes your interior in OnPlayerSelect(Dynamic)Object?
Reply
#4

It is a mapping.

It doesn't change when this happens for some reason.
Reply
#5

Check this line:

Код:
EditDynamicObject(playerid, furni);
You should replace furni by either objectid or FurniObject[furni], since you set furni to the index of FurniObject, not the containing ID.
Now I don't know if this is the cause, but it may edit the wrong ID which could be anything.
Reply
#6

Thanks for your help will review this.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)