Jump to content
  • 0

Am nevoie de ajutor. urgent


Madalin.

Question

Ma puteti ajuta ? Am si eu o comanda la comanda de edit text pe masina la vipcar, si cand apes sa mut la dreapta sau stanga nu mai merge nimic dispar sagetile de mutat si trebuie mereu sa dau esc ca sa dau cancel
cod

CMD:vipcar(playerid,params[]) {
    if(!IsPlayerInAnyVehicle(playerid)) return Error(playerid, "You are not in your vehicle.");
    new veh = GetPlayerVehicleID(playerid);
    if(OwnedVeh(veh) == -1) return Error(playerid, "Nu esti intr-un vehiculul personal care iti apartine.");
    new cct = OwnedVeh(veh);
    if(CarInfo[cct][cOwned] != PlayerInfo[playerid][pSQLID]) return Error(playerid, "Acesta nu este vehiculul tau.");
    if(CarInfo[cct][cVip] == false) return Error(playerid, "This vehicle is not Vip.");
    new model = CarInfo[cct][cModel];
    if(!(model == 560 || model == 541 || model == 411 || model == 451)) return Error(playerid, "You are not in a Infernus/Bullet/Sultan/Turismo.");
    new string[212];
    format(string,sizeof string,"Item\tCurrent value\nDisplay/hide text \t%s\nText set on vehicle\t%s\nText color\t{%s}%s\nChange position\nVip wheels\nReset Vip Text Position\nReset vehicle tunning", (CarInfo[cct][cVipShow]) ? ("{C9FFA6}Showed") : ("{ff0000}hidden"),  CarInfo[cct][cVipname], CarInfo[cct][cVipnamecolor], CarInfo[cct][cVipnamecolor]);
    ShowPlayerDialog(playerid, DIALOG_VIPCAR, DIALOG_STYLE_TABLIST_HEADERS, "VIP CAR MENU", string, "Select", "Cancel");
    return 1;
}
public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz) {
    SetDynamicObjectPos(objectid, x, y, z);
    SetDynamicObjectRot(objectid, rx, ry, rz);
    Streamer_SetFloatData(STREAMER_TYPE_OBJECT, objectid, E_STREAMER_ATTACH_OFFSET_X, x);
    if(response == EDIT_RESPONSE_FINAL) {
        if( GetPVarInt(playerid, "IsVipEdit") == 1) {
            new veh = GetPlayerVehicleID(playerid);
            SetPVarInt(playerid, "IsVipEdit", 0);
            new idd = caridxx[veh];
            new Float:ofx, Float:ofy, Float:ofz, Float:ofaz;
            new Float:finalx, Float:finaly;
            new Float:px, Float:py, Float:pz, Float:roz;
            GetVehiclePos(veh, px, py, pz);
            GetVehicleZAngle(veh, roz);
            ofx = x-px;
            ofy = y-py;
            ofz = z-pz;
            ofaz = rz-roz;
            finalx = ofx*floatcos(roz, degrees)+ofy*floatsin(roz, degrees);
            finaly = -ofx*floatsin(roz, degrees)+ofy*floatcos(roz, degrees);
            CarInfo[idd][cVX] = finalx;
            CarInfo[idd][cVY] = finaly;
            CarInfo[idd][cVZ] = ofz;
            CarInfo[idd][cVRX] = rx;
            CarInfo[idd][cVRY] = ry;
            CarInfo[idd][cVRZ] = ofaz;
            new query[248];
            mysql_format(SQL,query,sizeof query,"UPDATE `cars` SET `X` = '%f',`Y` = '%f',`Z` = '%f',`RX`='%f',`RY`='%f',`RZ`='%f' WHERE `ID` = '%d' LIMIT 1",CarInfo[idd][cVX],CarInfo[idd][cVY],CarInfo[idd][cVZ],CarInfo[idd][cVRX],CarInfo[idd][cVRY],CarInfo[idd][cVRZ],CarInfo[idd][cID]);
            mysql_tquery(SQL,query,"","");
            AttachDynamicObjectToVehicle(objectid, veh,CarInfo[idd][cVX],  CarInfo[idd][cVY],  CarInfo[idd][cVZ],  CarInfo[idd][cVRX],  CarInfo[idd][cVRY],  CarInfo[idd][cVRZ]);
        }
    }
    if(response == EDIT_RESPONSE_CANCEL)
    {
        new veh = GetPlayerVehicleID(playerid);
        VIPNameVehicle(veh);
    }
    return 1;
}

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.