14.03.2017, 22:48
OnPlayerEditObject dont want to edit everything below "radar" edit and for every edit below "radar" is gona read edit from "radar" and crate lag on server i try to put more approvement to response for to check object and a lot more.But code dosent work i dont know what is problem, this problem is slowing me down to open my samp server i worked on mode for 8 months is not from scrach but almost...
SORRY FOR MY BAD ENGLISH IF YOU DONT UNDERSTAND MY TEXT
SORRY FOR MY BAD ENGLISH IF YOU DONT UNDERSTAND MY TEXT
Код:
forward OnPlayerEditObject(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ); public OnPlayerEditObject(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ) { if(response == EDIT_RESPONSE_FINAL) { if(edituje[playerid] != -1) { new i = edituje[playerid]; new string[128]; RadarInfo[i][rPosX] = fX; RadarInfo[i][rPosY] = fY; RadarInfo[i][rPosZ] = fZ; RadarInfo[i][rPosrX] = fRotX; RadarInfo[i][rPosrY] = fRotY; RadarInfo[i][rPosrZ] = fRotZ; edituje[playerid] = -1; DestroyObject(RadarInfo[i][rID]); RadarInfo[i][rID] = CreateDynamicObject(18880,RadarInfo[i][rPosX],RadarInfo[i][rPosY],RadarInfo[i][rPosZ],RadarInfo[i][rPosrX],RadarInfo[i][rPosrY],RadarInfo[i][rPosrZ],300); format(string,sizeof(string),""plava"INFO: "bela"Radar ID %d je uspesno editovan",i); SCM(playerid,-1,string); SacuvajRadare(i); } } if(response == EDIT_RESPONSE_FINAL) { new Float:angle, string[100]; GetPlayerFacingAngle(playerid, angle); if(tData[playerid] != -1) { new tid = tData[playerid]; ToaletInfo[tid][atX] = fX; ToaletInfo[tid][atY] = fY; ToaletInfo[tid][atZ] = fZ; ToaletInfo[tid][atAngle] = fRotZ; DestroyObject(ToaletInfo[tid][atObjekat]); KreirajToalet(tid); SacuvajToalet(tid); format(string,sizeof(string),""plava"INFO: "bela"Toalet ID %d je uspesno editovan!",tid); SCM(playerid,-1,string); tid = -1; return 1; } } if(response == EDIT_RESPONSE_FINAL) { new Float:angle, string[100]; GetPlayerFacingAngle(playerid, angle); if(eData[playerid] != -1) { new id = eData[playerid]; AtmInfo[id][aX] = fX; AtmInfo[id][aY] = fY; AtmInfo[id][aZ] = fZ; AtmInfo[id][aAngle] = fRotZ; DestroyObject(AtmInfo[id][aObjekat]); KreirajAtm(id); SacuvajATM(id); format(string,sizeof(string),""plava"INFO: "bela"Bankomat ID %d je uspesno editovan!",id); SCM(playerid,-1,string); id = -1; return 1; } } if(response == EDIT_RESPONSE_FINAL) { new Float:angle, string[100]; GetPlayerFacingAngle(playerid, angle); if(kData[playerid] != -1) { new kid = kData[playerid]; KioskInfo[kid][kiX] = fX; KioskInfo[kid][kiY] = fY; KioskInfo[kid][kiZ] = fZ; KioskInfo[kid][kiA] = fRotZ; DestroyObject(KioskInfo[kid][kiObjekat]); KreirajKiosk(kid); SacuvajKiosk(kid); format(string,sizeof(string),""plava"INFO: "bela"Kiosk ID %d je uspesno editovan!",kid); SCM(playerid,-1,string); kid = -1; return 1; } } if(response == EDIT_RESPONSE_FINAL) { new Float:angle, string[100]; GetPlayerFacingAngle(playerid, angle); if(sData[playerid] != -1) { new sid = sData[playerid]; StandInfo[sid][stX] = fX; StandInfo[sid][stY] = fY; StandInfo[sid][stZ] = fZ; StandInfo[sid][stA] = fRotZ; DestroyObject(StandObjekat[sid]); StandLP(sid); SacuvajStand(sid); format(string,sizeof(string),""plava"INFO: "bela"Stand ID %d je uspesno editovan!",sid); SCM(playerid,-1,string); sid = -1; return 1; } } return 1; }