Command not working
#1

Hi there, it`s kinda late to me so I`m going to post it fast. I made a simple /save command which saves your postion and rotationa angle into a .ini file. The only problem is that when I do /save it does .... NUTHING.... maybe I`m just too tired to find the issues. If you can help, I would be very grateful

Код:
dcmd_save(playerid, params[])
{
	#pragma unused params
	new Float:x, Float:y, Float:z, Float:a, string[128], file[128], pname[MAX_PLAYER_NAME];
	GetPlayerName(playerid, pname, sizeof(pname));
	GetPlayerPos(playerid, x, y, z);
	GetPlayerFacingAngle(playerid, a);
	format(string, sizeof(string), "%f, %f, %f, %f", x, y, z, a);
	format(file, sizeof(file), "\\Misc\\%s.ini", pname);
	if(!dini_Exists(file))
	{
		dini_Create(file);
		dini_Set(file, "position", string);
		SendClientMessage(playerid, COLOUR_RED, "Position saved!");
		return 1;
	}
	else
	{
		dini_Set(file, "position", string);
		SendClientMessage(playerid, COLOUR_RED, "Position saved!");
		return 1;
	}
 	return 1;
}
Reply
#2

I thought folders were indicated with just ONE '\' instead of TWO ('\\')
Reply
#3

Yeah I think you're formatting your file position incorrectly. Try it like this.

pawn Код:
format(file, sizeof(file), "/Misc/%s.ini", pname);
Or change the folder name to however your scriptfiles are set up.
Reply
#4

Umm no, that`s not the problem because my register system is like that.

Код:
				new pname[MAX_PLAYER_NAME], file[128], string[128];
				GetPlayerName(playerid, pname, sizeof(pname));
				format(file, sizeof(file), "\\Users\\%s.ini", pname);
				dini_Create(file);
Reply
#5

Your command isent working because your trying to do: /save, Which is a client-side command or w/e you call it,
There may be other problems but change the name of your command.. Otherwise it wont work at all

Same with /q and /quit too
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)