EditDynamicObject and EditObject
#1

Hi guys i have problem with EditDynamicObject and/or EditObject.

First i tried with EditObject, then the functions to change object position are showing but when i hit SAVE button, OnPlayerEditObject is not called ?!?!

Then i tried with EditDynamicObject and OnPlayerEditDynamicObject but then i don't get the functions to edit the object...

WHAT TO DO ?
I have OnPlayerEditAttachedObject for my clothes shop and is working really good but i can't make this to work !!!!!!
Reply
#2

Show us the code.
Reply
#3

pawn Код:
if(strcmp(cmd, "/srediznakce", true) == 0)
    {
        if(xkukja2[playerid] != 0)
        {
            new Float:x,Float:y,Float:z;
            GetPlayerPos(playerid,x,y,z);
            forsaleznak = CreateObject(19471, x, y, z+2, 0.0, 0.0, 0.0);
            EditObject(playerid, forsaleznak);
        }
        else
        {
            SendClientMessage(playerid, WHITE, "{F20000}GRESKA: {FFFFFF}Koristete prvo /kreirajkukja !");
        }
    }
pawn Код:
public OnPlayerEditObject(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ)
{
    print("asd");
    if(response == EDIT_RESPONSE_FINAL)
    {
        znakx[playerid] = fX;
        znaky[playerid] = fY;
        znakz[playerid] = fZ;
        znakrx[playerid] = fRotX;
        znakry[playerid] = fRotY;
        znakrz[playerid] = fRotZ;

        new szDestination[300];
        new szDestination1[664];
        format(szDestination, sizeof(szDestination), "INSERT INTO `Kukji` (hOwned, hOwner, hEntrancex, hEntrancey, hEntrancez, hExitx, hExity, hExitz, hDiscription, hValue, hInt, hLock, hLevel, hRent, hRentabil)");
        format(szDestination1, sizeof(szDestination1), "%s VALUES ('0', 'Drzava', '%f', '%f', '%f', '%f', '%f', '%f', '%s', '%d', '%d', '1', '%d', '1', '1000')", szDestination, xkukja1[playerid], ykukja1[playerid], zkukja1[playerid], xkukja2[playerid], ykukja2[playerid], zkukja2[playerid], kukjaintime, kukjabuyprice[playerid], kukjainterior1[playerid], kukjalevel[playerid]);
        mysql_function_query(1, szDestination1, false, "KreiranjeKukja", "");

        for(new i = 0; i < MAX_HOUSES; i++)
        {
            new query[100];
            mysql_format(1,query,sizeof(query), "SELECT * FROM `Kukji` WHERE KukjaID = '%d'",i);
            mysql_function_query(1,query,true,"PrevcitajKukji","i",i);
        }
    }

    if(response == EDIT_RESPONSE_CANCEL)
    {
        SendClientMessage(playerid, COLOR_GRAD1, "{37F906}INFO: {FFFFFF}Uspesno kreiravte kukja !");
    }
    return 1;
}
The code print("asd"); is not printing, so the function is not called
Reply
#4

Try declaring the variable forsaleznak as a player variable
pawn Код:
new forsaleznak[MAX_PLAYERS];
//then in the command
if(strcmp(cmd, "/srediznakce", true) == 0)
    {
        if(xkukja2[playerid] != 0)
        {
            new Float:x,Float:y,Float:z;
            GetPlayerPos(playerid,x,y,z);
            forsaleznak[playerid] = CreateObject(19471, x, y, z+2, 0.0, 0.0, 0.0);
            EditObject(playerid, forsaleznak);
        }
        else
        {
            SendClientMessage(playerid, WHITE, "{F20000}GRESKA: {FFFFFF}Koristete prvo /kreirajkukja !");
        }
    }
//do the same with onplayereditobject
Reply
#5

NO, its still not working... It doesn't print so the callback is not called...

OFF TOPIC: Hah why are you not proud to be argentinian ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)