SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Português/Portuguese

Reply
 
Thread Tools Display Modes
Old 29/05/2020, 11:24 PM   #1
PaulinSAMP
Big Clucker
 
PaulinSAMP's Avatar
 
Join Date: Apr 2020
Location: San Andreas
Posts: 85
Reputation: 3
Post OnPlayerEditDynamicObject não funciona

estou fazendo o sistema de editar o objeto, mas n está chamando a opção de chamar, só pegar a funcão de apertar 'esc'. quem ajudar dou +REP
pawn Code:
if(dialogid == D_MOBILIA)
    {
        if(response)
        {
            new dinheiro = ObjInfo[listitem][ObjetoPreco];
            if(GetPlayerGranaHonk(playerid) < dinheiro)
            {
                SendClientMessage(playerid, COR_ERRO, "* Você não dinheiro sufuciente");
                return 1;
            }
            new Float: x, Float: y, Float: z;
            GetPlayerPos(playerid, x, y, z);
            GetXYInFrontOfPlayer(playerid, x, y, 3.0);
            ObjetoItem[playerid] = CreateDynamicObject(ObjInfo[listitem][ObjetoID], x, y, z, 0.0, 0.0, 0.0);
            EditDynamicObject(playerid, ObjetoItem[playerid]);
            Objeto[playerid] = ObjInfo[listitem][ObjetoID];
            EditingFurniture[playerid] = false;
            return 1;
        }
        return 1;
    }
public OnPlayerEditDynamicObject(playerid, objectid, response, Float: x, Float: y, Float: z, Float: rx, Float: ry, Float: rz)
{
    if(response == EDIT_RESPONSE_CANCEL)
    {
        CancelEdit(playerid);
        DestroyDynamicObject(objectid);
        GameTextForPlayer(playerid, "Cancelado", 2500, 4);
    }
    else
    {  
        if(EditingFurniture[playerid] == false)
        {
            new dinheiro = ObjInfo[objectid][ObjetoPreco];
            GivePlayerGranaHonk(playerid, dinheiro);
            format(hFile, sizeof(hFile), "Mobilias/Mobilia%d.ini", proximamobilia);
            if(!DOF2_FileExists(hFile))
            {
                DOF2_CreateFile(hFile);
                DOF2_SetString(hFile, "Comprador", PlayerName(playerid));
                DOF2_SetInt(hFile, "Preco", dinheiro);
                DOF2_SetInt(hFile, "Numero", proximamobilia);
                DOF2_SetInt(hFile, "ID", objectid);
                DOF2_SetString(hFile, "Nome", ObjInfo[objectid][ObjetoNome]);
                DOF2_SetFloat(hFile, "PosicaoX", x);
                DOF2_SetFloat(hFile, "PosicaoY", y);
                DOF2_SetFloat(hFile, "PosicaoZ", z);
                DOF2_SetFloat(hFile, "rX", rx);
                DOF2_SetFloat(hFile, "rY", ry);
                DOF2_SetFloat(hFile, "rZ", rz);
                DOF2_SaveFile();
            }
            SendClientFormat(playerid, -1, "{00ff00}* Você comprou a mobilia com sucesso. ( ID: %d | Preco: %d )", objectid, DOF2_GetInt(hFile, "Preco"));
            proximamobilia++;
        }
        else
        {
            DestroyDynamicObject(objectid);
            GetDynamicObjectRot(objectid, rx, ry, rz);
            format(hFile, sizeof(hFile), "Mobilias/Mobilia%d.ini", NoObjeto[playerid]);
            DOF2_SetFloat(hFile, "PosicaoX", x);
            DOF2_SetFloat(hFile, "PosicaoY", y);
            DOF2_SetFloat(hFile, "PosicaoZ", z);
            DOF2_SetFloat(hFile, "rX", rx);
            DOF2_SetFloat(hFile, "rY", ry);
            DOF2_SetFloat(hFile, "rZ", rz);
            SendClientMessage(playerid, -1, "{00ff00}* Objeto salvo com sucesso");
            ObjetoItem[playerid] = CreateDynamicObject(objectid, x, y, z, rx, ry, rz);
            EditingFurniture[playerid] = false;
        }
    }
}
PaulinSAMP is offline   Reply With Quote
Old 29/05/2020, 11:54 PM   #2
PaulinSAMP
Big Clucker
 
PaulinSAMP's Avatar
 
Join Date: Apr 2020
Location: San Andreas
Posts: 85
Reputation: 3
Default Re: OnPlayerEditDynamicObject não funciona

alguém?
PaulinSAMP is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
OnPlayerEditDynamicObject dh240473 Scripting Help 0 14/10/2015 03:14 AM
OnPlayerEditDynamicObject bug (rep+) haridz Scripting Help 3 01/05/2015 01:45 AM
About OnPlayerEditDynamicObject Adi007 Scripting Help 8 23/04/2015 09:45 AM
OnPlayerEditDynamicObject Banditukas Scripting Help 0 23/03/2015 02:33 PM
OnPlayerEditDynamicObject AA9 Scripting Help 6 13/06/2014 03:18 PM


All times are GMT. The time now is 04:16 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.