SA-MP Forums Archive
coordonatesavecommand problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: coordonatesavecommand problem (/showthread.php?tid=99812)



coordonatesavecommand problem - BMGP - 30.09.2009

ok i made a coodonatessavecommand:
Код:
if(!strcmp(cmd, "/ssave", true))
	{
		if(IsPlayerAdmin(playerid))
		{
			//Position
			new string1[128];
			new Float:XCoordsSave, Float:YCoordsSave, Float:ZCoordsSave;	
			GetPlayerPos(playerid, XCoordsSave, YCoordsSave, ZCoordsSave);
			
			//Sound
			new Float:XCoordsSaveSound, Float:ZCoordsSaveSound, Float:YCoordsSaveSound
			GetPlayerPos(playerid, XCoordsSaveSound, YCoordsSaveSound, ZCoordsSaveSound);
			PlayerPlaySound(playerid,1150,XCoordsSaveSound, YCoordsSaveSound, ZCoordsSaveSound);
			
			//Position
			new File:pos=fopen("CoordonatesSaves.txt", io_append);
			format(string1, 256, "%s\r\n {%f, %f, %f}", XCoordsSave, YCoordsSave, ZCoordsSave);
			fwrite(pos, string1);
			fclose(pos);
			SendClientMessage(playerid,COLOR_RED,"Racepoint gespeichert!");
		}
		else
		{
			SendClientMessage(playerid,COLOR_RED,"Du musst Admin sein um das machen zu kцnnen!");
		}
		return 1;
	}
Нt save the Coordonates, but with Errors:

Код:
{-1655.850708, 13.881608, 0.000000}
{-1654.343261, 13.994992, 0.000000}ч
{-1657.223510, 13.926807, 0.000000}Š
{-1580.377563, 24.313919, 0.000000}л
{-1668.388549, 13.343750, 0.000000}

{-1670.535888, 13.335947, 0.000000}
Код:
1. -> (л,ч,) ????
2. there is something wrong with the Z Angle, what??


BMGP



Re: coordonatesavecommand problem - dice7 - 30.09.2009

pawn Код:
//Sound
            new Float:XCoordsSaveSound, Float:ZCoordsSaveSound, Float:YCoordsSaveSound
            GetPlayerPos(playerid, XCoordsSaveSound, YCoordsSaveSound, ZCoordsSaveSound);
            PlayerPlaySound(playerid,1150,XCoordsSaveSound, YCoordsSaveSound, ZCoordsSaveSound);
You do not need the position, since play player sound is bugged and works with every position. Just put zeros in

pawn Код:
format(string1, 256, "%s\r\n {%f, %f, %f}", XCoordsSave, YCoordsSave, ZCoordsSave);
Why the %s ?


Re: coordonatesavecommand problem - BMGP - 30.09.2009

i saw that in wikipedia to start every /ssave a new line^^

Should i use PlayerPlaySound(playerid,1150,1,1,1); or anything?! cause i see the 1,1,1 very often xD


Re: coordonatesavecommand problem - dice7 - 30.09.2009

The %s is a replacement for strings. Get rid of it, since you're formating floats only.
To start a new line, use \n or \r\n which will start a new line and write at the beginning of it.

Also, you can do
PlayerPlaySound(playerid,1150,1,1,1); or
PlayerPlaySound(playerid,1150,0,0,0); or
PlayerPlaySound(playerid,1150,1337,1337,1337);

because it is bugged and the last 3 numbers are irrelevant


Re: coordonatesavecommand problem - yom - 30.09.2009

Quote:
Originally Posted by dice7
Also, you can do
PlayerPlaySound(playerid,1150,1,1,1); or
PlayerPlaySound(playerid,1150,0,0,0); or
PlayerPlaySound(playerid,1150,1337,1337,1337);

because it is bugged and the last 3 numbers are irrelevant
Dude they are not irrelevant... They are parameters for playing a sound at a specific position. And it works for me.


Re: coordonatesavecommand problem - dice7 - 30.09.2009

Well it doesn't work for me, nor the people on my server


Re: coordonatesavecommand problem - BMGP - 30.09.2009

juhu it works!