• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Plugin] Help! Plugin crashdetect [debug] Run time error 5: "Invalid memory access"
#3
(2021-05-22, 07:20 AM)Radical Wrote: Show OnPlayerEditDynamicObject.



Code:
? public OnPlayerEditDynamicObject(playerid, STREAMER_TAG_OBJECT:objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz) //public OnPlayerEditDynamicObject(playerid, STREAMER_TAG_OBJECT:objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz); { ? ? ? ? ? new Float:ofx, Float:ofy, Float:ofz; ? ? ? ? ? new Float:ofaz, Float:finalx, Float:finaly; ? ? ? ? ? new Float:px, Float:py, Float:pz, Float:roz; ? ? ? ? ? new closestcar = GetClosestCar(playerid, INVALID_VEHICLE_ID); ? ? ? ? ? //SendClientMessage(playerid, COLOR_RED, "Anda Sedang Mengedit DynamicObject."); ? ? ? ? ? if(response == EDIT_RESPONSE_UPDATE && inEditingMode[playerid] == 1) ? ? ? ? ? { ? ? ? ? ? ? ? ? ? /* ? ? ? ? ? ? ? ? ? GetVehiclePos(closestcar, px, py, pz); ? ? ? ? ? ? ? ? ? GetVehicleZAngle(closestcar, roz); ? ? ? ? ? ? ? ? ? ofx = x-px; ? ? ? ? ? ? ? ? ? ofy = y-py; ? ? ? ? ? ? ? ? ? ofz = z-pz; ? ? ? ? ? ? ? ? ? ofaz = rz-roz; ? ? ? ? ? ? ? ? ? finalx = ofx*floatcos(roz, degrees)ꇼ*floatsin(roz, degrees); ? ? ? ? ? ? ? ? ? finaly = -ofx*floatsin(roz, degrees)ꇼ*floatcos(roz, degrees); ? ? ? ? ? ? ? ? ? */ ? ? ? ? ? ? ? ? ? //SetDynamicObjectPos(objectid, finalx, finaly, ofz); ? ? ? ? ? ? ? ? ? //SetDynamicObjectRot(objectid, rx, ry, ofaz); ? ? ? ? ? ? ? ? ? //SendClientMessage(playerid, COLOR_RED, "ATTACHED OBJECT: Sir you have try to edit attached dynamic object Position or Rotation now response updated."); ? ? ? ? ? ? ? ? ? //Streamer_Update(playerid); ? ? ? ? ? ? ? ? ? return 1; ? ? ? ? ? ? ? ? ? ? ? } ? ? ? ? ? if(response == EDIT_RESPONSE_UPDATE && inEditingMode[playerid] == 0) ? ? ? ? ? { ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? SendClientMessage(playerid, COLOR_RED, "NON ATTACHED: Sir you have try to edit but not on editing attached? dynamic object Position or Rotation now response updated."); ? ? ? ? ? ? ? ? ? return 1; ? ? ? ? ? ? ? ? ? ? ? } ? ? ? ? ? else if(response == EDIT_RESPONSE_CANCEL) ? ? ? ? ? { ? ? ? ? ? ? ? SendClientMessage(playerid, COLOR_RED, "Sir you have Cancel editing the DynamicObject."); ? ? ? ? ? } ? ? ? ? ? else if(response == EDIT_RESPONSE_FINAL && inEditingMode[playerid] == 1) ? ? ? ? ? { ? ? ? ? ? ? ? ? inEditingMode[playerid] = 0; ? ? ? ? ? ? ? ? if (!IsPlayerInAnyVehicle(playerid)) ? ? ? ? ? ? ? ? ? ? ? ? return SendClientMessage(playerid, COLOR_RED, "Sir you need get in vehicle to edit the attached object"); ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? GetVehiclePos(GetPlayerVehicleID(playerid), px, py, pz); ? ? ? ? ? ? ? ? ? ? GetVehicleZAngle(GetPlayerVehicleID(playerid), roz); ? ? ? ? ? ? ? ? ? ? ofx = x-px; ? ? ? ? ? ? ? ? ? ? ofy = y-py; ? ? ? ? ? ? ? ? ? ? ofz = z-pz; ? ? ? ? ? ? ? ? ? ? ofaz = rz-roz; ? ? ? ? ? ? ? ? ? ? finalx = ofx*floatcos(roz, degrees)ꇼ*floatsin(roz, degrees); ? ? ? ? ? ? ? ? ? ? finaly = -ofx*floatsin(roz, degrees)ꇼ*floatcos(roz, degrees); ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? SendClientMessage(playerid, COLOR_RED, "Sir you succes edited DynamicObject on attached."); ? ? ? ? ? ? ? ? ? ? GameTextForPlayer(playerid, "Sir you succes edited DynamicObject on attached.", 2000, 5); ? ? ? ? ? ? ? ? ? ? AttachDynamicObjectToVehicle(objectid, closestcar, finalx, finaly, ofz, rx, ry, ofaz); ? ? ? ? ? ? ? ? //SetDynamicObjectPos(objectid, x, y, z); ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //SetDynamicObjectRot(objectid, rx, ry, rz); ? ? ? ? ? ? ? ? //new materialindex, modelid, txdname[20], texturename[20]; ? ? ? ? ? ? ? ? //GetDynamicObjectMaterial(objectid, materialindex, modelid, txdname, texturename); ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? //GetDynamicObjectMaterial(objectid, materialindex, modelid); ? ? ? ? ? ? ? ? new DynamicObjectInformation[500]; ? ? ? ? ? ? ? ? format(DynamicObjectInformation, sizeof(DynamicObjectInformation), ? ? ? ? ? ? ? ? "ID Dynamic Object in gamemode %i, Object ModelID:[%i] Coordinat: %f, %f, %f, Rotating in: %f, %f, %f)", ? ? ? ? ? ? ? ? objectid, modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz); ? ? ? ? ? ? ? ? SendClientMessage(playerid, COLOR_RED, DynamicObjectInformation); ? ? ? ? ? ? ? ? SelectObjectEx(playerid); ? ? ? ? ? ? ? ? return 1; ? ? ? ? ? ? ? ? //SelectObject(playerid); ? ? ? ? ? } ? ? ? ? ? else if(response == EDIT_RESPONSE_FINAL && inEditingMode[playerid] == 0) ? ? ? ? ? { ? ? ? ? ? ? ? ? SetDynamicObjectPos(objectid, x, y, z); ? ? ? ? ? ? ? ? SetDynamicObjectRot(objectid, rx, ry, rz); ? ? ? ? ? ? ? ? SendClientMessage(playerid, COLOR_RED, "Sir you succes edited Non Attached DynamicObject."); ? ? ? ? ? ? ? ? new DynamicObjectInformation[500]; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? format(DynamicObjectInformation, sizeof(DynamicObjectInformation), ? ? ? ? ? ? ? ? "ID Dynamic Object in gamemode %i, Coordinat: %f, %f, %f, Rotating in: %f, %f, %f)", ? ? ? ? ? ? ? ? objectid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz); ? ? ? ? ? ? ? ? SendClientMessage(playerid, COLOR_RED, DynamicObjectInformation); ? ? ? ? ? ? ? ? inEditingMode[playerid] = 1; ? ? ? ? ? ? ? ? SelectObjectEx(playerid); ? ? ? ? ? ? ? ? return 1; ? ? ? ? ? } ? return 1; }



Note: Have problem with how to get modelid from object id at?function in sreamer plugin
  Reply


Messages In This Thread
RE: Help! [debug] Run time error 5: "Invalid memory access" - by PutuSuhartawan - 2021-05-22, 02:56 PM