I get crash when typing this CMD, But other admins won't
#1

This /gedit open and /gedit close. I get crashed when im typing them, But others wont

Код:
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 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?
Reply
#2

If It doesn't crash the server/nearby players then I don't think it has something to do with your code, try reinstalling your GTA in a new directory.
Reply
#3

Quote:
Originally Posted by DaniceMcHarley
Посмотреть сообщение
If It doesn't crash the server/nearby players then I don't think it has something to do with your code, try reinstalling your GTA in a new directory.
Yes im the only one who crash when typing this CMD.

Heres my GTA Directory:

Reply
#4

up need hlep
Reply
#5

Quote:
Originally Posted by PawnOX
Посмотреть сообщение
Yes im the only one who crash when typing this CMD.

Heres my GTA Directory:

you use mods like cleo thats why it is crashing try to remove them.
Reply
#6

Quote:
Originally Posted by SturtIndia
Посмотреть сообщение
you use mods like cleo thats why it is crashing try to remove them.
I already did, Still crashing
Reply
#7

Try re-installing your GTA to a neat one as I said, get rid of these unknown files and cleos aswell.
Reply
#8

If you're crashing when attaching/creating objects, it either means your SA-MP.dll/sampgui.png is messed up or you have graphical modifications (also maybe .dll ones).
Reply
#9

If you have mods like weapon mods and vehicles ,remove them ,this happened with me before,and i fixed it by removing the mods
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)