29.07.2014, 01:29
This /gedit open and /gedit close. I get crashed when im typing them, But others wont
I think the problem is inside my GTA directory.
I have some mods, CLEO mods, but i already uninstalled it.
So whats the problem? How to fix it?
Код:
CMD:gedit(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 5) { return 1; } if(AdminDuty[playerid] != 1 && PlayerInfo[playerid][pAdmin] < 6) { SendClientMessage(playerid,COLOR_WHITE, "You're not on-duty as admin. To access your admin commands you must be on-duty. Type /aduty to go on-duty."); return 1; } new string[128], choice[32], gateid, Float:ofloat; if(sscanf(params, "s[32]iF", choice, gateid, ofloat)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gedit [name] [gateid] [value]{AFAFAF}(Put (0) at Object to delete the gate)"); SendClientMessage(playerid, COLOR_GREY, "OPTIONS: object | close | open | speed | range | hid"); return 1; } if(gateid >= MAX_GATES) { SendClientMessage(playerid, COLOR_WHITE, "Invalid Gate ID!"); return 1; } if(strcmp(choice, "open", true) == 0) { gEdit[playerid] = 2; gEditID[playerid] = gateid; GetDynamicObjectPos(GateInfo[gateid][gGate], gPos[playerid][0], gPos[playerid][1], gPos[playerid][2]); GetDynamicObjectRot(GateInfo[gateid][gGate], gRot[playerid][0], gRot[playerid][1], gRot[playerid][2]); EditDynamicObject(playerid, GateInfo[gateid][gGate]); format(string, sizeof(string), " You are now editing gate ID %d's opening position.", gateid); SendClientMessage(playerid, COLOR_WHITE, string); SendClientMessage(playerid, COLOR_YELLOW, "NOTE: Set your gate closing to position to make your gate saves when server restart! (/gedit close)"); SaveGates(); format(string, sizeof(string), " %s has set the gate ID %d's open position", GetPlayerNameEx(playerid), gateid); Log("logs/gedit.log", string); } if(strcmp(choice, "close", true) == 0) { gEdit[playerid] = 1; gEditID[playerid] = gateid; GetDynamicObjectPos(GateInfo[gateid][gGate], gPos[playerid][0], gPos[playerid][1], gPos[playerid][2]); GetDynamicObjectRot(GateInfo[gateid][gGate], gRot[playerid][0], gRot[playerid][1], gRot[playerid][2]); EditDynamicObject(playerid, GateInfo[gateid][gGate]); format(string, sizeof(string), " You are now editing gate ID %d's Close position.", gateid); SendClientMessage(playerid, COLOR_WHITE, string); SaveGates(); SendClientMessage(playerid, COLOR_YELLOW, "NOTE: Set your gate opening to position to make your gate saves when server restart! (/gedit open)"); format(string, sizeof(string), " %s has set the gate ID %d's close position", GetPlayerNameEx(playerid), gateid); Log("logs/gedit.log", string); }
Код:
public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz) { new string[128], idx = gEditID[playerid]; if(response == EDIT_RESPONSE_CANCEL) { SetDynamicObjectPos(objectid, gPos[playerid][0], gPos[playerid][1], gPos[playerid][2]); SetDynamicObjectRot(objectid, gRot[playerid][0], gRot[playerid][1], gRot[playerid][2]); gPos[playerid][0] = 0; gPos[playerid][1] = 0; gPos[playerid][2] = 0; gRot[playerid][0] = 0; gRot[playerid][1] = 0; gRot[playerid][2] = 0; format(string, sizeof(string), " You have canceled editing gate ID %d.", idx); SendClientMessage(playerid, COLOR_WHITE, string); } else if(response == EDIT_RESPONSE_FINAL) { SetDynamicObjectPos(objectid, x, y, z); SetDynamicObjectRot(objectid, rx, ry, rz); if(gEdit[playerid] == 1) { GateInfo[idx][gCX] = x; GateInfo[idx][gCY] = y; GateInfo[idx][gCZ] = z; GateInfo[idx][gCRX] = rx; GateInfo[idx][gCRY] = ry; GateInfo[idx][gCRZ] = rz; // if(IsValidDynamic3DTextLabel(GateInfo[idx][gText])) DestroyDynamic3DTextLabel(GateInfo[idx][gText]); format(string, sizeof(string), "Gate ID: %d", idx); // GateInfo[idx][gText] = CreateDynamic3DTextLabel(string, COLOR_WHITE, GateInfo[idx][gCX], GateInfo[idx][gCY], GateInfo[idx][gCZ], 10); gEdit[playerid] = 0; gEditID[playerid] = 0; format(string, sizeof(string), " You have finished editing gate ID %d's closing position.", idx); SendClientMessage(playerid, COLOR_WHITE, string); GateInfo[idx][gStatus] = 0; } else if(gEdit[playerid] == 2) { GateInfo[idx][gOX] = x; GateInfo[idx][gOY] = y; GateInfo[idx][gOZ] = z; GateInfo[idx][gORX] = rx; GateInfo[idx][gORY] = ry; GateInfo[idx][gORZ] = rz; gEdit[playerid] = 0; gEditID[playerid] = 0; format(string, sizeof(string), " You have finished editing gate ID %d's opening position.", idx); SendClientMessage(playerid, COLOR_WHITE, string); GateInfo[idx][gStatus] = 1; } } return 1; }
I have some mods, CLEO mods, but i already uninstalled it.
So whats the problem? How to fix it?